Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support EdDSA in KeyUtils.keyFactoryAlgorithm() #788

Closed
Eng-Fouad opened this issue Apr 29, 2024 · 0 comments · Fixed by #789
Closed

Support EdDSA in KeyUtils.keyFactoryAlgorithm() #788

Eng-Fouad opened this issue Apr 29, 2024 · 0 comments · Fixed by #789

Comments

@Eng-Fouad
Copy link
Contributor

I am trying to decode EdDSA private key using KeyUtils.decodePrivateKey(privateKeyPemEncoded, SignatureAlgorithm.EDDSA). However, the following exception is raised:

java.security.NoSuchAlgorithmException: SRJWT00001: Unsupported key type EDDSA
	at io.smallrye.jwt.util.KeyUtils.keyFactoryAlgorithm(KeyUtils.java:341)
	at io.smallrye.jwt.util.KeyUtils.decodePrivateKey(KeyUtils.java:170)

It seems that KeyUtils.keyFactoryAlgorithm() does not recognize EdDSA.

static String keyFactoryAlgorithm(SignatureAlgorithm algo) throws NoSuchAlgorithmException {
if (algo.name().startsWith("RS") || algo.name().startsWith("PS")) {
return RSA;
}
if (algo.name().startsWith("ES")) {
return EC;
}
throw JWTUtilMessages.msg.unsupportedAlgorithm(algo.name());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant