| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | private function extractPublicKeyFromPrivateKeyFile(KeyManagerInterface $key) |
||
| 50 | { |
||
| 51 | $priv = \openssl_get_privatekey( |
||
| 52 | $key->getContent(), |
||
| 53 | $key->getPassphrase() |
||
| 54 | ); |
||
| 55 | |||
| 56 | if (false === $priv) { |
||
| 57 | throw new \RuntimeException( |
||
| 58 | sprintf("Failed to get private key object: %s\n", \openssl_error_string()) |
||
| 59 | ); |
||
| 60 | } |
||
| 61 | |||
| 62 | $details = \openssl_pkey_get_details($priv); |
||
| 63 | |||
| 64 | return $details['key']; |
||
| 65 | } |
||
| 66 | } |
||
| 67 |