crypto / net.consensys.cava.crypto.sodium / KeyDerivation / MasterKey

MasterKey

class MasterKey : Destroyable (source)

A KeyDerivation master key.

Functions

bytes

fun bytes(): Bytes

bytesArray

fun bytesArray(): ByteArray

deriveKey

fun deriveKey(length: Int, subkeyId: Long, context: ByteArray): Bytes
fun deriveKey(length: Int, subkeyId: Long, context: String): Bytes

Derive a sub key.

deriveKeyArray

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

Derive a sub key.

destroy

fun destroy(): Unit

equals

fun equals(other: Any?): Boolean

fromBytes

static fun fromBytes(bytes: Bytes): MasterKey
static fun fromBytes(bytes: ByteArray): MasterKey

Create a MasterKey from an array of bytes.

The byte array must be of length #length().

hashCode

fun hashCode(): Int

isDestroyed

fun isDestroyed(): Boolean

length

static fun length(): Int

Obtain the length of the key in bytes (32).

random

static fun random(): MasterKey

Generate a new key using a random generator.