| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function createKeyPair(): KeyPair |
||
| 32 | { |
||
| 33 | $privateKey = ''; |
||
| 34 | $res = \openssl_pkey_new( |
||
| 35 | [ |
||
| 36 | 'digest_alg' => self::DIGEST_ALGORITHM, |
||
| 37 | 'private_key_bits' => self::KEY_LENGTH, |
||
| 38 | 'private_key_type' => \OPENSSL_KEYTYPE_RSA, |
||
| 39 | ] |
||
| 40 | ); |
||
| 41 | |||
| 42 | \openssl_pkey_export($res, $privateKey); |
||
| 43 | |||
| 44 | return new KeyPair(\openssl_pkey_get_details($res)['key'], $privateKey); |
||
| 45 | } |
||
| 47 |