CryptographicOperations 類別

定義

提供使用密碼編譯的方法,以減少側通道資訊外泄的風險。

C#
public static class CryptographicOperations
繼承
CryptographicOperations

方法

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

決定兩個字節序列的相等,時間量取決於序列的長度,而不是其值。

HashData(HashAlgorithmName, Byte[])

計算數據的哈希。

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

計算數據的哈希。

HashData(HashAlgorithmName, ReadOnlySpan<Byte>)

計算數據的哈希。

HashData(HashAlgorithmName, Stream, Span<Byte>)

計算數據流的哈希。

HashData(HashAlgorithmName, Stream)

計算數據流的哈希。

HashDataAsync(HashAlgorithmName, Stream, CancellationToken)

以異步方式計算數據流的哈希。

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

以異步方式計算數據流的哈希。

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

計算數據的 HMAC。

HmacData(HashAlgorithmName, Byte[], Stream)

計算數據流的 HMAC。

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

計算數據的 HMAC。

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

計算數據的 HMAC。

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

計算數據流的 HMAC。

HmacData(HashAlgorithmName, ReadOnlySpan<Byte>, Stream)

計算數據流的 HMAC。

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

以異步方式計算數據流的 HMAC。

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

以異步方式計算數據流的 HMAC。

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

以異步方式計算數據流的 HMAC。

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

嘗試計算數據的哈希。

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

嘗試計算數據的 HMAC。

ZeroMemory(Span<Byte>)

以零填滿提供的緩衝區。

適用於

產品 版本
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1