pub fn parse_cose_key(data: &[u8]) -> Result<CoseKey>Expand description
Decode a CBOR-encoded COSE_Key and return it as a CoseKey.
Both EC2 (kty = 2) and RSA (kty = 3) keys are supported.
For EC2: dispatches on alg to validate crv and coordinate length —
ES256 (alg = -7) requires crv = 1 and 32-byte x/y coordinates;
ES384 (alg = -35) requires crv = 2 and 48-byte x/y coordinates.
For RSA: validates alg == -257 and that n is at least 256 bytes.
§Errors
WebAuthnError::CborDecodeError— input is not valid CBOR.WebAuthnError::InvalidPublicKey— missing required fields, wrong key type, or bad curve.WebAuthnError::UnsupportedAlgorithm—algis present but not a recognised value.