SetaPDF_Signer_X509_Collection Class representing a collection of X509 certificates.

File: /SetaPDF v2/Signer/X509/Collection.php

Class hierarchy

Implements

Summary

Properties

$_items

protected Certificate[]|CollectionInterface[] SetaPDF_Signer_X509_Collection::$_items = array()

All items.


Methods

__construct()

public SetaPDF_Signer_X509_Collection::__construct (
[ null|string|Certificate|Certificate[]|CollectionInterface $certificates = null ]
)

The constructor.

Parameters
$certificates : null|string|Certificate|Certificate[]|CollectionInterface
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

_getCollectionItems()

protected SetaPDF_Signer_X509_Collection::_getCollectionItems (
void
): CollectionInterface[]

Get all items which are not direct certificates but implement the CollectionInterface.

add()

public SetaPDF_Signer_X509_Collection::add (
string|string[]|Certificate|Certificate[]|CollectionInterface $certificates
): $this

Add a certificate, certificates or collections.

Parameters
$certificates : string|string[]|Certificate|Certificate[]|CollectionInterface
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

addFromFile()

public SetaPDF_Signer_X509_Collection::addFromFile (
string $path
): $this

Add a certificate from a path.

Parameters
$path : string
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

contains()

public SetaPDF_Signer_X509_Collection::contains (
Certificate $certificate
): bool

Parameters
$certificate : Certificate
 

count()

Count all items.

Notice: that this method collects ALL items to count only unique elements.

findByCallback()

Find all certificates by a callback.

Parameters
$callback : callable
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception

findByIssuer()

public SetaPDF_Signer_X509_Collection::findByIssuer (
string $issuer [, bool $fullMatch = false ]
): SetaPDF_Signer_X509_Collection

Parameters
$issuer : string
 
$fullMatch : bool

Whether only a substring matched or the whole subject should be compared.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

Throws SetaPDF_Signer_Exception

findBySubject()

public SetaPDF_Signer_X509_Collection::findBySubject (
string $subject [, bool $fullMatch = false ]
): SetaPDF_Signer_X509_Collection

Parameters
$subject : string
 
$fullMatch : bool

Whether only a substring matched or the whole subject should be compared.

Exceptions

Throws SetaPDF_Signer_Asn1_Exception

findByValidAt()

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

Throws SetaPDF_Signer_Asn1_Exception

Throws Exception

getAll()

public SetaPDF_Signer_X509_Collection::getAll (
void
): Certificate[]

Get all certificates.

getBySerialNumber()

public SetaPDF_Signer_X509_Collection::getBySerialNumber (
string $serialNumber
): false|Certificate

Parameters
$serialNumber : string

The hex encoded serial number.

Exceptions

Throws SetaPDF_Signer_Exception

getBySubjectKeyIdentifier()

public SetaPDF_Signer_X509_Collection::getBySubjectKeyIdentifier (
string $subjectKeyIdentifier
): false|Certificate

Parameters
$subjectKeyIdentifier : string
 
Exceptions

Throws SetaPDF_Signer_Asn1_Exception