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.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor