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

PublicKey

class PublicKey (source)

A Box public key.

Functions

bytes

fun bytes(): Bytes

bytesArray

fun bytesArray(): ByteArray

equals

fun equals(other: Any?): Boolean

forSignaturePublicKey

static fun forSignaturePublicKey(publicKey: PublicKey): PublicKey

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

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).