tuweni / org.apache.tuweni.crypto.sodium / HMACSHA256 / Key

Key

class Key : Destroyable (source)

A HMACSHA256 secret key.

Functions

bytes

Provides the bytes of this key.

fun bytes(): Bytes!

bytesArray

Provides the bytes of this key.

fun bytesArray(): ByteArray!

destroy

fun destroy(): Unit

equals

fun equals(other: Any?): Boolean

fromBytes

Create a Key from an array of bytes.

static fun fromBytes(bytes: Bytes!): Key!
static fun fromBytes(bytes: ByteArray!): Key!

hashCode

fun hashCode(): Int

isDestroyed

fun isDestroyed(): Boolean

length

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

static fun length(): Int

random

Generate a random Key.

static fun random(): Key!