Muokkaa

Jaa


Rfc3161TimestampRequest.CreateFromSignerInfo Method

Definition

Creates a timestamp request by hashing the signature of the provided signer with a specified algorithm.

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

Parameters

signerInfo
SignerInfo

The CMS signer information to build a timestamp request for.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use with this timestamp request.

requestedPolicyId
Oid

The Object Identifier (OID) for the timestamp policy that the Timestamp Authority (TSA) should use, or null to express no preference.

nonce
Nullable<ReadOnlyMemory<Byte>>

An optional nonce (number used once) to uniquely identify this request to pair it with the response. The value is interpreted as an unsigned big-endian integer and may be normalized to the encoding format.

requestSignerCertificates
Boolean

true to indicate the Timestamp Authority (TSA) must include the signing certificate in the issued timestamp token; otherwise, false.

extensions
X509ExtensionCollection

An optional collection of extensions to include in the request.

Returns

An Rfc3161TimestampRequest representing the chosen values.

Exceptions

signerInfo is null.

hashAlgorithm.Name is null or Empty.

hashAlgorithm is not a known hash algorithm.

Remarks

This constructor creates a timestamp for the signature value of a SignerInfo value, per the recommendation of IETF RFC 3161 Appendix A (Signature Time-stamp attribute using CMS).

The nonce value in this method is treated as an unsigned, big-endian integer. This method normalizes the input to a BER INTEGER encoding before assigning the nonce value. The normalized value is returned by the GetNonce() method.

Applies to

See also