setasign\SetaPDF2\Signer\X509
Certificate Class representing a X509 Certificate.
File: /SetaPDF v2/Signer/X509/Certificate.php
Old class name (alias):
\SetaPDF_Signer_X509_Certificate
Class hierarchy
Summary
Methods
- __construct()
- _getTBSCertificate()
- _getValidity()
- get()
- getAsn1()
- getDigest()
- getExtensions()
- getIssuer()
- getIssuerName()
- getIssuerNameRaw()
- getIssuers()
- getSerialNumber()
- getSerialNumberRaw()
- getSignatureAlgorithm()
- getSignatureValue()
- getSignedData()
- getSubjectName()
- getSubjectPublicKeyInfoAlgorithmIdentifier()
- getSubjectPublicKeyInfoRaw()
- getValidFrom()
- getValidTo()
- isValidAt()
- verify()
Static Properties
$usePhpseclibForRsaPss
Flag defining whether usage of phpseclib or default OpenSSL methods for RSA_PSS validation.
$verifyCallback
A callable that can be used to implement individual verification logic.
Properties
$_certificate
The ASN.1 element holding the X509 certificate.
$_extensions
The extensions instance.
Static Methods
fromFileOrString()
Create an instance by a path or a string.
Parameters
- $pathOrString : string
Exceptions
Methods
__construct()
The constructor.
Parameters
- $certificate : string|\Stringable
PEM or DER encoded string of the certificate.
Exceptions
getIssuer()
Returns the first issuer found in the given Collection.
Parameters
- $collection : Collection
Exceptions
getIssuerName()
Get the issuer name.
Parameters
- $asArray : bool
Whether the subject is returned as an array or string
- $onlyKnown : bool
Whether attributes with an unknown OID are returend or not.
Exceptions
getIssuers()
Get all found issuers found in the given collection.
Parameters
- $collection : \SetaPDF_Signer_X509_Collection
Exceptions
getSignatureAlgorithm()
Return Values
The first value holds the OID of the algorithm. The second value is the ASN.1 structure of the parameters.
getSubjectName()
Get the subject name.
Parameters
- $asArray : bool
Whether the subject is returned as an array or string
- $onlyKnown : bool
Whether attributes with an unknown OID are returend or not.
Exceptions
getSubjectPublicKeyInfoAlgorithmIdentifier()
Get the subject public key info algorithm identifier.
Return Values
First entry is the OID of the identifier. The second entry are the raw parameters as ASN.1 structures.
Exceptions
getValidFrom()
Get the "valid from" value.
Parameters
- $timeZone : ?\DateTimeZone
Default timezone is UTC.
Exceptions
Throws \Exception
getValidTo()
Get the "valid to" value.
Parameters
- $timeZone : ?\DateTimeZone
Default timezone is UTC.
Exceptions
Throws \Exception
isValidAt()
Checks whether the certificate was valid at a given date and time.
Parameters
- $dateTime : \DateTimeInterface
- $timeZone : ?\DateTimeZone
Exceptions
Throws \Exception
verify()
Verify the signed object.
Parameters
- $issuerCertificate : ?\SetaPDF_Signer_X509_Certificate
If omitted the certificate instance is used as the issuer (self-signed).