Hkdf

object Hkdf

HMAC-based Extract-and-Expand Key Derivation Function (HKDF) according to RFC 5869.

Functions

Link copied to clipboard
suspend fun deriveKey(algorithm: Algorithm, ikm: SecureByteString, salt: ByteArray?, info: ByteArray, length: Int): SecretKey

Derives a symmetric encryption key according to HKDF as defined by RFC 5869, taking a SecureByteString and returning a SecretKey.

Link copied to clipboard
suspend fun expand(algorithm: Algorithm, prk: SecretKey, info: ByteArray, length: Int): SecretKey

The "expand" part of HKDF with SecretKey pseudorandom key.

Link copied to clipboard
suspend fun extract(algorithm: Algorithm, ikm: SecureByteString, salt: ByteArray?): SecretKey

The "extract" part of HKDF with SecureByteString input key material.