Rfc3161TimestampRequest.CreateFromHash 方法

定义

重载

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

时间戳颁发机构 (TSA) 应使用的时间戳策略的对象标识符 (OID);若不公开任何首选项,则为 null

nonce
Nullable<ReadOnlyMemory<Byte>>

一个可选值,用于唯一匹配对响应的请求;如果不在请求中包含 nonce,则为 null

requestSignerCertificates
Boolean

指示时间戳颁发机构 (TSA) 的 true 必须在已颁发的时间戳令牌中包含签名证书;否则为 false

extensions
X509ExtensionCollection

要包含在请求中的可选扩展集合。

返回

Rfc3161TimestampRequest

一个 Rfc3161TimestampRequest,它表示所选值。

例外

hashAlgorithm 不是已知的哈希算法。

注解

此方法使用 hashAlgorithm 参数来确定对象标识符 (OID) 包含在时间戳请求中。 基于此方法不支持的哈希算法生成时间戳请求时,请使用 CreateFromHash(ReadOnlyMemory<Byte>, Oid, Oid, Nullable<ReadOnlyMemory<Byte>>, Boolean, X509ExtensionCollection) 重载。

此方法中的 nonce 值被视为无符号大端整数。 此方法在分配 nonce 值之前将输入规范化为 BER INTEGER 编码。 规范化值由 GetNonce() 方法返回。

另请参阅

适用于

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

时间戳颁发机构 (TSA) 应使用的时间戳策略的对象标识符 (OID),或用来表示无首选项的 null

nonce
Nullable<ReadOnlyMemory<Byte>>

一个可选的 nonce(使用一次的数字),用于唯一标识此请求以将其与响应配对。 该值被解释为无符号大端的整数,并且可以规范化为编码格式。

requestSignerCertificates
Boolean

指示时间戳颁发机构 (TSA) 的 true 必须在已颁发的时间戳令牌中包含签名证书;否则为 false

extensions
X509ExtensionCollection

要包含在请求中的可选扩展集合。

返回

Rfc3161TimestampRequest

一个 Rfc3161TimestampRequest,它表示所选值。

例外

hashAlgorithmIdnull

hashAlgorithmId.Value 不是有效的 OID。

注解

此方法中的 nonce 值被视为无符号大端整数。 此方法在分配 nonce 值之前将输入规范化为 BER INTEGER 编码。 规范化值由 GetNonce() 方法返回。

适用于