PGPAgent can encrypt with multiple keys
This commit is contained in:
parent
b7873e6d72
commit
09b0b150ce
3 changed files with 41 additions and 5 deletions
|
|
@ -89,6 +89,7 @@ public class PGPAgent {
|
|||
return result
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Use encrypt(plainData:keyIDs:) instead.")
|
||||
public func encrypt(plainData: Data, keyID: String) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface else {
|
||||
|
|
@ -105,6 +106,14 @@ public class PGPAgent {
|
|||
return try pgpInterface.encrypt(plainData: plainData, keyIDs: [keyID])
|
||||
}
|
||||
|
||||
public func encrypt(plainData: Data, keyIDs: [String]) throws -> Data {
|
||||
try checkAndInit()
|
||||
guard let pgpInterface else {
|
||||
throw AppError.encryption
|
||||
}
|
||||
return try pgpInterface.encrypt(plainData: plainData, keyIDs: keyIDs)
|
||||
}
|
||||
|
||||
@available(*, deprecated, message: "Use encrypt(plainData:keyIDs:) or encryptWithAllKeys(plainData:) instead.")
|
||||
public func encrypt(plainData: Data) throws -> Data {
|
||||
try checkAndInit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue