Package-level declarations
Types
Defines whether a cipher is authenticated or not
Marker interface indicating a block cipher. Purely informational
A generic ciphertext object, referencing the algorithm it was created by.
Typealias defining the signature of the lambda for processing the MAC output into an auth tag.
Typealias defining the signature of the lambda for defining a custom MAC input calculation scheme.
Marker, indicating whether a symmetric encryption algorithms requires or prohibits the use of a nonce/IV
Represents symmetrically encrypted data in a structured manner. Construct using SymmetricEncryptionAlgorithm.sealedBoxFrom
Marker interface indicating a block cipher. Purely informational
Base interface for every symmetric encryption algorithm. A Symmetric encryption algorithm is characterised by:
Symmetric encryption key. Can only be used for the specified algorithm.
Properties
The default dedicated mac output transform as per RFC 7518, taking the first authTagSize many bytes of the MAC output as auth tag.
The default dedicated mac input calculation as per RFC 7518, authenticating all inputs: AAD || IV || Ciphertext || AAD Length
, where AAD_length is a 64 bit big-endian representation of the aad length in bits
The encryption key bytes, if present.
The dedicated MAC key bytes, if present.
Creates a SealedBoxBuilder matching this algorithm's characteristics:
The actual encryption key bytes
Functions
Creates a SealedBox matching the characteristics of the underlying SealedBoxBuilder.algorithm. Use this function to load external encrypted data for decryption. Returns a KmmResult purely for the sake of consistency, even though this operation will always success
Creates a SealedBox matching the characteristics of the underlying SealedBoxBuilder.algorithm. Use this function to load external encrypted data for decryption. Returns a KmmResult purely for the sake of consistency
Creates a SealedBox matching the characteristics of the underlying SealedBoxBuilder.algorithm. Use this function to load external encrypted data for decryption.
Use to smart-cast this algorithm
Use to smart cast
Use to smart-cast this sealed box
Use to smart-cast this algorithm
Use to smart cast
Use to smart-cast this algorithm
Use to smart-cast this algorithm
Use to smart cast
Use to smart-cast this algorithm
Creates a SymmetricKey from the specified secretKey. Returns KmmResult.failure in case the provided bytes don't match SymmetricEncryptionAlgorithm.keySize
Creates a SymmetricKey from the specified encryptionKey and macKey. Returns KmmResult.failure in case the provided bytes don't match SymmetricEncryptionAlgorithm.keySize or the specified macKey is empty.
Generates a fresh random key for this algorithm.
Generates a fresh random key for this algorithm. macKeyLength can be specified to override preferredMacKeyLength.
Generates a new random nonce matching the Nonce size of this algorithm. You typically don't want to use this, but have your nonces auto-generated during the encryption process
Use to smart-cast this algorithm
Use to smart cast