org.jose4j.lang.JoseException: Unable to get an implementation of algorithm name
DEBUG org.jose4j.jws.RsaUsingShaAlgorithm$RsaPssSha256 - PS256 vai SHA256withRSAandMGF1 is NOT available from the underlying JCE (org.jose4j.lang.JoseException: Unable to get an implementation of algorithm name: SHA256withRSAandMGF1; caused by: java.security.NoSuchAlgorithmException: SHA256withRSAandMGF1 Signature not available).
Got this exception while running this example [JWT example] https://bitbucket.org/b_c/jose4j/wiki/JWT%20Examples
I'm trying to integrate jwt tokens for a Jersey REST web service Any suggestions?
Comments (7)
-
repo owner -
repo owner - changed status to invalid
just an informational log message
-
Its not invalid for people who use these 'rare' algorithms
-
repo owner https://bitbucket.org/b_c/jose4j/issues/129/rsassa-pss-support-in-java-11 support for RSA PSS is becoming more widespread
-
SHA256withRSAandMGF1 is allegedly supported in JDK11 https://docs.oracle.com/en/java/javase/11/security/oracle-providers.html#GUID-17E3589E-E4BA-4881-9B12-9880DD2D128D)
but when listing Providers and Signature algorithms this is all that comes up:
SUN : SHA1withDSA
SUN : NONEwithDSA
SUN : SHA224withDSA
SUN : SHA256withDSA
SUN : SHA1withDSAinP1363Format
SUN : NONEwithDSAinP1363Format
SUN : SHA224withDSAinP1363Format
SUN : SHA256withDSAinP1363Format
SunRsaSign : MD2withRSA
SunRsaSign : MD5withRSA
SunRsaSign : SHA1withRSA
SunRsaSign : SHA224withRSA
SunRsaSign : SHA256withRSA
SunRsaSign : SHA384withRSA
SunRsaSign : SHA512withRSA
SunRsaSign : SHA512/224withRSA
SunRsaSign : SHA512/256withRSA
SunRsaSign : RSASSA-PSS
SunEC : NONEwithECDSA
SunEC : SHA1withECDSA
SunEC : SHA224withECDSA
SunEC : SHA256withECDSA
SunEC : SHA384withECDSA
SunEC : SHA512withECDSA
SunEC : NONEwithECDSAinP1363Format
SunEC : SHA1withECDSAinP1363Format
SunEC : SHA224withECDSAinP1363Format
SunEC : SHA256withECDSAinP1363Format
SunEC : SHA384withECDSAinP1363Format
SunEC : SHA512withECDSAinP1363Format
SunJSSE : MD2withRSA
SunJSSE : MD5withRSA
SunJSSE : SHA1withRSA
SunJSSE : MD5andSHA1withRSA
SunMSCAPI : NONEwithRSA
SunMSCAPI : SHA1withRSA
SunMSCAPI : SHA256withRSA
SunMSCAPI : SHA384withRSA
SunMSCAPI : SHA512withRSA
SunMSCAPI : RSASSA-PSS
SunMSCAPI : MD5withRSA
SunMSCAPI : MD2withRSA -
see https://bitbucket.org/b_c/jose4j/issues/129/rsassa-pss-support-in-java-11 for more about java 11 and RSA PSS but basically it uses different name(s) than SHA256withRSAandMGF1
-
I ended up adding BouncyCastle Provider which does have this named Signature
- Log in to comment
It's just an informational log message saying that the JWS algorithm "PS256" isn't available because the underlying JCA provider doesn't support RSASSA-PSS. There's probably a similar message for PS384 and PS512. Those JWS algorithms are rarely used, however, so it shouldn't be an issue.