tuweni / org.apache.tuweni.crypto.sodium / AES256GCM / Nonce / fromBytes

fromBytes

static fun fromBytes(bytes: Bytes!): Nonce! (source)

Create a Nonce from an array of bytes.

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

Parameters

bytes - Bytes!: The bytes for the nonce.

Return
Nonce!: A nonce, based on these bytes.

static fun fromBytes(bytes: ByteArray!): Nonce! (source)

Create a Nonce from an array of bytes.

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

Parameters

bytes - ByteArray!: The bytes for the nonce.

Exceptions

UnsupportedOperationException - If AES256-GSM support is not available.

Return
Nonce!: A nonce, based on these bytes.