Encryptor

public protocol Encryptor : Sendable

A protocol that defines methods for encrypting and decrypting data.

  • encrypt(data:) Asynchronous

    Encrypts the given data.

    Throws

    An error if encryption fails.

    Declaration

    Swift

    func encrypt(data: Data) async throws -> Data

    Parameters

    data

    The data to encrypt.

    Return Value

    The encrypted data.

  • decrypt(data:) Asynchronous

    Decrypts the given data.

    Throws

    An error if decryption fails.

    Declaration

    Swift

    func decrypt(data: Data) async throws -> Data

    Parameters

    data

    The data to decrypt.

    Return Value

    The decrypted data.