File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,32 @@ public static function generate($config = [])
2222 ];
2323 }
2424
25+ public static function singleLinePublicKey ($ publicKey )
26+ {
27+ $ string = str_replace ([
28+ "-----BEGIN PUBLIC KEY----- \n" ,
29+ "-----END PUBLIC KEY----- " ,
30+ ], '' , $ publicKey );
31+
32+ $ stringArray = explode ("\n" , $ string );
33+ $ result = implode ('' , $ stringArray );
34+
35+ return $ result ;
36+ }
37+
38+ public static function singleLinePrivateKey ($ privateKey )
39+ {
40+ $ string = str_replace ([
41+ "-----BEGIN PRIVATE KEY----- \n" ,
42+ "-----END PRIVATE KEY----- " ,
43+ ], '' , $ privateKey );
44+
45+ $ stringArray = explode ("\n" , $ string );
46+ $ result = implode ('' , $ stringArray );
47+
48+ return $ result ;
49+ }
50+
2551 public static function normalPublicKey ($ publicKey )
2652 {
2753 $ fKey = "-----BEGIN PUBLIC KEY----- \n" ;
You can’t perform that action at this time.
0 commit comments