extract

suspend fun extract(algorithm: Algorithm, ikm: SecureByteString, salt: ByteArray?): SecretKey

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

Return

a pseudorandom key as a SecretKey.

Parameters

algorithm

the KDF algorithm to use e.g. Algorithm.HMAC_SHA256.

ikm

input key material as a SecureByteString.

salt

optional salt value (a non-secret random value).

Throws

if the algorithm is not supported.

if ikm has been destroyed.