Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public.php
Go to the documentation of this file.
1 <?php
26 #require_once 'Zend/Crypt/Rsa/Key.php';
27 
35 {
36 
37  protected $_certificateString = null;
38 
39  public function __construct($string)
40  {
41  $this->_parse($string);
42  }
43 
48  protected function _parse($string)
49  {
50  if (preg_match("/^-----BEGIN CERTIFICATE-----/", $string)) {
51  $this->_certificateString = $string;
52  } else {
53  $this->_pemString = $string;
54  }
55  $result = openssl_get_publickey($string);
56  if (!$result) {
60  #require_once 'Zend/Crypt/Exception.php';
61  throw new Zend_Crypt_Exception('Unable to load public key');
62  }
63  //openssl_pkey_export($result, $public);
64  //$this->_pemString = $public;
65  $this->_opensslKeyResource = $result;
66  $this->_details = openssl_pkey_get_details($this->_opensslKeyResource);
67  }
68 
69  public function getCertificate()
70  {
72  }
73 
74 }