SetaPDF_Signer_ValidationRelatedInfo_Collector Class offering methods to collect validation related information.

File: /SetaPDF v2/Signer/ValidationRelatedInfo/Collector.php

Class hierarchy

Summary

Constants

SOURCE_CRL

Source constant.

SOURCE_OCSP

Source constant.

SOURCE_OCSP_AND_CRL

SOURCE_OCSP_OR_CRL


Properties

$_crlCache

protected Psr\SimpleCache\CacheInterface|null SetaPDF_Signer_ValidationRelatedInfo_Collector::$_crlCache

A cache instance for CRLs.

$_crls

CRL list indexed by md5 hash of the issuers public key.

$_extraCertificates

$_issuerCache

protected Psr\SimpleCache\CacheInterface|null SetaPDF_Signer_ValidationRelatedInfo_Collector::$_issuerCache

A cache instance for resolved issuer certificates.

$_leftCertificates

$_trustedCertificates


Static Methods

getSignatureFieldNames()

Returns all signature field names.

Parameters
$document : SetaPDF_Core_Document
 

Methods

__construct()

The constructor.

Parameters
$trustedCertificates : SetaPDF_Signer_X509_CollectionInterface|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

_buildPath()

Build a certificate path by a certificate, date and time.

Internally the method tries to gather issuer certificates through the AIA extension of the certificates if the path couldn't be created.

Parameters
$certificate : SetaPDF_Signer_X509_Certificate
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

_getAllCertificates()

Get a collection with all certificates (trusted + extra).

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

_getByLeftCertificates()

Get validation related information by left certificates.

Parameters
$result : SetaPDF_Signer_ValidationRelatedInfo_Result
 
$certificates : SetaPDF_Signer_X509_Certificate[]
 
$sources : int
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

_getOcspResponse()

_processCertificate()

protected SetaPDF_Signer_ValidationRelatedInfo_Collector::_processCertificate (
SetaPDF_Signer_ValidationRelatedInfo_Result $result [, int $sources = self::SOURCE_OCSP_OR_CRL [, DateTimeInterface|null $dateTime = null [, DateTimeZone|null $timeZone = null ]]]
): void

Processes a certificate popped from the leftCertificates array.

Parameters
$result : SetaPDF_Signer_ValidationRelatedInfo_Result
 
$sources : int
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

getByCertificate()

public SetaPDF_Signer_ValidationRelatedInfo_Collector::getByCertificate (
SetaPDF_Signer_X509_Certificate $certificate [, int $sources = self::SOURCE_OCSP_OR_CRL [, DateTimeInterface|null $dateTime = null [, DateTimeZone|null $timeZone = null [, SetaPDF_Signer_ValidationRelatedInfo_Result|null $result = null ]]]]
): SetaPDF_Signer_ValidationRelatedInfo_Result

Get validation related information by a certificate.

Parameters
$certificate : SetaPDF_Signer_X509_Certificate
 
$sources : int
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
$result : SetaPDF_Signer_ValidationRelatedInfo_Result|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

getByFieldName()

Get validation related information by a signatue field name.

Parameters
$document : SetaPDF_Core_Document
 
$fieldName : string
 
$sources : int
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
$result : SetaPDF_Signer_ValidationRelatedInfo_Result|null
 
Exceptions

Throws SetaPDF_Core_Exception

Throws SetaPDF_Core_Parser_Pdf_InvalidTokenException

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

getByIntegrityResult()

Get validation related information by an integrity result.

Parameters
$integrityResult : SetaPDF_Signer_ValidationRelatedInfo_IntegrityResult
 
$sources : int
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
$result : SetaPDF_Signer_ValidationRelatedInfo_Result|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

getBySignedData()

public SetaPDF_Signer_ValidationRelatedInfo_Collector::getBySignedData (
SetaPDF_Signer_Cms_SignedData $signedData [, int $sources = self::SOURCE_OCSP_OR_CRL [, DateTimeInterface|null $dateTime = null [, DateTimeZone|null $timeZone = null [, SetaPDF_Signer_ValidationRelatedInfo_Result|null $result = null ]]]]
): SetaPDF_Signer_ValidationRelatedInfo_ResultBySignedData

Get validation related information by a SignedData object.

Parameters
$signedData : SetaPDF_Signer_Cms_SignedData
 
$sources : int
 
$dateTime : DateTimeInterface|null
 
$timeZone : DateTimeZone|null
 
$result : SetaPDF_Signer_ValidationRelatedInfo_Result|null
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

Throws SetaPDF_Signer_ValidationRelatedInfo_Exception

Throws \Psr\SimpleCache\InvalidArgumentException

getCrlCache()

public SetaPDF_Signer_ValidationRelatedInfo_Collector::getCrlCache (
void
): Psr\SimpleCache\CacheInterface|null

Get the cache instance for CRLs.

getExtraCertificates()

getInformationResolverManager()

Get the information resolver manager instance.

If none was explicity was passed before it will create a standard instance with an HTTP resolver that uses cURL.

getIssuerCache()

public SetaPDF_Signer_ValidationRelatedInfo_Collector::getIssuerCache (
void
): Psr\SimpleCache\CacheInterface|null

Get the cache instance for resolved issuer certificates.

getLogger()

Get the logger instance.

If no logger instance was passed before a new instance of SetaPDF_Signer_ValidationRelatedInfo_Logger is returned.

getTrustedCertificates()

setCrlCache()

public SetaPDF_Signer_ValidationRelatedInfo_Collector::setCrlCache (
[ Psr\SimpleCache\CacheInterface|null $crlCache = null ]
): void

Set a cache instance for CRLs.

Parameters
$crlCache : Psr\SimpleCache\CacheInterface|null
 

setInformationResolverManager()

setIssuerCache()

public SetaPDF_Signer_ValidationRelatedInfo_Collector::setIssuerCache (
[ Psr\SimpleCache\CacheInterface|null $issuerCache = null ]
): void

Set a cache instance for resolved issuer certificates.

Parameters
$issuerCache : Psr\SimpleCache\CacheInterface|null