AuthenticatedEncryptionProvider.Encrypt Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for