• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/Zend/Crypt/Rsa/Key/Public.php

00001 <?php
00026 require_once 'Zend/Crypt/Rsa/Key.php';
00027 
00034 class Zend_Crypt_Rsa_Key_Public extends Zend_Crypt_Rsa_Key
00035 {
00036 
00037     protected $_certificateString = null;
00038 
00039     public function __construct($string)
00040     {
00041         $this->_parse($string);
00042     }
00043 
00048     protected function _parse($string)
00049     {
00050         if (preg_match("/^-----BEGIN CERTIFICATE-----/", $string)) {
00051             $this->_certificateString = $string;
00052         } else {
00053             $this->_pemString = $string;
00054         }
00055         $result = openssl_get_publickey($string);
00056         if (!$result) {
00060             require_once 'Zend/Crypt/Exception.php';
00061             throw new Zend_Crypt_Exception('Unable to load public key');
00062         }
00063         //openssl_pkey_export($result, $public);
00064         //$this->_pemString = $public;
00065         $this->_opensslKeyResource = $result;
00066         $this->_details = openssl_pkey_get_details($this->_opensslKeyResource);
00067     }
00068 
00069     public function getCertificate()
00070     {
00071         return $this->_certificateString;
00072     }
00073 
00074 }

Generated on Thu Apr 19 2012 17:01:16 for openbiz by  doxygen 1.7.2