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.
21 lines
536 B
Swift
21 lines
536 B
Swift
//
|
|
// PGPInterface.swift
|
|
// passKit
|
|
//
|
|
// Created by Danny Moesch on 08.09.19.
|
|
// Copyright © 2019 Bob Sun. All rights reserved.
|
|
//
|
|
|
|
protocol PGPInterface {
|
|
func decrypt(encryptedData: Data, keyIDHint: String?, passPhraseForKey: @escaping (String) -> String) throws -> Data?
|
|
|
|
func encrypt(plainData: Data, keyID: String?) throws -> Data
|
|
|
|
func containsPublicKey(with keyID: String) -> Bool
|
|
|
|
func containsPrivateKey(with keyID: String) -> Bool
|
|
|
|
var keyID: [String] { get }
|
|
|
|
var shortKeyID: [String] { get }
|
|
}
|