SetaPDF_Signer_X509_Certificate Class representing a X509 Certificate.
File: /SetaPDF v2/Signer/X509/Certificate.php
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
Static Methods
fromFile()
Create an instance by a path.
Parameters
- $path : string
Exceptions
fromFileOrString()
Create an instance by a path or a string.
Parameters
- $pathOrString : string
Exceptions
Methods
__construct()
The constructor.
Parameters
- $certificate : string
PEM or DER encoded string of the certificate.
Exceptions
_getValidity()
get()
Get the certificate encoded as DER or PEM.
Parameters
- $format : string
getDigest()
Get the digest of the certificate.
Parameters
- $algo : string
- $raw : bool
getIssuer()
Returns the first issuer found in the given Collection.
Parameters
- $collection : SetaPDF_Signer_X509_Collection
Exceptions
Throws SetaPDF_Signer_Asn1_Exception
Throws SetaPDF_Signer_Exception
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
Throws SetaPDF_Signer_Asn1_Exception
Throws SetaPDF_Signer_Exception
getIssuerNameRaw()
getIssuers()
Get all found issuers found in the given collection.
Parameters
- $collection : SetaPDF_Signer_X509_Collection
Exceptions
Throws SetaPDF_Signer_Asn1_Exception
Throws SetaPDF_Signer_Exception
getSerialNumber()
getSerialNumberRaw()
Get the serial number as a raw ASN.1 element.
Exceptions
Throws SetaPDF_Signer_Exception
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
Throws SetaPDF_Signer_Exception
getSubjectPublicKeyInfoRaw()
getValidFrom()
Get the "valid from" value.
Parameters
- $timeZone : DateTimeZone|null
Default timezone is UTC.
Exceptions
Throws Exception
getValidTo()
Get the "valid to" value.
Parameters
- $timeZone : DateTimeZone|null
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|null
Exceptions
Throws Exception
verify()
Verify the signed object.
Parameters
- $issuerCertifcate : SetaPDF_Signer_X509_Certificate|null
If omitted the certificate instance is used as the issuer (self-signed).
Exceptions
Throws SetaPDF_Signer_Asn1_Exception
Throws SetaPDF_Signer_Exception