1 | <?php |
||
8 | class CryptoHelper |
||
9 | { |
||
10 | use traits\Errorable; |
||
11 | |||
12 | protected $cert_file=""; |
||
13 | protected $tmp_path=""; |
||
14 | protected $openssl_exe_path=""; |
||
15 | public $output=""; |
||
16 | protected $returned_val=""; |
||
17 | |||
18 | /** |
||
19 | * CryptoHelper constructor. |
||
20 | * |
||
21 | * @param $cert_file |
||
22 | * @param $tmp_path |
||
23 | * @param $openssl_exe_path |
||
24 | */ |
||
25 | public function __construct($cert_file, $tmp_path, $openssl_exe_path) |
||
31 | |||
32 | /** |
||
33 | * @param $str |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | public function rsaEncrypt($str) |
||
64 | |||
65 | /** |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function getError() |
||
76 | |||
77 | /** |
||
78 | * @return bool |
||
79 | */ |
||
80 | private function checkPath() |
||
97 | |||
98 | /** |
||
99 | * @param $file_source |
||
100 | * @param $file_dest |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | private function getCommand($file_source, $file_dest) |
||
108 | |||
109 | /** |
||
110 | * @param $exec |
||
111 | */ |
||
112 | private function excecuteCommand($exec) |
||
123 | |||
124 | /** |
||
125 | * @param $file_dest |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | private function getEncryptedString($file_dest) |
||
143 | |||
144 | /** |
||
145 | * @param $file_source |
||
146 | */ |
||
147 | private function deleteSourceFile($file_source) |
||
155 | |||
156 | /** |
||
157 | * @return string |
||
158 | */ |
||
159 | private function getRandName() |
||
163 | } |
||
164 |