<PackageReference Include="System.Security.Cryptography.Pkcs" Version="11.0.0-preview.4.26230.115" />

System.Security.Cryptography.Pkcs.Rfc3161TimestampRequest

public sealed class Rfc3161TimestampRequest
Represents a time-stamping request from IETF RFC 3161.
public bool HasExtensions { get; }

Indicates whether or not the request has extensions.

public Oid HashAlgorithmId { get; }

Gets the Object Identifier (OID) for the hash algorithm associated with the request.

public Oid RequestedPolicyId { get; }

Gets the policy ID for the request, or null when no policy ID was requested.

public bool RequestSignerCertificate { get; }

Gets a value indicating whether or not the request indicated that the timestamp authority certificate is required to be in the response.

public int Version { get; }

Gets the data format version number for this request.

public static Rfc3161TimestampRequest CreateFromData(ReadOnlySpan<byte> data, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, X509ExtensionCollection extensions = null)

Creates a timestamp request by hashing the provided data with a specified algorithm.

public static Rfc3161TimestampRequest CreateFromHash(ReadOnlyMemory<byte> hash, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, X509ExtensionCollection extensions = null)

Create a timestamp request using a pre-computed hash value and the name of the hash algorithm.

public static Rfc3161TimestampRequest CreateFromHash(ReadOnlyMemory<byte> hash, Oid hashAlgorithmId, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, X509ExtensionCollection extensions = null)

Create a timestamp request using a pre-computed hash value and the Object Identifier for the hash algorithm.

public static Rfc3161TimestampRequest CreateFromSignerInfo(SignerInfo signerInfo, HashAlgorithmName hashAlgorithm, Oid requestedPolicyId = null, ReadOnlyMemory<byte>? nonce = default, bool requestSignerCertificates = false, X509ExtensionCollection extensions = null)

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

public static bool TryDecode(ReadOnlyMemory<byte> encodedBytes, out Rfc3161TimestampRequest request, out int bytesConsumed)

Attemps to interpret the contents of encodedBytes as a DER-encoded Timestamp Request.

public byte[] Encode()

Encodes the timestamp request and returns it as a byte array.

Gets a collection with a copy of the extensions present on this request.

Gets the data hash for this timestamp request.

public ReadOnlyMemory<byte>? GetNonce()

Gets the nonce for this timestamp request.

public Rfc3161TimestampToken ProcessResponse(ReadOnlyMemory<byte> responseBytes, out int bytesConsumed)

Combines an encoded timestamp response with this request to produce a Rfc3161TimestampToken.

public bool TryEncode(Span<byte> destination, out int bytesWritten)

Attempts to encode the instance as an IETF RFC 3161 TimeStampReq, writing the bytes into the provided buffer.