20 'type' =>
'X509Certificate',
21 'X509Certificate' => $certificateContents
24 return new self(
$data);
32 if ($offset ===
'X509Certificate') {
33 $value = preg_replace(
'~\s+~',
'', $value);
36 parent::offsetSet($offset, $value);
46 return "-----BEGIN CERTIFICATE-----\n" 47 . chunk_split($this->keyData[
'X509Certificate'], 64)
48 .
"-----END CERTIFICATE-----\n";
58 if (isset($this->fingerprint)) {
62 $fingerprint = strtolower(sha1(base64_decode($this->keyData[
'X509Certificate'])));
offsetSet($offset, $value)
{} Best place to ensure the logic is encapsulated in a single place
Simple DTO wrapper for (X509) keys.
getCertificate()
Get the certificate representation.
static createFromCertificateData($certificateContents)
Simple representation of the fingerprint of a certificate.