Skip to content

Commit 1e852bd

Browse files
committed
Add comments explaining why WebAuthnCodecs needs some custom key parsing logic
1 parent 6d9129a commit 1e852bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

webauthn-server-core/src/main/java/com/yubico/webauthn/WebAuthnCodecs.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,13 @@ static PublicKey importCosePublicKey(ByteArray key)
125125
final int kty = cose.get(CBORObject.FromObject(1)).AsInt32();
126126
switch (kty) {
127127
case 1:
128+
// COSE-JAVA is hardcoded to ed25519-java provider ("EdDSA") which would require an
129+
// additional dependency to parse EdDSA keys via the OneKey constructor
128130
return importCoseEdDsaPublicKey(cose);
129131
case 2:
130132
return importCoseP256PublicKey(cose);
131133
case 3:
134+
// COSE-JAVA supports RSA in v1.1.0 but not in v1.0.0
132135
return importCoseRsaPublicKey(cose);
133136
default:
134137
throw new IllegalArgumentException("Unsupported key type: " + kty);

0 commit comments

Comments
 (0)