KeyknoxCrypto

open class KeyknoxCrypto
extension KeyknoxCrypto: KeyknoxCryptoProtocol

KeyknoxCryptoProtocol implementation using VirgilCrypto

  • VirgilCrypto

    Declaration

    Swift

    public let crypto: VirgilCrypto
  • Init

    Declaration

    Swift

    public init(crypto: VirgilCrypto)

    Parameters

    crypto

    VirgilCrypto instance

KeyknoxCryptoProtocol implementation

  • Decrypts EncryptedKeyknoxValue

    Throws

    Declaration

    Swift

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

    Parameters

    encryptedKeyknoxValue

    encrypted value from Keyknox service

    privateKey

    private key to decrypt data. Should be of type VirgilPrivateKey

    publicKeys

    allowed public keys to verify signature. Should be of type VirgilPublicKey

    Return Value

    DecryptedKeyknoxValue

  • Encrypts data for Keyknox

    Throws

    Declaration

    Swift

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

    Parameters

    data

    Data to encrypt

    privateKey

    Private key to sign data. Should be of type VirgilPrivateKey

    publicKeys

    Public keys to encrypt data. Should be of type VirgilPublicKey

    Return Value

    Meta information and encrypted blob