tuweni / org.apache.tuweni.crypto.sodium / DiffieHelman / Secret

Secret

class Secret : Destroyable (source)

A Diffie-Helman shared secret.

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

forKeys

Compute a shared Secret from a secret key and a public key.

static fun forKeys(secretKey: SecretKey!, publicKey: PublicKey!): Secret!

fromBytes

Create a Secret from an array of bytes.

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

hashCode

fun hashCode(): Int

isDestroyed

fun isDestroyed(): Boolean

length

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

static fun length(): Int