1 | <?php |
||
5 | class Wrapper |
||
6 | { |
||
7 | /** |
||
8 | * Main location of easyrsa scripts |
||
9 | * @var string |
||
10 | */ |
||
11 | private $_scripts; |
||
12 | |||
13 | /** |
||
14 | * Path to folder with certificates |
||
15 | * @var string |
||
16 | */ |
||
17 | private $_certs; |
||
18 | |||
19 | /** |
||
20 | * Wrapper constructor, need configuration for normal usage |
||
21 | * |
||
22 | * @param Config $config |
||
23 | * @throws \RuntimeException |
||
24 | */ |
||
25 | public function __construct(Config $config) |
||
38 | |||
39 | /** |
||
40 | * Show content of certificate file |
||
41 | * |
||
42 | * @param string $filename Only name of file must be set, without path |
||
43 | * @return bool|string |
||
44 | */ |
||
45 | public function getContent(string $filename) |
||
72 | |||
73 | /** |
||
74 | * Execute some command and return result |
||
75 | * |
||
76 | * @param string $cmd |
||
77 | * @return array |
||
78 | */ |
||
79 | private function exec(string $cmd): array |
||
85 | |||
86 | public function init_pki(): array |
||
90 | |||
91 | public function build_ca(bool $nopass = false): array |
||
96 | |||
97 | public function gen_dh(): array |
||
101 | |||
102 | public function gen_req(string $name, bool $nopass = false): array |
||
107 | |||
108 | public function sign_req_client(string $filename): array |
||
112 | |||
113 | public function sign_req_server(string $filename): array |
||
117 | |||
118 | public function build_client_full(string $name, bool $nopass = false): array |
||
123 | |||
124 | public function build_server_full(string $name, bool $nopass = false): array |
||
129 | |||
130 | public function revoke(string $filename): array |
||
134 | |||
135 | public function gen_crl(): array |
||
139 | |||
140 | public function update_db(): array |
||
144 | |||
145 | public function show_req(string $filename): array |
||
149 | |||
150 | public function show_cert(string $filename): array |
||
154 | |||
155 | public function import_req(string $request_file_path, string $short_basename): array |
||
159 | |||
160 | public function export_p7(string $filename): array |
||
164 | |||
165 | public function export_p12(string $filename): array |
||
169 | |||
170 | public function set_rsa_pass(string $filename): array |
||
174 | |||
175 | public function set_ec_pass(string $filename): array |
||
179 | } |
||
180 |