tuweni / org.apache.tuweni.crypto.sodium / Box / SecretKey

SecretKey

class SecretKey : Destroyable (source)

A Box secret key.

Functions

bytes

Obtain the bytes of this key. WARNING: This will cause the key to be copied into heap memory.

fun bytes(): Bytes!

bytesArray

Obtain the bytes of this key. WARNING: This will cause the key to be copied into heap memory. The returned array should be overwritten when no longer required.

fun bytesArray(): ByteArray!

destroy

fun destroy(): Unit

equals

fun equals(other: Any?): Boolean

forSignatureSecretKey

Transforms the Ed25519 secret key to a Curve25519 secret key. See https://libsodium.gitbook.io/doc/advanced/ed25519-curve25519

static fun forSignatureSecretKey(secretKey: SecretKey!): SecretKey!

fromBytes

Create a SecretKey from an array of bytes.

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

hashCode

fun hashCode(): Int

isDestroyed

fun isDestroyed(): Boolean

length

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

static fun length(): Int