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

com.auth0.jwk.Jwk.getPublicKey() returns null if not RSA #37

Closed
adrian-baker opened this issue Aug 4, 2018 · 1 comment
Closed

com.auth0.jwk.Jwk.getPublicKey() returns null if not RSA #37

adrian-baker opened this issue Aug 4, 2018 · 1 comment

Comments

@adrian-baker
Copy link

The javadoc and the implementation of this method don't match, I expect a InvalidPublicKeyException if the key type is not RSA, but I instead get null:

/**
 * Returns a {@link PublicKey} if the {@code 'alg'} is {@code 'RSA'}
 * @return a public key
 * @throws InvalidPublicKeyException if the key cannot be built or the key type is not RSA
 */
@SuppressWarnings("WeakerAccess")
public PublicKey getPublicKey() throws InvalidPublicKeyException {
    if (!PUBLIC_KEY_ALGORITHM.equalsIgnoreCase(type)) {
        return null;
    }
@lbalmaceda
Copy link
Contributor

Thanks. I've added this to our backlog.

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

No branches or pull requests

2 participants