decode

Decodes a DER SubjectPublicKeyInfo, with no bytes after it.

Throws

for malformed DER, an unsupported algorithm or curve, a key of the wrong length, or a compressed point that is not on its curve.