| 1 | <?php |
||
| 14 | class Convert |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @param string $data |
||
| 18 | * |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | public static function base64uEncode(string $data): string |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $data |
||
| 28 | * |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | public static function base64uDecode(string $data): string |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Convert the public key to binary DER format first |
||
| 38 | * Using the ECC SubjectPublicKeyInfo OIDs from RFC 5480 |
||
| 39 | * |
||
| 40 | * @param string $key |
||
| 41 | * |
||
| 42 | * @return null|string |
||
| 43 | */ |
||
| 44 | public static function pubkeyToPem(string $key) |
||
| 70 | } |
||
| 71 |