(pem-string->public-key s)(pem-string->public-key s algorithm)Parses a public key from a PEM string or bare base64 of a DER SubjectPublicKeyInfo.
Accepts:
The algorithm is detected from the DER (RSA, EC, DSA, Ed25519/Ed448, X25519/X448, whichever the running JDK supports).
Throws ex-info {:type ::invalid-pem} for malformed base64, and {:type ::unsupported-pem} for unsupported labels, PKCS#1 RSA keys ('BEGIN RSA PUBLIC KEY'), or unknown algorithms.
Parses a public key from a PEM string or bare base64 of a DER
SubjectPublicKeyInfo.
Accepts:
- '-----BEGIN PUBLIC KEY-----' ... '-----END PUBLIC KEY-----' (SPKI)
- bare base64 DER (no armor), with or without line folding
The algorithm is detected from the DER (RSA, EC, DSA, Ed25519/Ed448,
X25519/X448, whichever the running JDK supports).
Throws ex-info {:type ::invalid-pem} for malformed base64, and
{:type ::unsupported-pem} for unsupported labels, PKCS#1 RSA keys
('BEGIN RSA PUBLIC KEY'), or unknown algorithms.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |