語言

Rfc3161TimestampRequest.CreateFromData 方法

定義

透過對所提供的資料進行雜湊,並以指定的演算法產生時間戳請求。

public static System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest CreateFromData(ReadOnlySpan<byte> data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Oid? requestedPolicyId = default, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, System.Security.Cryptography.X509Certificates.X509ExtensionCollection? extensions = default);
public static System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest CreateFromData(ReadOnlySpan<byte> data, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Oid requestedPolicyId = default, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, System.Security.Cryptography.X509Certificates.X509ExtensionCollection extensions = default);
static member CreateFromData : ReadOnlySpan<byte> * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.Oid * Nullable<ReadOnlyMemory<byte>> * bool * System.Security.Cryptography.X509Certificates.X509ExtensionCollection -> System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest
Public Shared Function CreateFromData (data As ReadOnlySpan(Of Byte), hashAlgorithm As HashAlgorithmName, Optional requestedPolicyId As Oid = Nothing, Optional nonce As Nullable(Of ReadOnlyMemory(Of Byte)) = Nothing, Optional requestSignerCertificates As Boolean = false, Optional extensions As X509ExtensionCollection = Nothing) As Rfc3161TimestampRequest

參數

data
ReadOnlySpan<Byte>

資料會被時間戳記,並會用此方法進行雜湊。

hashAlgorithm
HashAlgorithmName

用於此時間戳請求的雜湊演算法。

requestedPolicyId
Oid

時間戳政策的物件識別碼(OID)由時間戳授權機構(TSA)應使用,或 null 表示不偏好。

nonce
Nullable<ReadOnlyMemory<Byte>>

一個可選的 nonce(只用一次的號碼)用來唯一識別此請求,並將其與回應配對。 該值被解釋為無符號的大端序整數,並可正規化至編碼格式。

requestSignerCertificates
Boolean

true以表示時間戳記機構(TSA)必須在發出的時間戳記令牌中包含簽署憑證;否則,。 false

extensions
X509ExtensionCollection

請求中包含的可選擴充功能集合。

傳回

代表 Rfc3161TimestampRequest 所選價值。

例外狀況

hashAlgorithm。Name 是 null 或 Empty。

hashAlgorithm 並非已知的雜湊演算法。

備註

密碼學時間戳總是套用在資料雜湊值與用於雜湊資料的雜湊演算法演算法識別碼的組合上。 此方法是資料 CreateFromHash(ReadOnlyMemory<Byte>, HashAlgorithmName, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection) 尚未被雜湊時的方便替代方案。

此方法中的 nonce 值被視為無符號的大端整數。 此方法在指派 nonce 值前,將輸入正規化為 BER 整數編碼。 正規化後的值會由 GetNonce() 方法回傳。

適用於

另請參閱