_certificate = $certificate; } /** * Return the certificate string * * @return string of contents */ public function getCertificate() { return $this->_certificate; } /** * Extract the subject field from the certificate and return the contents * * @throws OffAmazonPaymentsNotifications_InvalidCertificateException if not found * * @return array of contents of the subject if found */ public function getSubject() { $certInfo = openssl_x509_parse($this->_certificate, true); $certSubject = $certInfo["subject"]; if (is_null($certSubject)) { throw new OffAmazonPaymentsNotifications_InvalidCertificateException( "Error with certificate - subject cannot be found" ); } return $certSubject; } }