Name | Description |
---|---|
__construct | Create an instance. |
addTrustedCA | Add a trusted CA (used in signature validation for both certificates and CRLs) |
addTrustedCABundle | Add trusted CAs as a bundle (used in signature validation for both certificates and CRLs) |
addTrustedCAs | Add trusted CA certificates (used in signature validation for both certificates and CRLs) |
fromFile | Create an instance from a file. |
fromRequest | Create an instance from the client request certificate. |
fromString | Create an instance from a string. |
getCPSPolicies | Get all certificate policy OIDs related to the CA's Certification Practice Statement as an array of strings |
getData | Get the full certificate data. |
getIssuerData | Get the issuer data from the certificate. |
getLegalPerson | Get the legal person if available |
getNaturalPerson | Get the natural person |
getPolicies | Get all certificate policy OIDs as an array of strings |
getPublicKey | Get the public key from the certificate |
getSerialNumber | Get the certificate's serial number in HEX form |
getSubjectData | Get the subject data from the certificate. |
isExpired | Is the certificate currently valid - checks notBefore and notAfter dates |
isPersonal | Is the certificate personal. |
isProfessional | Is the certificate professional. |
isRevoked | Is the certificate revoked - checks for CRL distrib points, downloads and parses the CRL and checks the number |
isSignatureValid | Check if the certificate signature is valid |
isValid | Is the certificate valid, checks currently include dates & signature and CRL list |
Description
public __construct (string $cert, bool $requirePerson)
Create an instance.
Parameters
(string) $cert
: the certificate to parse(bool) $requirePerson
: must the certificate contain a person (defaults to true)
Return Values
Description
public addTrustedCA (string $cert)
Add a trusted CA (used in signature validation for both certificates and CRLs)
Parameters
(string) $cert
Return Values
$this
Description
public addTrustedCABundle (string $certs)
Add trusted CAs as a bundle (used in signature validation for both certificates and CRLs)
Parameters
(string) $certs
: a bundle of CA certificates (the same used in Apache config)
Return Values
$this
Description
public addTrustedCAs (array $certs)
Add trusted CA certificates (used in signature validation for both certificates and CRLs)
Parameters
(array) $certs
: an array of strings where each string is a CA certificate
Return Values
$this
Description
public static fromFile (string $file, bool $requirePerson)
Create an instance from a file.
Parameters
(string) $file
: the path to the certificate file to parse(bool) $requirePerson
: must the certificate contain a person (defaults to true)
Return Values
\vakata\certificate\Certificate
the certificate instance
Description
public static fromRequest (bool $requirePerson)
Create an instance from the client request certificate.
Parameters
(bool) $requirePerson
: must the certificate contain a person (defaults to true)
Return Values
\vakata\certificate\Certificate
the certificate instance
Description
public static fromString (string $data, bool $requirePerson)
Create an instance from a string.
Parameters
(string) $data
: the certificate(bool) $requirePerson
: must the certificate contain a person (defaults to true)
Return Values
\vakata\certificate\Certificate
the certificate instance
Description
public getCPSPolicies (void)
Get all certificate policy OIDs related to the CA's Certification Practice Statement as an array of strings
Parameters
This function has no parameters.
Return Values
array
Description
public getData (void)
Get the full certificate data.
Parameters
This function has no parameters.
Return Values
array
the certificate data
Description
public getIssuerData (void)
Get the issuer data from the certificate.
Parameters
This function has no parameters.
Return Values
array
the certificate subject data
Description
public getLegalPerson (void)
Get the legal person if available
Parameters
This function has no parameters.
Return Values
\LegalPerson|null
Description
public getNaturalPerson (void)
Get the natural person
Parameters
This function has no parameters.
Return Values
\NaturalPerson|null
Description
public getPolicies (void)
Get all certificate policy OIDs as an array of strings
Parameters
This function has no parameters.
Return Values
array
Description
public getPublicKey (bool $pemEncoded)
Get the public key from the certificate
Parameters
(bool) $pemEncoded
: should the result be pem encoded or raw binary, defaults to true
Return Values
string
Description
public getSerialNumber (void)
Get the certificate's serial number in HEX form
Parameters
This function has no parameters.
Return Values
string
Description
public getSubjectData (void)
Get the subject data from the certificate.
Parameters
This function has no parameters.
Return Values
array
the certificate subject data
Description
public isExpired (void)
Is the certificate currently valid - checks notBefore and notAfter dates
Parameters
This function has no parameters.
Return Values
bool
Description
public isPersonal (void)
Is the certificate personal.
Parameters
This function has no parameters.
Return Values
boolean
Description
public isProfessional (void)
Is the certificate professional.
Parameters
This function has no parameters.
Return Values
boolean
Description
public isRevoked (bool $validateSignature)
Is the certificate revoked - checks for CRL distrib points, downloads and parses the CRL and checks the number
Parameters
(bool) $validateSignature
: should the signature on the CRL be verified (defaults to true)
Return Values
bool
Description
public isSignatureValid (bool $allowSelfSigned)
Check if the certificate signature is valid
Parameters
(bool) $allowSelfSigned
: should self signed certificates be accepted (defaults to false)
Return Values
boolean
Description
public isValid (bool $allowSelfSigned)
Is the certificate valid, checks currently include dates & signature and CRL list
Parameters
(bool) $allowSelfSigned
: should self signed certificates be accepted (defaults to false)
Return Values
bool