setasign\SetaPDF2\Signer\X509

Collection Class representing a collection of X509 certificates.

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

Class hierarchy

Implements

Summary

Properties


Methods

__construct()

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

The constructor.

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

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

_getCollectionItems()

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

add()

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

Add a certificate, certificates or collections.

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

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

addFromFile()

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

Add a certificate from a path.

Parameters
$path : string
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

contains()

Parameters
$certificate : \SetaPDF_Signer_X509_Certificate
 

count()

public Collection::count (
void
): int

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 \setasign\SetaPDF2\Signer\Asn1\Exception

findByIssuer()

public 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 \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \setasign\SetaPDF2\Signer\Exception

findBySubject()

public 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 \setasign\SetaPDF2\Signer\Asn1\Exception

findByValidAt()

Parameters
$dateTime : \DateTimeInterface
 
$timeZone : ?\DateTimeZone
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception

Throws \Exception

getAll()

Get all certificates.

getBySerialNumber()

public Collection::getBySerialNumber (
string $serialNumber
): false|\SetaPDF_Signer_X509_Certificate
Parameters
$serialNumber : string

The hex encoded serial number.

Exceptions

Throws \setasign\SetaPDF2\Signer\Exception

getBySubjectKeyIdentifier()

public Collection::getBySubjectKeyIdentifier (
string $subjectKeyIdentifier
): false|\SetaPDF_Signer_X509_Certificate
Parameters
$subjectKeyIdentifier : string
 
Exceptions

Throws \setasign\SetaPDF2\Signer\Asn1\Exception