clarify public vs private keys + make prvate key IDs available

This commit is contained in:
Lysann Tranvouez 2026-03-11 16:16:50 +01:00
parent 4e19d9e714
commit 5a92b6fda7
11 changed files with 56 additions and 30 deletions

View file

@ -167,12 +167,17 @@ struct GopenPGPInterface: PGPInterface {
return encryptedData.getBinary()!
}
var keyID: [String] {
publicKeys.keys.map { $0.uppercased() }
func getKeyIDs(type: PGPKey) -> [String] {
switch type {
case .PUBLIC:
return publicKeys.keys.map { $0.uppercased() }
case .PRIVATE:
return privateKeys.keys.map { $0.uppercased() }
}
}
var shortKeyID: [String] {
publicKeys.keys.map { $0.suffix(8).uppercased() }
func getShortKeyIDs(type: PGPKey) -> [String] {
getKeyIDs(type: type).map { $0.suffix(8).uppercased() }
}
private func findDecryptionKey(message: CryptoPGPMessage, keyIDHint: String?) throws -> CryptoKey? {