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

PublicKey

class PublicKey (source)

A Diffie-Helman public key.

Functions

bytes

fun bytes(): Bytes

bytesArray

fun bytesArray(): ByteArray

equals

fun equals(other: Any?): Boolean

forBoxPublicKey

static fun forBoxPublicKey(publicKey: PublicKey): PublicKey

Creates a new public key based on a signature public key.

forSignaturePublicKey

static fun forSignaturePublicKey(publicKey: PublicKey): PublicKey

Creates a new public key based on a signature public key.

fromBytes

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

Create a PublicKey from an array of bytes.

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

hashCode

fun hashCode(): Int

length

static fun length(): Int

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