SetaPDF_Signer_Timestamp_Module_Rfc3161_Curl A timestamp module using the RFC 3161 Standard

File: /SetaPDF/Signer/Timestamp/Module/Rfc3161/Curl.php

Class hierarchy

Implements

Summary

Static Properties

$statusCodes

PKI Status values

$userAgent

static public string SetaPDF_Signer_Timestamp_Module_Rfc3161_Curl::$userAgent = 'SetaPDF-Signer Component TS-Module/2.0'

Required by most TS servers


Properties

$_curlOptions

Additional curl options

$_digest

The message digest

$_lastResponse

The last response of the timestamp server

$_nonce

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

$_nonceValue

The value of the nonce value

$_reqPolicy

The value for reqPolicy in timestamp request


Methods

__construct()

The constructor.

Parameters
$url : string

URL of the timestamp server

_createTimestamp()

protected bool SetaPDF_Signer_Timestamp_Module_Rfc3161_Curl::_createTimestamp ( string $timeStampRequest )

Send the timestamp request and evaluates the response.

Parameters
$timeStampRequest : string
 
Exceptions

Throws SetaPDF_Signer_Exception

_getHash()

Get the hash that should be timestamped.

Parameters
$data : string|SetaPDF_Core_Reader_FilePath

The hash of the main signature

_getTimestampRequest()

Creates the timestamp request structure.

Parameters
$data : string|SetaPDF_Core_Reader_FilePath
 

_verifyResponse()

Verifies the timestamp response.

Parameters
$tsResponse : SetaPDF_Signer_Asn1_Element
 
Exceptions

Throws SetaPDF_Signer_Exception

createTimestamp()

Create the timestamp signature.

Parameters
$data : string
 

getCurlOption()

Returns a defined Curl option or null if not set.

Parameters
$option : int

The CURLOPT_XXX option to set

getDigest()

Get the digest algorithm.

getLastResponse()

Returns the last response of the timestamp server.

getNonce()

Queries if nonce should be set.

See

getReqPolicy()

Get the reqPolicy value / OID.

See

getUrl()

Returns the URL of the timestamp server.

setCurlOption()

public void SetaPDF_Signer_Timestamp_Module_Rfc3161_Curl::setCurlOption ( int|array $option [, string|null $value = null ] )

Sets one or more Curl options with the assigned value.

Parameters
$option : int|array

The CURLOPT_XXX option to set

$value : string|null

The value to be set on option

See

setDigest()

Set the digest algorithm to use.

Parameters
$digest : string

Possible values are defined in SetaPDF_Signer_Digest

See

setNonce()

public void SetaPDF_Signer_Timestamp_Module_Rfc3161::setNonce ( boolean $nonce )

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 : boolean
 
See
  • RFC 3161 - 2.4.1. Request Format

setReqPolicy()

public void SetaPDF_Signer_Timestamp_Module_Rfc3161::setReqPolicy ( string $reqPolicy )

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

setUrl()

Sets the URL of the timestamp server.

Parameters
$url : string

The url to the timestamp server