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
cryptoVirgilCrypto instance
-
Decrypts EncryptedKeyknoxValue
Throws
KeyknoxCryptoError.emptyPublicKeysListis public keys list is emptyKeyknoxManagerError.decryptionFailedif decryption failed- Rethrows from
VirgilCrypto
Declaration
Swift
public func decrypt(encryptedKeyknoxValue: EncryptedKeyknoxValue, privateKey: VirgilPrivateKey, publicKeys: [VirgilPublicKey]) throws -> DecryptedKeyknoxValueParameters
encryptedKeyknoxValueencrypted value from Keyknox service
privateKeyprivate key to decrypt data. Should be of type VirgilPrivateKey
publicKeysallowed public keys to verify signature. Should be of type VirgilPublicKey
Return Value
DecryptedKeyknoxValue
-
Encrypts data for Keyknox
Throws
KeyknoxCryptoError.emptyPublicKeysListis public keys list is emptyKeyknoxCryptoError.emptyDataif data if empty- Rethrows from
RecipientCipher,Signer
Declaration
Swift
public func encrypt(data: Data, privateKey: VirgilPrivateKey, publicKeys: [VirgilPublicKey]) throws -> (Data, Data)Parameters
dataData to encrypt
privateKeyPrivate key to sign data. Should be of type VirgilPrivateKey
publicKeysPublic keys to encrypt data. Should be of type VirgilPublicKey
Return Value
Meta information and encrypted blob
KeyknoxCrypto Class Reference