System.Security.Cryptography.AesGcm
Represents an Advanced Encryption Standard (AES) key to be used with the Galois/Counter Mode (GCM) mode of operation.
Gets a value that indicates whether the algorithm is supported on the current platform.
Gets the nonce sizes, in bytes, supported by this instance.
Gets the tag sizes, in bytes, supported by this instance.
Gets the size of the tag, in bytes.
Initializes a new instance of the AesGcm class with a provided key and required tag size.
Initializes a new instance of the AesGcm class with a provided key and required tag size.
public void Decrypt(byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[] associatedData = null)
Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.
public void Decrypt(ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> ciphertext, ReadOnlySpan<byte> tag, Span<byte> plaintext, ReadOnlySpan<byte> associatedData = default)
Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.
Releases the resources used by the current instance of the AesGcm class.
public void Encrypt(byte[] nonce, byte[] plaintext, byte[] ciphertext, byte[] tag, byte[] associatedData = null)
Encrypts the plaintext into the ciphertext destination buffer and generates the authentication tag
into a separate buffer.
public void Encrypt(ReadOnlySpan<byte> nonce, ReadOnlySpan<byte> plaintext, Span<byte> ciphertext, Span<byte> tag, ReadOnlySpan<byte> associatedData = default)
Encrypts the plaintext into the ciphertext destination buffer and generates the authentication tag
into a separate buffer.