Class TimestampRequester
Inherited Members
Namespace: Lacuna.Pki
Assembly: Lacuna.Pki.dll
Syntax
public class TimestampRequester : ITimestampRequester
Constructors
TimestampRequester(Uri)
Instantiates a TimestampRequester that requests timestamps using the HTTP or HTTPS protocol without authentication
Declaration
public TimestampRequester(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Timestamper URI |
TimestampRequester(Uri, PKCertificateWithKey)
Instantiates a TimestampRequester using the HTTPS protocol with mutual SSL authentication
Declaration
public TimestampRequester(Uri uri, PKCertificateWithKey clientCertificate)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Timestamper URI |
PKCertificateWithKey | clientCertificate | Certificate for mutual authentication recovered from a WindowsCertificateStore. |
TimestampRequester(Uri, ICredentials)
Instantiates a TimestampeRequester that requests timestamps using the HTTPS protocol with basic authentication. For production is recommended only HTTPS protocol, otherwise your authentication parameters will traffic as plaintext over the network.
Declaration
public TimestampRequester(Uri uri, ICredentials credentials)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Timestamper URI. |
ICredentials | credentials | Credentials for authentication, typically an instance of System.Net.NetworkCredential. |
TimestampRequester(Uri, String)
Instantiates a TimestampeRequester that requests timestamps using the HTTPS protocol with OAuth bearer token. For production is recommended only HTTPS protocol, otherwise your bearer token will traffic as plaintext over the network.
Declaration
public TimestampRequester(Uri uri, string oAuthBearerToken)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Timestamper URI. |
String | oAuthBearerToken | OAtuh Bearer token |
TimestampRequester(Uri, String, String)
Instantiates a TimestampeRequester that requests timestamps with Basic Authentication header. For production is recommended only HTTPS protocol, otherwise your authentication parameters will traffic as plaintext over the network.
Declaration
public TimestampRequester(Uri uri, string username, string password)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Timestamper URI. |
String | username | |
String | password |
Properties
Timeout
The timestamp request timeout. If not set, default is the PkiConfig.TimestampRequestTimeout
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
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.
Declaration
public string TsaPolicyId { get; set; }
Property Value
Type | Description |
---|---|
String |
Uri
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
Uri |
Methods
DecodeRfc3161Response(Byte[])
Decodes a RFC 3161 timestamp response (TimeStampResp)
Declaration
public static CadesTimestamp DecodeRfc3161Response(byte[] response)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | response | The response content |
Returns
Type | Description |
---|---|
CadesTimestamp | The cades timestamp signture |
EncodeRfc3161Request(DigestAlgorithmAndValue, Byte[])
Creates a RFC 3161 standar timestamp request content BER encoded.
Declaration
public static byte[] EncodeRfc3161Request(DigestAlgorithmAndValue digest, byte[] nonce = null)
Parameters
Type | Name | Description |
---|---|---|
DigestAlgorithmAndValue | digest | |
Byte[] | nonce |
Returns
Type | Description |
---|---|
Byte[] |
GetTimestamp(DigestAlgorithmAndValue)
Requestes the timestamp-token
Declaration
public CadesTimestamp GetTimestamp(DigestAlgorithmAndValue digest)
Parameters
Type | Name | Description |
---|---|---|
DigestAlgorithmAndValue | digest | Digest algorithm and value for message-imprint |
Returns
Type | Description |
---|---|
CadesTimestamp | CadesTimestamp signature |
Implements
GetTimestamp(DigestAlgorithmAndValue, TimeSpan)
Declaration
[Obsolete("Set the object property Timeout instead of using timeout argument")]
public CadesTimestamp GetTimestamp(DigestAlgorithmAndValue digest, TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
DigestAlgorithmAndValue | digest | |
TimeSpan | timeout |
Returns
Type | Description |
---|---|
CadesTimestamp |