crypto / org.apache.tuweni.crypto.sodium / KeyDerivation / MasterKey / deriveKeyArray

deriveKeyArray

fun deriveKeyArray(length: Int, subkeyId: Long, context: ByteArray): ByteArray (source)

Derive a sub key.

Parameters

length - The length of the sub key, which must be between #minSubKeyLength() and #maxSubKeyLength().

subkeyId - The id for the sub key.

context - The context for the sub key, which must be of length #contextLength().

Return
The derived sub key.

fun deriveKeyArray(length: Int, subkeyId: Long, context: String): ByteArray (source)

Derive a sub key.

Parameters

length - The length of the subkey.

subkeyId - The id for the subkey.

context - The context for the sub key, which must be of length ≤ #contextLength().

Return
The derived sub key.