setasign\SetaPDF2\Signer\Timestamp\Module\Rfc3161

Rfc3161 Abstract class representing a timestamp module of the standard RFC 3161

File: /SetaPDF v2/Signer/Timestamp/Module/Rfc3161/Rfc3161.php
Old class name (alias): \SetaPDF_Signer_Timestamp_Module_Rfc3161

RFC 3161 describes the format of a request sent to a Time Stamp Authority and of the response that is returned.

Class hierarchy

Summary

Static Properties

$statusCodes

static public array Rfc3161::$statusCodes = array(...)

PKI Status values


Properties

$_digest

The message digest

$_nonce

protected bool Rfc3161::$_nonce = true

Defines if the nonce value should be included in the timestamp request

$_nonceValue

protected string Rfc3161::$_nonceValue

The value of the nonce value

$_reqPolicy

protected string Rfc3161::$_reqPolicy

The value for reqPolicy in timestamp request


Methods

_createTimestamp()

abstract protected Rfc3161::_createTimestamp (
string $timeStampRequest
): bool
Parameters
$timeStampRequest : string
 

_getHash()

Get the hash that should be timestamped.

Parameters
$data : string|\SetaPDF_Core_Reader_FilePath

The hash of the main signature

_getTimestampRequest()

protected Rfc3161::_getTimestampRequest (): string

Creates the timestamp request structure.

Parameters
$data : string|\SetaPDF_Core_Reader_FilePath
 

_verifyResponse()

protected Rfc3161::_verifyResponse (): void
Parameters
$tsResponse : \SetaPDF_Signer_Tsp_Response
 

createTimestamp()

public Rfc3161::createTimestamp (): string

Create the timestamp signature.

Parameters
$data : string|\SetaPDF_Core_Reader_FilePath
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

getDigest()

Get the digest algorithm.

getLastResponse()

abstract public Rfc3161::getLastResponse (
void
): string

Returns the last response of the timestamp server.

getNonce()

public Rfc3161::getNonce (
void
): bool

Queries if nonce should be set.

See

getReqPolicy()

public Rfc3161::getReqPolicy (
void
): string

Get the reqPolicy value / OID.

See

setDigest()

Set the digest algorithm to use.

Parameters
$digest : string

Possible values are defined in \setasign\SetaPDF2\Signer\Digest

See

setNonce()

public Rfc3161::setNonce (
bool $nonce
): void

Define if the nonce value should be set or not

"2.4.1 Request Format: [...] The nonce, if included, allows the client to verify the timeliness of the response when no local clock is available. The nonce is a large random number with a high probability that the client generates it only once (e.g., a 64 bit integer). In such a case the same nonce value MUST be included in the response, otherwise the response shall be rejected."

Parameters
$nonce : bool
 
See
  • RFC 3161 - 2.4.1. Request Format

setReqPolicy()

public Rfc3161::setReqPolicy (
string $reqPolicy
): void

Set the reqPolicy value / OID.

"2.4.1 Request Format: [...] The reqPolicy field, if included, indicates the TSA policy under which the TimeStampToken SHOULD be provided."

Parameters
$reqPolicy : string
 
See
  • RFC 3161 - 2.4.1. Request Format