move functions around
This commit is contained in:
parent
db60b52605
commit
05324cebe8
1 changed files with 17 additions and 17 deletions
|
|
@ -100,6 +100,23 @@ public class PGPAgent {
|
|||
return try pgpInterface.encrypt(plainData: plainData, keyIDs: [keyID])
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Use encrypt(plainData:keyIDs:) or encryptWithAllKeys(plainData:) instead.")
|
||||
public func encrypt(plainData: Data) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
return try pgpInterface.encrypt(plainData: plainData, keyID: nil)
|
||||
}
|
||||
|
||||
public func encryptWithAllKeys(plainData: Data) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
return try pgpInterface.encryptWithAllKeys(plainData: plainData)
|
||||
}
|
||||
|
||||
public func decrypt(encryptedData: Data, requestPGPKeyPassphrase: @escaping (String) -> String) throws -> Data? {
|
||||
// Remember the previous status and set the current status
|
||||
let previousDecryptStatus = latestDecryptStatus
|
||||
|
|
@ -122,23 +139,6 @@ public class PGPAgent {
|
|||
return result
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Use encrypt(plainData:keyID:) or encryptWithAllKeys(plainData:) instead.")
|
||||
public func encrypt(plainData: Data) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
return try pgpInterface.encrypt(plainData: plainData, keyID: nil)
|
||||
}
|
||||
|
||||
public func encryptWithAllKeys(plainData: Data) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
return try pgpInterface.encryptWithAllKeys(plainData: plainData)
|
||||
}
|
||||
|
||||
public var isPrepared: Bool {
|
||||
keyStore.contains(key: PGPKey.PUBLIC.getKeychainKey())
|
||||
&& keyStore.contains(key: PGPKey.PRIVATE.getKeychainKey())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue