confluent-kafka-dotnet
Show / Hide Table of Contents

Class StreamDecryptor

STREAM online authenticated encryption, defined in the paper Online Authenticated-Encryption and its Nonce-Reuse Misuse-Resistance .

Inheritance
object
StreamDecryptor
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.SchemaRegistry.Encryption.Vendored.Miscreant
Assembly: Confluent.SchemaRegistry.Encryption.dll
Syntax
public sealed class StreamDecryptor : IDisposable

Methods

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
TypeNameDescription
byte[]key

The secret key for decryption.

byte[]nonce

The nonce for decryption.

Returns
TypeDescription
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
TypeNameDescription
byte[]key

The secret key for decryption.

byte[]nonce

The nonce for decryption.

Returns
TypeDescription
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
TypeNameDescription
byte[]ciphertext

The ciphertext to decrypt.

byte[]data

Associated data items to authenticate.

boollast

True if this is the last block in the STREAM.

Returns
TypeDescription
byte[]

The decrypted plaintext.

Exceptions
TypeCondition
CryptographicException

Thrown when the ciphertext is invalid.

Implements

IDisposable
In this article