CryptographicOperations Class

Definition

Provides methods for use in working with cryptography to reduce the risk of side-channel information leakage.

C#
public static class CryptographicOperations
Inheritance
CryptographicOperations

Methods

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.

ZeroMemory(Span<Byte>)

Fills the provided buffer with zeros.

Applies to

Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.1