SecretKey

@Serializable
value class SecretKey(val value: ByteArray)

Symmetric encryption/decryption secret key.

Note: this implementation tries to prevent certain types of attacks by making sure the underlying sensitive key material is always stored at most in one place. This is achieved by putting it on the heap which means it is not moved when the key itself is moved which could otherwise leave a copy of the data in memory. Additionally, the data is behind a Arc which means the key can be cheaply cloned without actually cloning the data. Finally, the data is scrambled (overwritten with zeros) when the key is dropped to make sure it does not stay in the memory past its lifetime.

Constructors

Link copied to clipboard
constructor(value: ByteArray)

Properties

Link copied to clipboard

Functions

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