setasign\SetaPDF2\Signer\X509

Chain Helper class to build certificate paths.

File: /SetaPDF v2/Signer/X509/Chain.php
Old class name (alias): \SetaPDF_Signer_X509_Chain

Class hierarchy

Summary

Properties

$_allowTrustedIntermediateCertificatesAsTrustAnchor

$_extraCertificates

The extra certificates.

$_trustedCertificates

The trusted certificates.


Methods

__construct()

public Chain::__construct (
null|string|Certificate|Certificate[]|CollectionInterface $trustedCertificates = null
)

The constructor.

Parameters
$trustedCertificates: null|string|Certificate|Certificate[]|CollectionInterface

$trustedCertificates

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

_buildPaths()

protected Chain::_buildPaths (
Certificate $certificate,
string[] &$paths,
Certificate[] $currentPath = array ( )
): void

Build all possible paths.

Parameters
$certificate: Certificate
 
$paths: string[]
 
$currentPath: Certificate[]
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

_findIssuer()

protected Chain::_findIssuer (
Certificate $certificate
): Collection

Find issuers by a certificate.

Parameters
$certificate: Certificate
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

buildPath()

public Chain::buildPath (
Certificate $certificate,
?\DateTimeInterface $dateTime = null,
?\DateTimeZone $timeZone = null
): false|Certificate[]

Build a valid certificate path.

Parameters
$certificate: Certificate
 
$dateTime: ?\DateTimeInterface

If a date time is given only certificates which are valid at this will be part of the path.

$timeZone: ?\DateTimeZone
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

buildPaths()

public Chain::buildPaths (
Certificate $certificate
): Certificate[]

Build all possible paths.

Parameters
$certificate: Certificate
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

getAllowTrustedIntermediateCertificatesAsTrustAnchor()

Get whether intermediate certificates can be seen as trusted anchors or not.

getExtraCertificates()

Get the extra certificates collection instance.

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

getLogger()

Get the logger instance.

If no logger instance was passed before a new instance of \setasign\SetaPDF2\Signer\ValidationRelatedInfo\Logger is returned.

getTrustedCertificates()

Get the trusted certificates collection instance.

Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

setAllowTrustedIntermediateCertificatesAsTrustAnchor()

Define whether intermediate certificates can be seen as trusted anchors or not.

If this property is set to true the path generation stops as soon as it reaches a certificate in the trusted certificate collection.

Parameters
$allow: bool