Rfc3161TimestampRequest.CreateFromHash 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
利用預先計算的雜湊值及雜湊演算法名稱,建立時間戳記請求。
多載
| 名稱 | Description |
|---|---|
| CreateFromHash(ReadOnlyMemory<Byte>, HashAlgorithmName, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection) |
使用預先計算好的雜湊值及雜湊演算法名稱,建立時間戳請求。 |
| CreateFromHash(ReadOnlyMemory<Byte>, Oid, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection) |
使用預先計算好的雜湊值和雜湊演算法的物件識別碼,建立一個時間戳請求。 |
CreateFromHash(ReadOnlyMemory<Byte>, HashAlgorithmName, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection)
使用預先計算好的雜湊值及雜湊演算法名稱,建立時間戳請求。
public static System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest CreateFromHash(ReadOnlyMemory<byte> hash, 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 CreateFromHash(ReadOnlyMemory<byte> hash, 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 CreateFromHash : ReadOnlyMemory<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 CreateFromHash (hash As ReadOnlyMemory(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
參數
- hash
- ReadOnlyMemory<Byte>
預先計算好的雜湊值要標記時間戳記。
- hashAlgorithm
- HashAlgorithmName
用於產生 hash的雜湊演算法。
- requestedPolicyId
- Oid
物件識別碼(OID),指時間戳管理機構(TSA)應使用的時間戳政策,或 null 表示不偏好。
- nonce
- Nullable<ReadOnlyMemory<Byte>>
一個可選值,用來唯一地將請求與回應匹配,或 null 在請求中不包含 nonce。
- requestSignerCertificates
- Boolean
true以表示時間戳記機構(TSA)必須在發出的時間戳記令牌中包含簽署憑證;否則,。 false
- extensions
- X509ExtensionCollection
請求中包含的可選擴充功能集合。
傳回
代表 Rfc3161TimestampRequest 所選價值。
例外狀況
hashAlgorithm 並非已知的雜湊演算法。
備註
此方法利用參數 hashAlgorithm 決定在時間戳請求中包含的物件識別碼(OID)。
當根據此方法不支援的雜湊演算法建立時間戳請求時,請使用超載。CreateFromHash(ReadOnlyMemory<Byte>, Oid, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection)
此方法中的 nonce 值被視為無符號的大端整數。 此方法在指派 nonce 值前,將輸入正規化為 BER 整數編碼。 正規化後的值會由 GetNonce() 方法回傳。
另請參閱
- CreateFromData(ReadOnlySpan<Byte>, HashAlgorithmName, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection)
- CreateFromHash(ReadOnlyMemory<Byte>, Oid, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection)
適用於
CreateFromHash(ReadOnlyMemory<Byte>, Oid, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection)
使用預先計算好的雜湊值和雜湊演算法的物件識別碼,建立一個時間戳請求。
public static System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest CreateFromHash(ReadOnlyMemory<byte> hash, System.Security.Cryptography.Oid hashAlgorithmId, 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 CreateFromHash(ReadOnlyMemory<byte> hash, System.Security.Cryptography.Oid hashAlgorithmId, System.Security.Cryptography.Oid requestedPolicyId = default, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, System.Security.Cryptography.X509Certificates.X509ExtensionCollection extensions = default);
static member CreateFromHash : ReadOnlyMemory<byte> * System.Security.Cryptography.Oid * System.Security.Cryptography.Oid * Nullable<ReadOnlyMemory<byte>> * bool * System.Security.Cryptography.X509Certificates.X509ExtensionCollection -> System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest
Public Shared Function CreateFromHash (hash As ReadOnlyMemory(Of Byte), hashAlgorithmId As Oid, 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
參數
- hash
- ReadOnlyMemory<Byte>
預先計算好的雜湊值要標記時間戳記。
- hashAlgorithmId
- Oid
產生 hash的雜湊演算法的物件識別碼(OID)。
- requestedPolicyId
- Oid
時間戳政策的物件識別碼(OID)由時間戳授權機構(TSA)應使用,或 null 表示不偏好。
- nonce
- Nullable<ReadOnlyMemory<Byte>>
一個可選的 nonce(只用一次的號碼)用來唯一識別此請求,並將其與回應配對。 該值被解釋為無符號的大端序整數,並可正規化至編碼格式。
- requestSignerCertificates
- Boolean
true以表示時間戳記機構(TSA)必須在發出的時間戳記令牌中包含簽署憑證;否則,。 false
- extensions
- X509ExtensionCollection
請求中包含的可選擴充功能集合。
傳回
代表 Rfc3161TimestampRequest 所選價值。
例外狀況
hashAlgorithmId 是 null。
hashAlgorithmId。Value 不是一個有效的 OID。
備註
此方法中的 nonce 值被視為無符號的大端整數。 此方法在指派 nonce 值前,將輸入正規化為 BER 整數編碼。 正規化後的值會由 GetNonce() 方法回傳。