Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

CryptographicOperations Class

Definition

Namespace:
System.Security.Cryptography
Assemblies:
netstandard.dll, System.Security.Cryptography.dll
Assemblies:
netstandard.dll, System.Security.Cryptography.Primitives.dll
Assembly:
System.Security.Cryptography.Primitives.dll
Assembly:
netstandard.dll
Source:
CryptographicOperations.cs
Source:
CryptographicOperations.cs
Source:
CryptographicOperations.cs
Source:
CryptographicOperations.cs
Source:
CryptographicOperations.cs

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.

Provides methods for common cryptographic operations and reducing side-channel information leakage.

public ref class CryptographicOperations abstract sealed
public static class CryptographicOperations
type CryptographicOperations = class
Public Class CryptographicOperations
Inheritance
CryptographicOperations

Methods

Name Description
FixedTimeEquals(ReadOnlySpan<Byte>, Byte)
FixedTimeEquals(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Determines the equality of two byte sequences in an amount of time that depends on the length of the sequences, but not their values.

HashData(HashAlgorithmName, Byte[])

Computes the hash of data.

HashData(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>)

Computes the hash of data.

HashData(HashAlgorithmName, ReadOnlySpan<Byte>)

Computes the hash of data.

HashData(HashAlgorithmName, Stream, Span<Byte>)

Computes the hash of a stream.

HashData(HashAlgorithmName, Stream)

Computes the hash of a stream.

HashDataAsync(HashAlgorithmName, Stream, CancellationToken)

Asynchronously computes the hash of a stream.

HashDataAsync(HashAlgorithmName, Stream, Memory<Byte>, CancellationToken)

Asynchronously computes the hash of a stream.

HmacData(HashAlgorithmName, Byte[], Byte[])

Computes the HMAC of data.

HmacData(HashAlgorithmName, Byte[], Stream)

Computes the HMAC of a stream.

HmacData(HashAlgorithmName, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>)

Computes the HMAC of data.

HmacData(HashAlgorithmName, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Computes the HMAC of data.

HmacData(HashAlgorithmName, ReadOnlySpan<Byte>, Stream, Span<Byte>)

Computes the HMAC of a stream.

HmacData(HashAlgorithmName, ReadOnlySpan<Byte>, Stream)

Computes the HMAC of a stream.

HmacDataAsync(HashAlgorithmName, Byte[], Stream, CancellationToken)

Asynchronously computes the HMAC of a stream.

HmacDataAsync(HashAlgorithmName, ReadOnlyMemory<Byte>, Stream, CancellationToken)

Asynchronously computes the HMAC of a stream.

HmacDataAsync(HashAlgorithmName, ReadOnlyMemory<Byte>, Stream, Memory<Byte>, CancellationToken)

Asynchronously computes the HMAC of a stream.

TryHashData(HashAlgorithmName, ReadOnlySpan<Byte>, Span<Byte>, Int32)

Attempts to compute the hash of data.

TryHmacData(HashAlgorithmName, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, Span<Byte>, Int32)

Attempts to compute the HMAC of data.

VerifyHmac(HashAlgorithmName, Byte[], Byte[], Byte[])
VerifyHmac(HashAlgorithmName, Byte[], Stream, Byte[])
VerifyHmac(HashAlgorithmName, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
VerifyHmac(HashAlgorithmName, ReadOnlySpan<Byte>, Stream, ReadOnlySpan<Byte>)
VerifyHmacAsync(HashAlgorithmName, Byte[], Stream, Byte[], CancellationToken)
VerifyHmacAsync(HashAlgorithmName, ReadOnlyMemory<Byte>, Stream, ReadOnlyMemory<Byte>, CancellationToken)
ZeroMemory(Span<Byte>)

Fills the provided buffer with zeros.

Applies to


Feedback

Was this page helpful?