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

decrypt

@Nullable fun decrypt(cipherText: Bytes!, nonce: Nonce!): Bytes? (source)

Decrypt a message using a given key.

Parameters

cipherText - Bytes!: The cipher text to decrypt.

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

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

@Nullable fun decrypt(cipherText: ByteArray!, nonce: Nonce!): ByteArray? (source)

Decrypt a message using a given key.

Parameters

cipherText - ByteArray!: The cipher text to decrypt.

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

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

@Nullable static fun decrypt(cipherText: Bytes!, sender: PublicKey!, receiver: SecretKey!, nonce: Nonce!): Bytes? (source)

Decrypt a message using a given key.

Parameters

cipherText - Bytes!: The cipher text to decrypt.

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

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

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

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

@Nullable static fun decrypt(cipherText: ByteArray!, sender: PublicKey!, receiver: SecretKey!, nonce: Nonce!): ByteArray? (source)

Decrypt a message using a given key.

Parameters

cipherText - ByteArray!: The cipher text to decrypt.

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

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

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

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