Add tests in PGPAgentTest
This commit is contained in:
parent
bbc1b8124d
commit
765b487ffa
1 changed files with 3 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ class PGPAgentTest: XCTestCase {
|
||||||
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PUBLIC_KEY, keyType: .PUBLIC)
|
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PUBLIC_KEY, keyType: .PUBLIC)
|
||||||
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PRIVATE_KEY, keyType: .PRIVATE)
|
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PRIVATE_KEY, keyType: .PRIVATE)
|
||||||
XCTAssertTrue(pgpAgent.imported)
|
XCTAssertTrue(pgpAgent.imported)
|
||||||
|
XCTAssertEqual(pgpAgent.pgpKeyID, "A1024DAE")
|
||||||
self.encrypt_decrypt(pgpAgent: pgpAgent)
|
self.encrypt_decrypt(pgpAgent: pgpAgent)
|
||||||
let pgpAgent2 = PGPAgent()
|
let pgpAgent2 = PGPAgent()
|
||||||
try? pgpAgent2.initPGPKeys() // load from the keychain
|
try? pgpAgent2.initPGPKeys() // load from the keychain
|
||||||
|
|
@ -47,12 +48,14 @@ class PGPAgentTest: XCTestCase {
|
||||||
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PUBLIC_KEY, keyType: .PUBLIC)
|
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PUBLIC_KEY, keyType: .PUBLIC)
|
||||||
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PRIVATE_SUBKEY, keyType: .PRIVATE)
|
try? pgpAgent.initPGPKey(with: PGP_RSA2048_PRIVATE_SUBKEY, keyType: .PRIVATE)
|
||||||
XCTAssertTrue(pgpAgent.imported)
|
XCTAssertTrue(pgpAgent.imported)
|
||||||
|
XCTAssertEqual(pgpAgent.pgpKeyID, "A1024DAE")
|
||||||
self.encrypt_decrypt(pgpAgent: pgpAgent)
|
self.encrypt_decrypt(pgpAgent: pgpAgent)
|
||||||
|
|
||||||
// [ED25519] Setup keys.
|
// [ED25519] Setup keys.
|
||||||
try? pgpAgent.initPGPKey(with: PGP_ED25519_PUBLIC_KEY, keyType: .PUBLIC)
|
try? pgpAgent.initPGPKey(with: PGP_ED25519_PUBLIC_KEY, keyType: .PUBLIC)
|
||||||
try? pgpAgent.initPGPKey(with: PGP_ED25519_PRIVATE_KEY, keyType: .PRIVATE)
|
try? pgpAgent.initPGPKey(with: PGP_ED25519_PRIVATE_KEY, keyType: .PRIVATE)
|
||||||
XCTAssertTrue(pgpAgent.imported)
|
XCTAssertTrue(pgpAgent.imported)
|
||||||
|
XCTAssertEqual(pgpAgent.pgpKeyID, "E9444483")
|
||||||
self.encrypt_decrypt(pgpAgent: pgpAgent)
|
self.encrypt_decrypt(pgpAgent: pgpAgent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue