title: openssl_pkey_get_public not open public key, "no start line" error
body: <p>When generating public key and then reading it with function <strong>openssl_pkey_get_public</strong> - <strong>$publicKeyResource</strong> = bool(false) and message:
  <strong>error:0906D06C:PEM routines:PEM_read_bio:no start line</strong></p>
  
  <pre><code>$privateKey = openssl_pkey_new(array('private_key_bits' =&gt; 2048, 'private_key_type' =&gt; OPENSSL_KEYTYPE_RSA));
  
  $keyDetails = openssl_pkey_get_details($privateKey);
  
  $publicKeyResource = openssl_pkey_get_public($keyDetails['key']);
  </code></pre>
  
  <p>What is wrong?</p>
  
  <p>P.S. </p>
  
  <pre><code>privateKey = 
  
  array(3) {
    ["bits"]=&gt;int(2048)
  
    ["key"]=&gt;
    string(451) "-----BEGIN PUBLIC KEY-----
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApo5lpSuSQmAOXfqAmexj
  IzjdGnd1X1gCKj5ko2DHgcR4XBlj1hbFNs1pzXx+R/UvLXTeF7dNQ+9AgXjEeRa6
  71VbNxrUgvb/PHjEANwce7xBsnbu+dcSazyNHzx4ahWyEF4f3HyaJkGrT/Dgzcut
  DO+yFAH9u8Hx26cj/8kyrtIHxazemnD+IDHRa3zOjKDmTfoDRKtOMTPVgFAsYBXn
  tKcLyamCSBgpwfQwKfUUcYhfY1xD9UMhVXabSSiNQOiTMuOIZUHueO8UCp/tdK6a
  LprUDBQ/tVmiV7ZMeZYMjh6XnK7higJ3WZp8RmD4PPeKbtG6j2AuGpbF/ddzD62T
  XwIDAQAB
  -----END PUBLIC KEY-----
  "
  
    ["type"]=&gt;
    int(0)
  }
  </code></pre>