| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public static function compute( |
||
| 10 | #[\SensitiveParameter] string $accountKey |
||
| 11 | ): array { |
||
| 12 | $privateKey = openssl_pkey_get_private($accountKey); |
||
| 13 | |||
| 14 | if ($privateKey === false) { |
||
| 15 | throw new LetsEncryptClientException('Can not create private key.'); |
||
| 16 | } |
||
| 17 | |||
| 18 | $details = openssl_pkey_get_details($privateKey); |
||
| 19 | |||
| 20 | return [ |
||
| 21 | 'e' => Base64::urlSafeEncode($details['rsa']['e']), |
||
| 22 | 'kty' => 'RSA', |
||
| 23 | 'n' => Base64::urlSafeEncode($details['rsa']['n']), |
||
| 24 | ]; |
||
| 32 |