expand

suspend fun expand(algorithm: Algorithm, prk: SecretKey, info: ByteArray, length: Int): SecretKey

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

Return

output keying material as a SecretKey.

Parameters

algorithm

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

prk

a pseudorandom key as a SecretKey.

info

context and application specific information (can be zero-length).

length

length of output keying material in octets.

Throws

if the algorithm is not supported or length is invalid.

if prk has been destroyed.