@@ -172,11 +172,17 @@ public function seal(
172172 string $ plain_text ,
173173 RSAParameters $ rSAParameters ,
174174 bool $ humanReadableData = false
175- ): array
176- {
175+ ): array {
177176 $ this ->generateIV ('aes-256-cbc ' );
178177
179- openssl_seal ($ plain_text , $ sealed_data , $ ekeys , [$ rSAParameters ->getPublicKey ()], 'aes-256-cbc ' , $ this ->iv );
178+ openssl_seal (
179+ $ plain_text ,
180+ $ sealed_data ,
181+ $ ekeys ,
182+ [$ rSAParameters ->getPublicKey ()],
183+ 'aes-256-cbc ' ,
184+ $ this ->iv
185+ );
180186
181187 $ sealed_data = $ this ->iv . $ sealed_data ;
182188
@@ -201,9 +207,13 @@ public function seal(
201207 * @param RSAParameters $rSAParameters
202208 * @return string Opened data
203209 */
204- public function open (string $ sealed_data , string $ ekeys , RSAParameters $ rSAParameters , string $ privateKeyPass ,
205- string $ salt ): string
206- {
210+ public function open (
211+ string $ sealed_data ,
212+ string $ ekeys ,
213+ RSAParameters $ rSAParameters ,
214+ string $ privateKeyPass ,
215+ string $ salt
216+ ): string {
207217 if (preg_match ('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/ ' , $ sealed_data )) {
208218 $ sealed_data = base64_decode ($ sealed_data );
209219 }
@@ -221,7 +231,14 @@ public function open(string $sealed_data, string $ekeys, RSAParameters $rSAParam
221231 $ iv = substr ($ sealed_data , 0 , $ iv_len );
222232 $ encryptedData = substr ($ sealed_data , $ iv_len );
223233
224- openssl_open ($ encryptedData , $ open_data , $ ekeys , $ rSAParameters ->getPrivateKey (passphrase: $ privateKeyPass , salt: $ salt ), 'aes-256-cbc ' , $ iv );
234+ openssl_open (
235+ $ encryptedData ,
236+ $ open_data ,
237+ $ ekeys ,
238+ $ rSAParameters ->getPrivateKey (passphrase: $ privateKeyPass , salt: $ salt ),
239+ 'aes-256-cbc ' ,
240+ $ iv
241+ );
225242
226243 return $ open_data ;
227244 }
0 commit comments