decryption: GopenPGPInterface tries to identify decryption key from message metadata
So the system can have multiple private keys, and the caller doesn't need to specify a specific one regardless. Ideally: If there are several matches we could also take into account which keys have already been unlocked (or passthrases saved in keychain). Right now it only grabs the first match.
This commit is contained in:
parent
510eb8e15e
commit
39dab8c6c0
5 changed files with 75 additions and 14 deletions
|
|
@ -24,7 +24,7 @@ struct ObjectivePGPInterface: PGPInterface {
|
|||
}
|
||||
}
|
||||
|
||||
func decrypt(encryptedData: Data, keyID _: String?, passPhraseForKey: @escaping (String) -> String) throws -> Data? {
|
||||
func decrypt(encryptedData: Data, keyIDHint _: String?, passPhraseForKey: @escaping (String) -> String) throws -> Data? {
|
||||
try ObjectivePGP.decrypt(encryptedData, andVerifySignature: false, using: keyring.keys) { selectedKey in
|
||||
guard let selectedKey else {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue