Class StreamDecryptor
STREAM online authenticated encryption, defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance .
Implements
Inherited Members
Namespace: Confluent.SchemaRegistry.Encryption.Vendored.Miscreant
Assembly: Confluent.SchemaRegistry.Encryption.dll
Syntax
public sealed class StreamDecryptor : IDisposableMethods
CreateAesCmacSivDecryptor(byte[], byte[])
Initializes a new instance of the STREAM decryptor using the AES-CMAC-SIV algorithm.
Declaration
public static StreamDecryptor CreateAesCmacSivDecryptor(byte[] key, byte[] nonce)Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | key | The secret key for decryption. |
| byte[] | nonce | The nonce for decryption. |
Returns
| Type | Description |
|---|---|
| StreamDecryptor | A STREAM decryptor instance. |
CreateAesPmacSivDecryptor(byte[], byte[])
Initializes a new instance of the STREAM decryptor using the AES-PMAC-SIV algorithm.
Declaration
public static StreamDecryptor CreateAesPmacSivDecryptor(byte[] key, byte[] nonce)Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | key | The secret key for decryption. |
| byte[] | nonce | The nonce for decryption. |
Returns
| Type | Description |
|---|---|
| StreamDecryptor | A STREAM decryptor instance. |
Dispose()
Disposes this object.
Declaration
public void Dispose()Open(byte[], byte[], bool)
Open decrypts the next ciphertext in the STREAM, authenticates the decrypted plaintext and the associated data and, if successful, returns the result. In case of failed decryption, this method throws CryptographicException.
Declaration
public byte[] Open(byte[] ciphertext, byte[] data = null, bool last = false)Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | ciphertext | The ciphertext to decrypt. |
| byte[] | data | Associated data items to authenticate. |
| bool | last | True if this is the last block in the STREAM. |
Returns
| Type | Description |
|---|---|
| byte[] | The decrypted plaintext. |
Exceptions
| Type | Condition |
|---|---|
| CryptographicException | Thrown when the ciphertext is invalid. |