Show / Hide Table of Contents

Class Rfc3161Encoding

Inheritance
Object
Rfc3161Encoding
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Lacuna.Pki.Asn1
Assembly: Lacuna.Pki.dll
Syntax
public static class Rfc3161Encoding

Methods

DecodeRequest(Byte[])

Decodes a RFC 3161 timestamp request into a digest algorithm and value

Declaration
public static DigestAlgorithmAndValue DecodeRequest(byte[] request)
Parameters
Type Name Description
Byte[] request

The DER-encoded request to be decoded

Returns
Type Description
DigestAlgorithmAndValue

The digest algorithm and value ("message imprint") contained in the request

DecodeRequest(Byte[], out Byte[])

Decodes a RFC 3161 timestamp request into a digest algorithm and value

Declaration
public static DigestAlgorithmAndValue DecodeRequest(byte[] request, out byte[] nonce)
Parameters
Type Name Description
Byte[] request

The DER-encoded request to be decoded

Byte[] nonce

Outputs the nonce that might be present in the request

Returns
Type Description
DigestAlgorithmAndValue

The digest algorithm and value ("message imprint") contained in the request

DecodeRequest(Byte[], out Byte[], out String)

Decodes a RFC 3161 timestamp request into a digest algorithm and value

Declaration
public static DigestAlgorithmAndValue DecodeRequest(byte[] request, out byte[] nonce, out string tsaPolicyId)
Parameters
Type Name Description
Byte[] request

The DER-encoded request to be decoded

Byte[] nonce

Receives the nonce that might be present in the request

String tsaPolicyId

Receives the TSA policy ID that might be present in the request

Returns
Type Description
DigestAlgorithmAndValue

The digest algorithm and value ("message imprint") contained in the request

DecodeResponse(Byte[])

Decodes a RFC 3161 timestamp response (TimeStampResp)

Declaration
public static CadesTimestamp DecodeResponse(byte[] response)
Parameters
Type Name Description
Byte[] response

The response content

Returns
Type Description
CadesTimestamp

The cades timestamp signture

EncodeRequest(DigestAlgorithmAndValue)

Encodes an RFC 3161 timestamp request in DER

Declaration
public static byte[] EncodeRequest(DigestAlgorithmAndValue digest)
Parameters
Type Name Description
DigestAlgorithmAndValue digest

The digest algorithm and value to be timestamped

Returns
Type Description
Byte[]

The DER-encoded request according to RFC 3161 (Timestamp Protocol)

EncodeRequest(DigestAlgorithmAndValue, Byte[])

Encodes an RFC 3161 timestamp request in DER with an optional nonce

Declaration
public static byte[] EncodeRequest(DigestAlgorithmAndValue digest, byte[] nonce)
Parameters
Type Name Description
DigestAlgorithmAndValue digest

The digest algorithm and value to be timestamped

Byte[] nonce

The nonce to be included on the request (optional). This value can be used to confirm the matching between requests and responses.

Returns
Type Description
Byte[]

The DER-encoded request according to RFC 3161 (Timestamp Protocol)

EncodeRequest(DigestAlgorithmAndValue, Byte[], String)

Encodes an RFC 3161 timestamp request in DER with an optional nonce and TSA policy ID

Declaration
public static byte[] EncodeRequest(DigestAlgorithmAndValue digest, byte[] nonce, string tsaPolicyId)
Parameters
Type Name Description
DigestAlgorithmAndValue digest

The digest algorithm and value to be timestamped

Byte[] nonce

The nonce to be included on the request (optional). This value can be used to confirm the matching between requests and responses.

String tsaPolicyId

The OID of the policy to be passed to the TSA when requesting timestamps (optional). Some TSAs use this parameter to distinguish between types of timestamps.

Returns
Type Description
Byte[]

The DER-encoded request according to RFC 3161 (Timestamp Protocol)

EncodeResponse(Byte[], Rfc3161StatusCodes, String, Nullable<Rfc3161FailureInfos>)

Encodes a RFC 3161 timestamp response

Declaration
public static byte[] EncodeResponse(byte[] timestampToken, Rfc3161StatusCodes statusCode, string statusString = null, Rfc3161FailureInfos? failureInfo = default(Rfc3161FailureInfos? ))
Parameters
Type Name Description
Byte[] timestampToken
Rfc3161StatusCodes statusCode
String statusString
Nullable<Rfc3161FailureInfos> failureInfo
Returns
Type Description
Byte[]

EncodeResponse(Byte[], Int32, String)

Declaration
[Obsolete("Use EncodeResponse method with enum parameters instead of int")]
public static byte[] EncodeResponse(byte[] timestampToken, int statusCode = 0, string statusString = null)
Parameters
Type Name Description
Byte[] timestampToken
Int32 statusCode
String statusString
Returns
Type Description
Byte[]
Back to top Copyright © 2015-2020 Lacuna Software