SymmetricEncryptionAlgorithm
Base interface for every symmetric encryption algorithm. A Symmetric encryption algorithm is characterised by:
an authCapability (AuthCapability.Unauthenticated, AuthCapability.Authenticated.Integrated, AuthCapability.Authenticated.WithDedicatedMac
the keySize
its name
Inheritors
Types
Advanced Encryption Standard
ChaCha20 with Poly-1305 AEAD stream cipher
Properties
Indicates if this algorithm requires a nonce.
Creates a SealedBoxBuilder matching this algorithm's characteristics:
Functions
Use to smart-cast this algorithm
Use to smart-cast this algorithm
Use to smart-cast this algorithm
Use to smart-cast this algorithm
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