Adapt code to changed API of GopenPGP

This commit is contained in:
Danny Moesch 2019-11-08 21:13:28 +01:00 committed by Mingshen Sun
parent 44cb864642
commit 01ac9d38df
2 changed files with 14 additions and 6 deletions

View file

@ -42,10 +42,13 @@ class CryptoFrameworkTest: XCTestCase {
ED25519,
ED25519_SUB,
].forEach { keyTriple in
let pgp = CryptoGetGopenPGP()!
let publicKey = try pgp.buildKeyRingArmored(keyTriple.publicKey)
let privateKey = try pgp.buildKeyRingArmored(keyTriple.privateKey)
var error: NSError?
guard let publicKey = CryptoBuildKeyRingArmored(keyTriple.publicKey, &error),
let privateKey = CryptoBuildKeyRingArmored(keyTriple.privateKey, &error) else {
XCTFail("Keys cannot be initialized.")
return
}
XCTAssertNil(error)
XCTAssert(publicKey.getFingerprint(&error).hasSuffix(keyTriple.fingerprint))
XCTAssertNil(error)