KeyknoxCryptoProtocol

public protocol KeyknoxCryptoProtocol : AnyObject

Protocol with crypto operations needed for Keyknox

  • Decrypts EncryptedKeyknoxValue

    Throws

    Depends on implementation

    Declaration

    Swift

    func decrypt(encryptedKeyknoxValue: EncryptedKeyknoxValue,
                 privateKey: VirgilPrivateKey,
                 publicKeys: [VirgilPublicKey]) throws -> DecryptedKeyknoxValue

    Parameters

    encryptedKeyknoxValue

    encrypted value from Keyknox service

    privateKey

    private key to decrypt data

    publicKeys

    allowed public keys to verify signature

    Return Value

    DecryptedKeyknoxValue

  • Encrypts data for Keyknox

    Throws

    Depends on implementation

    Declaration

    Swift

    func encrypt(data: Data, privateKey: VirgilPrivateKey, publicKeys: [VirgilPublicKey]) throws -> (Data, Data)

    Parameters

    data

    Data to encrypt

    privateKey

    Private key to sign data

    publicKeys

    Public keys to encrypt data

    Return Value

    Meta information and encrypted blob