tuweni / 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 - Int: The length of the sub key, which must be between #minSubKeyLength() and #maxSubKeyLength().

subkeyId - Long: The id for the sub key.

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

Return
ByteArray!: The derived sub key.

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

Derive a sub key.

Parameters

length - Int: The length of the subkey.

subkeyId - Long: The id for the subkey.

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

Return
ByteArray!: The derived sub key.