(pem: string)
| 58 | // ---- PEM -> DER ---- |
| 59 | |
| 60 | function pemToDer(pem: string): Uint8Array { |
| 61 | const body = pem |
| 62 | .replace(/-----BEGIN [A-Z ]+-----/, "") |
| 63 | .replace(/-----END [A-Z ]+-----/, "") |
| 64 | .replace(/\s+/g, ""); |
| 65 | return bytesFromB64(body); |
| 66 | } |
| 67 | |
| 68 | // ---- minimal DER encoding for the PKCS#1 -> PKCS#8 wrap ---- |
| 69 |
no test coverage detected