AuthenticatedEncryptionProvider.Encrypt Method

Definition

Overloads

Encrypt(Byte[], Byte[])

Encrypts the 'plaintext'

Encrypt(Byte[], Byte[], Byte[])

Encrypts the 'plaintext'

Encrypt(Byte[], Byte[])

Encrypts the 'plaintext'

public virtual Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult Encrypt (byte[] plaintext, byte[] authenticatedData);
abstract member Encrypt : byte[] * byte[] -> Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult
override this.Encrypt : byte[] * byte[] -> Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult
Public Overridable Function Encrypt (plaintext As Byte(), authenticatedData As Byte()) As AuthenticatedEncryptionResult

Parameters

plaintext
Byte[]

the data to be encrypted.

authenticatedData
Byte[]

will be combined with iv and ciphertext to create an authenticationtag.

Returns

AuthenticatedEncryptionResultcontaining ciphertext, iv, authenticationtag.

Exceptions

authenticationData is null or empty.

AES crypto operation threw. See inner exception for details.

Applies to

Encrypt(Byte[], Byte[], Byte[])

Encrypts the 'plaintext'

public virtual Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult Encrypt (byte[] plaintext, byte[] authenticatedData, byte[] iv);
abstract member Encrypt : byte[] * byte[] * byte[] -> Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult
override this.Encrypt : byte[] * byte[] * byte[] -> Microsoft.IdentityModel.Tokens.AuthenticatedEncryptionResult
Public Overridable Function Encrypt (plaintext As Byte(), authenticatedData As Byte(), iv As Byte()) As AuthenticatedEncryptionResult

Parameters

plaintext
Byte[]

the data to be encrypted.

authenticatedData
Byte[]

will be combined with iv and ciphertext to create an authenticationtag.

iv
Byte[]

initialization vector for encryption.

Returns

AuthenticatedEncryptionResultcontaining ciphertext, iv, authenticationtag.

Exceptions

authenticatedData is null or empty.

Thrown if the AES crypto operation threw. See inner exception for details.

Thrown if the internal SignatureProvider is disposed.

Applies to