Remove unused elements (#530)

This commit is contained in:
Danny Moesch 2021-12-31 07:35:17 +01:00 committed by GitHub
parent ff6a1edf62
commit 819371f55e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 9 additions and 111 deletions

View file

@ -9,9 +9,6 @@
import ObjectivePGP
struct ObjectivePGPInterface: PGPInterface {
private let publicKey: Key
private let privateKey: Key
private let keyring = ObjectivePGP.defaultKeyring
init(publicArmoredKey: String, privateArmoredKey: String) throws {
@ -22,11 +19,9 @@ struct ObjectivePGPInterface: PGPInterface {
let privateKeys = try ObjectivePGP.readKeys(from: privateKeyData)
keyring.import(keys: publicKeys)
keyring.import(keys: privateKeys)
guard let publicKey = publicKeys.first, let privateKey = privateKeys.first else {
guard publicKeys.first != nil, privateKeys.first != nil else {
throw AppError.keyImport
}
self.publicKey = publicKey
self.privateKey = privateKey
}
func decrypt(encryptedData: Data, keyID _: String?, passphrase: String) throws -> Data? {