SSLCertificate objects are designed to work with X.509 certificate data.
Table 4.670. SSLCertificate Class Method Overview
Method |
Except? |
Description |
---|---|---|
Y |
Creates the SSLCertificate object from the filename argument passed. | |
N |
Destroys the SSLCertificate object. | |
Y |
Copying objects of this class is not supported, an exception will be thrown. | |
N |
Returns a string in PEM format representing the certificate. | |
N |
Returns the version of the certificate. | |
N |
Returns the signature type of the certificate. | |
N |
Returns a binary object representing the signature of the certificate. | |
N |
Returns name of the public key algorithm of the certificate. | |
N |
Returns a binary object representing the public key of the certificate in DER (Distinguished Encoding Rules) format. | |
N |
Returns a hash of strings representing the subject information of the certificate. | |
N |
Returns a hash of strings representing the issuer information of the certificate. | |
N |
Returns the integer serial number of the certificate. | |
N |
Returns a hash of booleans representing the allowed purposes of the certificate. | |
N |
Returns a date/time value representing the start date of the certificate. | |
N |
Returns a date/time value representing the end date of the certificate. | |
N |
Returns a hash of all information for the certificate. |
Creates the SSLCertificate object from the argument passed. If a string is passed, the value is assumed to be the PEM representation of the certificate; if a binary is passed, the value is assumed to be the DER-encoded form of the certificate.
DEPRECATED: If a string is passed that is less than 200 bytes long, the string is assumed to be a file name; in which case the PO_NO_FILESYSTEM parse option is checked at run-time; if this restriction is not set, then the certificate is loaded from the filename (in this case, the certificate must be in PEM format). Do not use this feature; load the file first and pass the data to the constructor instead. This functionality will be removed in a future release of Qore.
new SSLCertificate(string|binary
)
$cert = new SSLCertificate($pem_cert_string);
Table 4.671. Arguments for SSLCertificate::constructor()
Argument |
Type |
Description |
---|---|---|
|
String|Binary |
The certificate data in either PEM (string argument) or DER (binary argument) format. See above for the deprecated option of passing a filename argument. |
Table 4.672. Return Values for SSLCertificate::constructor()
Return Type |
Description |
---|---|
Object |
The SSLCertificate object is returned |
Table 4.673. Exceptions thrown by SSLCertificate::constructor()
err |
desc |
---|---|
|
missing or invalid argument, unable to parse file, etc |
Destroys the SSLCertificate object.
delete lvalue
delete $cert;
Table 4.674. Arguments for SSLCertificate::destructor()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.675. Return Values for SSLCertificate::destructor()
Return Type |
Description |
---|---|
n/a |
This method returns no value |
Copying objects of this class is not supported, an exception will be thrown.
Table 4.676. Exceptions thrown by SSLCertificate::copy()
err |
desc |
---|---|
|
objects of this class may not be copied |
Returns a string in PEM format representing the certificate.
SSLCertificate::getPEM()
$pem_str = $cert.getPEM();
Table 4.677. Arguments for SSLCertificate::getPEM()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.678. Return Values for SSLCertificate::getPEM()
Return Type |
Description |
---|---|
String |
A string in PEM format representing the certificate. |
Returns the version of the certificate as an integer.
SSLCertificate::getVersion()
$int = $cert.getVersion();
Table 4.679. Arguments for SSLCertificate::getVersion()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.680. Return Values for SSLCertificate::getVersion()
Return Type |
Description |
---|---|
Integer |
The version of the certificate. |
Returns the signature type of the certificate.
SSLCertificate::getSignatureType()
$str = $cert.getSignatureType();
Table 4.681. Arguments for SSLCertificate::getSignatureType()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.682. Return Values for SSLCertificate::getSignatureType()
Return Type |
Description |
---|---|
String |
The signature type of the certificate. |
Returns a binary object representing the signature of the certificate.
SSLCertificate::getSignature()
$bin = $cert.getSignature();
Table 4.683. Arguments for SSLCertificate::getSignature()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.684. Return Values for SSLCertificate::getSignature()
Return Type |
Description |
---|---|
Binary |
The signature data for the certificate. |
Returns name of the public key algorithm of the certificate.
SSLCertificate::getPublicKeyAlgorithm()
$str = $cert.getPublicKeyAlgorithm();
Table 4.685. Arguments for SSLCertificate::getPublicKeyAlgorithm()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.686. Return Values for SSLCertificate::getPublicKeyAlgorithm()
Return Type |
Description |
---|---|
String |
The name of the public key algorithm of the certificate. |
Returns a binary object representing the public key of the certificate in DER (Distinguished Encoding Rules) format.
SSLCertificate::getPublicKey()
$bin = $cert.getPublicKey();
Table 4.687. Arguments for SSLCertificate::getPublicKey()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.688. Return Values for SSLCertificate::getPublicKey()
Return Type |
Description |
---|---|
Binary |
The public key of the certificate in DER format. |
Returns a hash of strings representing the subject information of the certificate.
SSLCertificate::getSubjectHash()
$hash = $cert.getSubjectHash();
Table 4.689. Arguments for SSLCertificate::getSubjectHash()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.690. Return Values for SSLCertificate::getSubjectHash()
Return Type |
Description |
---|---|
Hash |
Key-value pairs representing the subject information of the certificate. |
Returns a hash of strings representing the issuer information of the certificate.
SSLCertificate::getIssuerHash()
$hash = $cert.getIssuerHash();
Table 4.691. Arguments for SSLCertificate::getIssuerHash()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.692. Return Values for SSLCertificate::getIssuerHash()
Return Type |
Description |
---|---|
Hash |
Key-value pairs representing the issuer information of the certificate. |
Returns the integer serial number of the certificate.
SSLCertificate::getIssuerHash()
$hash = $cert.getIssuerHash();
Table 4.693. Arguments for SSLCertificate::getSerialNumber()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.694. Return Values for SSLCertificate::getSerialNumber()
Return Type |
Description |
---|---|
Integer |
The serial number of the certificate. |
Returns a hash of booleans representing the allowed purposes of the certificate.
SSLCertificate::getPurposeHash()
$hash = $cert.getPurposeHash();
Table 4.695. Arguments for SSLCertificate::getPurposeHash()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.696. Return Values for SSLCertificate::getPurposeHash()
Return Type |
Description |
---|---|
Hash |
Key-value pairs representing the allowed purposes of the certificate. |
Returns a date/time value representing the start date of the certificate.
SSLCertificate::getNotBeforeDate()
$date = $cert.getNotBeforeDate();
Table 4.697. Arguments for SSLCertificate::getNotBeforeDate()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.698. Return Values for SSLCertificate::getNotBeforeDate()
Return Type |
Description |
---|---|
Date |
The start date of the certificate. |
Returns a date/time value representing the end date of the certificate.
SSLCertificate::getNotAfterDate()
$date = $cert.getNotAfterDate();
Table 4.699. Arguments for SSLCertificate::getNotAfterDate()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.700. Return Values for SSLCertificate::getNotAfterDate()
Return Type |
Description |
---|---|
Date |
The end date of the certificate. |
Returns a hash of all information for the certificate.
SSLCertificate::getInfo()
$hash = $cert.getInfo();
Table 4.701. Arguments for SSLCertificate::getInfo()
Argument |
Type |
Description |
---|---|---|
n/a |
n/a |
This method takes no arguments. |
Table 4.702. Return Values for SSLCertificate::getInfo()
Return Type |
Description |
---|---|
Hash |
Keys are 'version', 'serialNumber', 'subject', 'issuer', 'purposes', 'notBefore', 'notAfter', 'signatureType', 'signature', and 'publicKey' corresponding to the respective attributes of the certificate. |