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

encryptDetached

fun encryptDetached(message: Bytes!, nonce: Nonce!): DetachedEncryptionResult! (source)

Encrypt a message, generating a detached message authentication code.

Parameters

message - Bytes!: The message to encrypt.

nonce - Nonce!: A unique nonce.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

fun encryptDetached(message: ByteArray!, nonce: Nonce!): DetachedEncryptionResult! (source)

Encrypt a message, generating a detached message authentication code.

Parameters

message - ByteArray!: The message to encrypt.

nonce - Nonce!: A unique nonce.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: Bytes!, receiver: PublicKey!, sender: SecretKey!, nonce: Nonce!): DetachedEncryptionResult! (source)

Encrypt a message for a given key, generating a detached message authentication code.

Parameters

message - Bytes!: The message to encrypt.

receiver - PublicKey!: The public key of the receiver.

sender - SecretKey!: The secret key of the sender.

nonce - Nonce!: A unique nonce.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.

static fun encryptDetached(message: ByteArray!, receiver: PublicKey!, sender: SecretKey!, nonce: Nonce!): DetachedEncryptionResult! (source)

Encrypt a message for a given key, generating a detached message authentication code.

Parameters

message - ByteArray!: The message to encrypt.

receiver - PublicKey!: The public key of the receiver.

sender - SecretKey!: The secret key of the sender.

nonce - Nonce!: A unique nonce.

Return
DetachedEncryptionResult!: The encrypted data and message authentication code.