decrypt

abstract fun decrypt(ciphertext: ByteArray, context: EncryptionProviderContext): ByteArray

Decrypts previously encrypted data.

This method is called by the SDK when reading sensitive data from disk.

Return

The decrypted plaintext data

Parameters

ciphertext

The encrypted data to decrypt (as previously returned by encrypt)

context

The same context that was used during encryption. Must match the original context for decryption to succeed.

Throws

EncryptionProviderException

if decryption fails for any reason (wrong key, corrupted data, authentication failure, etc.)