tuweni / org.apache.tuweni.crypto.sodium / AES256GCM / encrypt

encrypt

fun encrypt(message: Bytes!, nonce: Nonce!): Bytes! (source)

Encrypt a message.

Parameters

message - Bytes!: The message to encrypt.

nonce - Nonce!: A unique nonce.

Return
Bytes!: The encrypted data.

fun encrypt(message: ByteArray!, nonce: Nonce!): ByteArray! (source)

Encrypt a message.

Parameters

message - ByteArray!: The message to encrypt.

nonce - Nonce!: A unique nonce.

Return
ByteArray!: The encrypted data.

fun encrypt(message: Bytes!, data: Bytes!, nonce: Nonce!): Bytes! (source)

Encrypt a message.

Parameters

message - Bytes!: The message to encrypt.

data - Bytes!: Extra non-confidential data that will be included with the encrypted payload.

nonce - Nonce!: A unique nonce.

Return
Bytes!: The encrypted data.

fun encrypt(message: ByteArray!, data: ByteArray!, nonce: Nonce!): ByteArray! (source)

Encrypt a message.

Parameters

message - ByteArray!: The message to encrypt.

data - ByteArray!: Extra non-confidential data that will be included with the encrypted payload.

nonce - Nonce!: A unique nonce.

Return
ByteArray!: The encrypted data.

static fun encrypt(message: Bytes!, key: Key!, nonce: Nonce!): Bytes! (source)

Encrypt a message for a given key.

Parameters

message - Bytes!: The message to encrypt.

key - Key!: The key to encrypt for.

nonce - Nonce!: A unique nonce.

Return
Bytes!: The encrypted data.

static fun encrypt(message: ByteArray!, key: Key!, nonce: Nonce!): ByteArray! (source)

Encrypt a message for a given key.

Parameters

message - ByteArray!: The message to encrypt.

key - Key!: The key to encrypt for.

nonce - Nonce!: A unique nonce.

Return
ByteArray!: The encrypted data.

static fun encrypt(message: Bytes!, data: Bytes!, key: Key!, nonce: Nonce!): Bytes! (source)

Encrypt a message for a given key.

Parameters

message - Bytes!: The message to encrypt.

data - Bytes!: Extra non-confidential data that will be included with the encrypted payload.

key - Key!: The key to encrypt for.

nonce - Nonce!: A unique nonce.

Return
Bytes!: The encrypted data.

static fun encrypt(message: ByteArray!, data: ByteArray!, key: Key!, nonce: Nonce!): ByteArray! (source)

Encrypt a message for a given key.

Parameters

message - ByteArray!: The message to encrypt.

data - ByteArray!: Extra non-confidential data that will be included with the encrypted payload.

key - Key!: The key to encrypt for.

nonce - Nonce!: A unique nonce.

Exceptions

UnsupportedOperationException - If AES256-GSM support is not available.

Return
ByteArray!: The encrypted data.