Name classes/structs consistently
This commit is contained in:
parent
072f824158
commit
4c2693e2c7
11 changed files with 80 additions and 80 deletions
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// GopenPgp.swift
|
||||
// GopenPGPInterface.swift
|
||||
// passKit
|
||||
//
|
||||
// Created by Danny Moesch on 08.09.19.
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import Crypto
|
||||
|
||||
struct GopenPgp: PgpInterface {
|
||||
struct GopenPGPInterface: PGPInterface {
|
||||
|
||||
private static let errorMapping: [String: Error] = [
|
||||
"gopenpgp: error in unlocking key: openpgp: invalid data: private key checksum failure": AppError.WrongPassphrase,
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// ObjectivePgp.swift
|
||||
// ObjectivePGPInterface.swift
|
||||
// passKit
|
||||
//
|
||||
// Created by Danny Moesch on 08.09.19.
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import ObjectivePGP
|
||||
|
||||
struct ObjectivePgp: PgpInterface {
|
||||
struct ObjectivePGPInterface: PGPInterface {
|
||||
|
||||
private let publicKey: Key
|
||||
private let privateKey: Key
|
||||
|
|
@ -11,7 +11,7 @@ public class PGPAgent {
|
|||
public static let shared: PGPAgent = PGPAgent()
|
||||
|
||||
private let keyStore: KeyStore
|
||||
private var pgpInterface: PgpInterface?
|
||||
private var pgpInterface: PGPInterface?
|
||||
private var latestDecryptStatus: Bool = true
|
||||
|
||||
public init(keyStore: KeyStore = AppKeychain.shared) {
|
||||
|
|
@ -25,9 +25,9 @@ public class PGPAgent {
|
|||
throw AppError.KeyImport
|
||||
}
|
||||
do {
|
||||
pgpInterface = try GopenPgp(publicArmoredKey: publicKey, privateArmoredKey: privateKey)
|
||||
pgpInterface = try GopenPGPInterface(publicArmoredKey: publicKey, privateArmoredKey: privateKey)
|
||||
} catch {
|
||||
pgpInterface = try ObjectivePgp(publicArmoredKey: publicKey, privateArmoredKey: privateKey)
|
||||
pgpInterface = try ObjectivePGPInterface(publicArmoredKey: publicKey, privateArmoredKey: privateKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
//
|
||||
// PgpInterface.swift
|
||||
// PGPInterface.swift
|
||||
// passKit
|
||||
//
|
||||
// Created by Danny Moesch on 08.09.19.
|
||||
// Copyright © 2019 Bob Sun. All rights reserved.
|
||||
//
|
||||
|
||||
protocol PgpInterface {
|
||||
protocol PGPInterface {
|
||||
|
||||
func decrypt(encryptedData: Data, keyID: String, passphrase: String) throws -> Data?
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue