tuweni / org.apache.tuweni.crypto.sodium / XChaCha20Poly1305 / decryptDetached

decryptDetached

static fun decryptDetached(cipherText: Bytes!, mac: Bytes!, key: Key!, nonce: Nonce!): Bytes! (source)

Decrypt a message using a given key and a detached message authentication code.

Parameters

cipherText - Bytes!: The cipher text to decrypt.

mac - Bytes!: The message authentication code.

key - Key!: The key to use for decryption.

nonce - Nonce!: The nonce that was used for encryption.

Return
Bytes!: The decrypted data, or null if verification failed.

@Nullable static fun decryptDetached(cipherText: ByteArray!, mac: ByteArray!, key: Key!, nonce: Nonce!): ByteArray? (source)

Decrypt a message using a given key and a detached message authentication code.

Parameters

cipherText - ByteArray!: The cipher text to decrypt.

mac - ByteArray!: The message authentication code.

key - Key!: The key to use for decryption.

nonce - Nonce!: The nonce that was used for encryption.

Return
ByteArray?: The decrypted data, or null if verification failed.

@Nullable static fun decryptDetached(cipherText: Bytes!, mac: Bytes!, data: Bytes!, key: Key!, nonce: Nonce!): Bytes? (source)

Decrypt a message using a given key and a detached message authentication code.

Parameters

cipherText - Bytes!: The cipher text to decrypt.

mac - Bytes!: The message authentication code.

data - Bytes!: Extra non-confidential data that is included within the encrypted payload.

key - Key!: The key to use for decryption.

nonce - Nonce!: The nonce that was used for encryption.

Return
Bytes?: The decrypted data, or null if verification failed.

@Nullable static fun decryptDetached(cipherText: ByteArray!, mac: ByteArray!, data: ByteArray!, key: Key!, nonce: Nonce!): ByteArray? (source)

Decrypt a message using a given key and a detached message authentication code.

Parameters

cipherText - ByteArray!: The cipher text to decrypt.

mac - ByteArray!: The message authentication code.

data - ByteArray!: Extra non-confidential data that is included within the encrypted payload.

key - Key!: The key to use for decryption.

nonce - Nonce!: The nonce that was used for encryption.

Exceptions

UnsupportedOperationException - If XChaCha20Poly1305 support is not available.

Return
ByteArray?: The decrypted data, or null if verification failed.