_parse($string); } /** * @param string $string * @throws Zend_Crypt_Exception */ protected function _parse($string) { if (preg_match("/^-----BEGIN CERTIFICATE-----/", $string)) { $this->_certificateString = $string; } else { $this->_pemString = $string; } $result = openssl_get_publickey($string); if (!$result) { /** * @see Zend_Crypt_Exception */ #require_once 'Zend/Crypt/Exception.php'; throw new Zend_Crypt_Exception('Unable to load public key'); } //openssl_pkey_export($result, $public); //$this->_pemString = $public; $this->_opensslKeyResource = $result; $this->_details = openssl_pkey_get_details($this->_opensslKeyResource); } public function getCertificate() { return $this->_certificateString; } }