SecuredKeyEncryptor
public struct SecuredKeyEncryptor : Encryptor
A struct that provides encryption and decryption functionalities using SecuredKey.
-
Initializes a new instance of
SecuredKeyEncryptor.This initializer attempts to create a
SecuredKeywith the given application tag. If it fails, the initializer returnsnil.Declaration
Swift
public init?() -
encrypt(data:Asynchronous) Encrypts the given data.
Throws
EncryptorError.failedToEncryptif the encryption fails.Declaration
Swift
public func encrypt(data: Data) async throws -> DataParameters
dataThe data to encrypt.
Return Value
The encrypted data.
-
decrypt(data:Asynchronous) Decrypts the given data.
Throws
EncryptorError.failedToDecryptif the decryption fails.Declaration
Swift
public func decrypt(data: Data) async throws -> DataParameters
dataThe data to decrypt.
Return Value
The decrypted data.