Types

Properties

Link copied to clipboard
abstract val authCapability: A
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val keySize: BitLength

Key length

Link copied to clipboard
abstract val name: String

Human-readable name

Link copied to clipboard
abstract val nonceTrait: I

Indicates if this algorithm requires a nonce.

Link copied to clipboard
abstract val oid: ObjectIdentifier
Link copied to clipboard

Creates a SealedBoxBuilder matching this algorithm's characteristics:

Functions

Link copied to clipboard
@JvmName(name = "hasDedicatedMacAlias")
fun <I : NonceTrait> SymmetricEncryptionAlgorithm<*, I, *>.hasDedicatedMac(): Boolean

Use to smart-cast this algorithm

Link copied to clipboard
@JvmName(name = "isAuthenticatedAlias")
fun <I : NonceTrait, K : KeyType> SymmetricEncryptionAlgorithm<*, I, K>.isAuthenticated(): Boolean

Use to smart-cast this algorithm

Link copied to clipboard
@JvmName(name = "isBlockCipherAlias")
fun <A : AuthCapability<out K>, I : NonceTrait, K : KeyType> SymmetricEncryptionAlgorithm<A, I, K>.isBlockCipher(): Boolean

Use to smart-cast this algorithm

Link copied to clipboard

Use to smart-cast this algorithm

Link copied to clipboard
@JvmName(name = "isStreamCipherAlias")
fun <A : AuthCapability<out K>, I : NonceTrait, K : KeyType> SymmetricEncryptionAlgorithm<A, I, K>.isStreamCipher(): Boolean

Use to smart-cast this algorithm

Link copied to clipboard

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.

Link copied to clipboard

Generates a fresh random key for this algorithm.

Generates a fresh random key for this algorithm. macKeyLength can be specified to override preferredMacKeyLength.

Link copied to clipboard

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

Link copied to clipboard
@JvmName(name = "requiresNonceAlias")
fun <A : AuthCapability<out K>, K : KeyType> SymmetricEncryptionAlgorithm<A, *, K>.requiresNonce(): Boolean

Use to smart-cast this algorithm

Link copied to clipboard
abstract override fun toString(): String