Key.php 899 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. class Zend_Crypt_Rsa_Key implements Countable
  3. {
  4. protected $_pemString = null;
  5. protected $_details = array();
  6. protected $_opensslKeyResource = null;
  7. public function getOpensslKeyResource()
  8. {
  9. return $this->_opensslKeyResource;
  10. }
  11. public function toString()
  12. {
  13. if (!empty($this->_pemString)) {
  14. return $this->_pemString;
  15. } elseif (!empty($this->_certificateString)) {
  16. return $this->_certificateString;
  17. }
  18. require_once 'Zend/Crypt/Exception.php';
  19. throw new Zend_Crypt_Exception('No public key string representation is available');
  20. }
  21. public function __toString()
  22. {
  23. return $this->toString();
  24. }
  25. public function count()
  26. {
  27. return $this->_details['bits'];
  28. }
  29. public function getType()
  30. {
  31. return $this->_details['type'];
  32. }
  33. }