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

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

00001 <?php
00026 require_once 'Zend/Crypt/Rsa/Key.php';
00027 
00034 class Zend_Crypt_Rsa_Key_Private extends Zend_Crypt_Rsa_Key
00035 {
00036 
00037     protected $_publicKey = null;
00038 
00039     public function __construct($pemString, $passPhrase = null)
00040     {
00041         $this->_pemString = $pemString;
00042         $this->_parse($passPhrase);
00043     }
00044 
00049     protected function _parse($passPhrase)
00050     {
00051         $result = openssl_get_privatekey($this->_pemString, $passPhrase);
00052         if (!$result) {
00056             require_once 'Zend/Crypt/Exception.php';
00057             throw new Zend_Crypt_Exception('Unable to load private key');
00058         }
00059         $this->_opensslKeyResource = $result;
00060         $this->_details = openssl_pkey_get_details($this->_opensslKeyResource);
00061     }
00062 
00063     public function getPublicKey()
00064     {
00065         if (is_null($this->_publicKey)) {
00069             require_once 'Zend/Crypt/Rsa/Key/Public.php';
00070             $this->_publicKey = new Zend_Crypt_Rsa_Key_Public($this->_details['key']);
00071         }
00072         return $this->_publicKey;
00073     }
00074 
00075 }

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