| @@ 34-42 (lines=9) @@ | ||
| 31 | * @return array the certificate, key in array with keys |
|
| 32 | * 'cert', 'key', 'valid_from' and 'valid_to' |
|
| 33 | */ |
|
| 34 | public function serverCert($commonName) |
|
| 35 | { |
|
| 36 | return [ |
|
| 37 | 'certificate' => sprintf('ServerCert for %s', $commonName), |
|
| 38 | 'private_key' => sprintf('ServerCert for %s', $commonName), |
|
| 39 | 'valid_from' => 1234567890, |
|
| 40 | 'valid_to' => 2345678901, |
|
| 41 | ]; |
|
| 42 | } |
|
| 43 | ||
| 44 | /** |
|
| 45 | * Generate a certificate for a VPN client. |
|
| @@ 52-60 (lines=9) @@ | ||
| 49 | * @return array the certificate and key in array with keys 'cert', 'key', |
|
| 50 | * 'valid_from' and 'valid_to' |
|
| 51 | */ |
|
| 52 | public function clientCert($commonName) |
|
| 53 | { |
|
| 54 | return [ |
|
| 55 | 'certificate' => sprintf('ClientCert for %s', $commonName), |
|
| 56 | 'private_key' => sprintf('ClientKey for %s', $commonName), |
|
| 57 | 'valid_from' => 1234567890, |
|
| 58 | 'valid_to' => 2345678901, |
|
| 59 | ]; |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * Get the CA root certificate. |
|