Rfc3161TimestampRequest.CreateFromSignerInfo 方法

定义

通过使用指定的算法对提供的签名程序的签名进行哈希处理,创建时间戳请求。

public static System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest CreateFromSignerInfo (System.Security.Cryptography.Pkcs.SignerInfo signerInfo, 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 CreateFromSignerInfo (System.Security.Cryptography.Pkcs.SignerInfo signerInfo, 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 CreateFromSignerInfo : System.Security.Cryptography.Pkcs.SignerInfo * 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 CreateFromSignerInfo (signerInfo As SignerInfo, 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

参数

signerInfo
SignerInfo

要为其生成时间戳请求的 CMS 签名程序信息。

hashAlgorithm
HashAlgorithmName

要与此时间戳请求一起使用的哈希算法。

requestedPolicyId
Oid

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

nonce
Nullable<ReadOnlyMemory<Byte>>

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

requestSignerCertificates
Boolean

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

extensions
X509ExtensionCollection

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

返回

一个 Rfc3161TimestampRequest,它表示所选值。

例外

signerInfo 上声明的默认值为 null

hashAlgorithm.NamenullEmpty

hashAlgorithm 不是已知的哈希算法。

注解

此构造函数使用 CMS) 根据 IETF RFC 3161 附录 A (签名时间戳属性的建议,为 SignerInfo 值的签名值创建时间戳。

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

适用于

另请参阅