共用方式為


Rfc3161TimestampToken.VerifySignatureForHash 方法

定義

多載

VerifySignatureForHash(ReadOnlySpan<Byte>, HashAlgorithmName, X509Certificate2, X509Certificate2Collection)

驗證目前權杖是否為所提供資料雜湊與演算法識別碼的有效時間戳記權杖。

VerifySignatureForHash(ReadOnlySpan<Byte>, Oid, X509Certificate2, X509Certificate2Collection)

驗證目前權杖是否為所提供資料雜湊與演算法識別碼的有效時間戳記權杖。

VerifySignatureForHash(ReadOnlySpan<Byte>, HashAlgorithmName, X509Certificate2, X509Certificate2Collection)

來源:
Rfc3161TimestampToken.cs
來源:
Rfc3161TimestampToken.cs
來源:
Rfc3161TimestampToken.cs
來源:
Rfc3161TimestampToken.cs

驗證目前權杖是否為所提供資料雜湊與演算法識別碼的有效時間戳記權杖。

public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out System.Security.Cryptography.X509Certificates.X509Certificate2? signerCertificate, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? extraCandidates = default);
public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out System.Security.Cryptography.X509Certificates.X509Certificate2 signerCertificate, System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraCandidates = default);
member this.VerifySignatureForHash : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * X509Certificate2 * System.Security.Cryptography.X509Certificates.X509Certificate2Collection -> bool
Public Function VerifySignatureForHash (hash As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, ByRef signerCertificate As X509Certificate2, Optional extraCandidates As X509Certificate2Collection = Nothing) As Boolean

參數

hash
ReadOnlySpan<Byte>

要針對此時間戳記權杖進行驗證的加密編譯雜湊。

hashAlgorithm
HashAlgorithmName

產生 hash 的演算法。

signerCertificate
X509Certificate2

當此方法傳回時,則為簽署此權杖的時間戳記授權 (TSA) 中憑證;如果無法判斷簽署者憑證,則為 null。 這個參數會被視為未初始化。

extraCandidates
X509Certificate2Collection

除了權杖中可能包含的任何憑證之外,另有一個選擇性的憑證集合可視為時間戳記授權 (TSA) 憑證。

傳回

如果找到時間戳記授權 (TSA) 憑證,憑證公開金鑰即會驗證權杖簽章,且該權杖符合所提供資料雜湊與演算法識別碼的雜湊,則為 true;否則為 false

備註

此方法要求時間戳授權單位 (TSA) 憑證具有必要的擴充密鑰使用值, (1.3.6.1.5.5.5.7.3.8) , 符合令牌的內嵌 ESSCertID 或 ESSCertID2 標識符、具有包含令牌時間戳值的有效範圍,且具有可成功驗證令牌簽章的公鑰。

判斷適當的 TSA 憑證之後,此方法會比較提供的摘要和演算法識別碼與令牌中適當的值。 如果摘要和演算法都符合令牌的值,則會透過 signerCertificate 報告憑證,而方法會 true傳回 。

如果摘要不相符,則演算法不相符,或無法判斷 TSA 憑證,則方法會回報 signerCertificatenull ,並傳 false回 。

另請參閱

適用於

VerifySignatureForHash(ReadOnlySpan<Byte>, Oid, X509Certificate2, X509Certificate2Collection)

來源:
Rfc3161TimestampToken.cs
來源:
Rfc3161TimestampToken.cs
來源:
Rfc3161TimestampToken.cs
來源:
Rfc3161TimestampToken.cs

驗證目前權杖是否為所提供資料雜湊與演算法識別碼的有效時間戳記權杖。

public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, System.Security.Cryptography.Oid hashAlgorithmId, out System.Security.Cryptography.X509Certificates.X509Certificate2? signerCertificate, System.Security.Cryptography.X509Certificates.X509Certificate2Collection? extraCandidates = default);
public bool VerifySignatureForHash (ReadOnlySpan<byte> hash, System.Security.Cryptography.Oid hashAlgorithmId, out System.Security.Cryptography.X509Certificates.X509Certificate2 signerCertificate, System.Security.Cryptography.X509Certificates.X509Certificate2Collection extraCandidates = default);
member this.VerifySignatureForHash : ReadOnlySpan<byte> * System.Security.Cryptography.Oid * X509Certificate2 * System.Security.Cryptography.X509Certificates.X509Certificate2Collection -> bool
Public Function VerifySignatureForHash (hash As ReadOnlySpan(Of Byte), hashAlgorithmId As Oid, ByRef signerCertificate As X509Certificate2, Optional extraCandidates As X509Certificate2Collection = Nothing) As Boolean

參數

hash
ReadOnlySpan<Byte>

要針對此時間戳記權杖進行驗證的加密編譯雜湊。

hashAlgorithmId
Oid

哈希演算法的 OID。

signerCertificate
X509Certificate2

當此方法傳回時,則為簽署此權杖的時間戳記授權 (TSA) 中憑證;如果無法判斷簽署者憑證,則為 null。 這個參數會被視為未初始化。

extraCandidates
X509Certificate2Collection

除了權杖中可能包含的任何憑證之外,另有一個選擇性的憑證集合可視為時間戳記授權 (TSA) 憑證。

傳回

如果找到時間戳記授權 (TSA) 憑證,憑證公開金鑰即會驗證權杖簽章,且該權杖符合所提供資料雜湊與演算法識別碼的雜湊,則為 true;否則為 false

備註

此方法要求 TSA 憑證具有必要的擴充密鑰使用值, (1.3.6.1.5.5.5.5.7.3.8) ,符合令牌的內嵌 ESSCertID 或 ESSCertID2 標識符、包含令牌時間戳值的有效範圍,且具有成功驗證令牌簽章的公鑰。

判斷適當的 TSA 憑證之後,此方法會比較提供的摘要和演算法識別碼與令牌中適當的值。 如果摘要和演算法都符合令牌的值,則會透過 signerCertificate 報告憑證,而方法會 true傳回 。

如果摘要不相符,則演算法不相符,或無法判斷 TSA 憑證,則方法會回報 signerCertificatenull ,並傳 false回 。

另請參閱

適用於