AesCcm.Decrypt Método
Definição
Sobrecargas
| Decrypt(Byte[], Byte[], Byte[], Byte[], Byte[]) |
Descriptografa o texto cifrado no buffer de destino fornecido caso a marca de autenticação possa ser validada.Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated. |
| Decrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>) |
Descriptografa o texto cifrado no buffer de destino fornecido caso a marca de autenticação possa ser validada.Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated. |
Decrypt(Byte[], Byte[], Byte[], Byte[], Byte[])
Descriptografa o texto cifrado no buffer de destino fornecido caso a marca de autenticação possa ser validada.Decrypts the ciphertext into the provided destination buffer if the authentication tag can be validated.
public void Decrypt (byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[]? associatedData = default);
public void Decrypt (byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[] associatedData = default);
member this.Decrypt : byte[] * byte[] * byte[] * byte[] * byte[] -> unit
Public Sub Decrypt (nonce As Byte(), ciphertext As Byte(), tag As Byte(), plaintext As Byte(), Optional associatedData As Byte() = Nothing)
Parâmetros
- nonce
- Byte[]
O nonce associado a essa mensagem, que deve corresponder ao valor fornecido durante a criptografia.The nonce associated with this message, which must match the value provided during encryption.
- ciphertext
- Byte[]
O conteúdo criptografado a ser descriptografado.The encrypted content to decrypt.
- tag
- Byte[]
A marca de autenticação produzida para esta mensagem durante a criptografia.The authentication tag produced for this message during encryption.
- plaintext
- Byte[]
A matriz de bytes a receber o conteúdo descriptografado.The byte array to receive the decrypted contents.
- associatedData
- Byte[]
Dados extra associados a essa mensagem, que devem corresponder ao valor fornecido durante a criptografia.Extra data associated with this message, which must match the value provided during encryption.
Exceções
O parâmetro plaintext e o ciphertext não têm o mesmo comprimento.The plaintext parameter and the ciphertext do not have the same length.
- ou --or-
O comprimento do parâmetro nonce não é permitido por NonceByteSizes.The nonce parameter length is not permitted by NonceByteSizes.
- ou --or-
O comprimento do parâmetro tag não é permitido por TagByteSizes.The tag parameter length is not permitted by TagByteSizes.
O parâmetro nonce, ciphertext, tag ou plaintext é null.The nonce, ciphertext, tag, or plaintext parameter is null.
Não foi possível verificar o valor da marca ou a operação de descriptografia falhou de outra forma.The tag value could not be verified, or the decryption operation otherwise failed.
Comentários
Se tag não puder ser validado (usando os valores de chave,, nonce ciphertext e associatedData ), plaintext será apagado.If tag cannot be validated (using the key, nonce, ciphertext, and associatedData values), then plaintext is cleared.
Aplica-se a
Decrypt(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, ReadOnlySpan<Byte>)
Descriptografa o texto cifrado no buffer de destino fornecido caso a marca de autenticação possa ser validada.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);
member this.Decrypt : ReadOnlySpan<byte> * ReadOnlySpan<byte> * ReadOnlySpan<byte> * Span<byte> * ReadOnlySpan<byte> -> unit
Public Sub Decrypt (nonce As ReadOnlySpan(Of Byte), ciphertext As ReadOnlySpan(Of Byte), tag As ReadOnlySpan(Of Byte), plaintext As Span(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing)
Parâmetros
- nonce
- ReadOnlySpan<Byte>
O nonce associado a essa mensagem, que deve corresponder ao valor fornecido durante a criptografia.The nonce associated with this message, which must match the value provided during encryption.
- ciphertext
- ReadOnlySpan<Byte>
O conteúdo criptografado a ser descriptografado.The encrypted content to decrypt.
- tag
- ReadOnlySpan<Byte>
A marca de autenticação produzida para esta mensagem durante a criptografia.The authentication tag produced for this message during encryption.
O intervalo de bytes a receber o conteúdo descriptografado.The byte span to receive the decrypted contents.
- associatedData
- ReadOnlySpan<Byte>
Dados extra associados a essa mensagem, que devem corresponder ao valor fornecido durante a criptografia.Extra data associated with this message, which must match the value provided during encryption.
Exceções
O parâmetro plaintext e o ciphertext não têm o mesmo comprimento.The plaintext parameter and the ciphertext do not have the same length.
- ou --or-
O comprimento do parâmetro nonce não é permitido por NonceByteSizes.The nonce parameter length is not permitted by NonceByteSizes.
- ou --or-
O comprimento do parâmetro tag não é permitido por TagByteSizes.The tag parameter length is not permitted by TagByteSizes.
Não foi possível verificar o valor da marca ou a operação de descriptografia falhou de outra forma.The tag value could not be verified, or the decryption operation otherwise failed.
Comentários
Se tag não puder ser validado (usando os valores de chave,, nonce ciphertext e associatedData ), plaintext será apagado.If tag cannot be validated (using the key, nonce, ciphertext, and associatedData values), then plaintext is cleared.