Java Code Examples for com.nimbusds.jose.JWSAlgorithm#ES384
The following examples show how to use
com.nimbusds.jose.JWSAlgorithm#ES384 .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JWTAccessTokenBuilder.java From msf4j with Apache License 2.0 | 6 votes |
/** * This method map signature algorithm define in identity.xml to nimbus * signature algorithm * format, Strings are defined inline hence there are not being used any * where * * @param signatureAlgorithm * @return * @throws IdentityOAuth2Exception */ protected JWSAlgorithm mapSignatureAlgorithm(String signatureAlgorithm) throws IdentityOAuth2Exception { if (NONE.equals(signatureAlgorithm)) { return new JWSAlgorithm(JWSAlgorithm.NONE.getName()); } else if (SHA256_WITH_RSA.equals(signatureAlgorithm)) { return JWSAlgorithm.RS256; } else if (SHA384_WITH_RSA.equals(signatureAlgorithm)) { return JWSAlgorithm.RS384; } else if (SHA512_WITH_RSA.equals(signatureAlgorithm)) { return JWSAlgorithm.RS512; } else if (SHA256_WITH_HMAC.equals(signatureAlgorithm)) { return JWSAlgorithm.HS256; } else if (SHA384_WITH_HMAC.equals(signatureAlgorithm)) { return JWSAlgorithm.HS384; } else if (SHA512_WITH_HMAC.equals(signatureAlgorithm)) { return JWSAlgorithm.HS512; } else if (SHA256_WITH_EC.equals(signatureAlgorithm)) { return JWSAlgorithm.ES256; } else if (SHA384_WITH_EC.equals(signatureAlgorithm)) { return JWSAlgorithm.ES384; } else if (SHA512_WITH_EC.equals(signatureAlgorithm)) { return JWSAlgorithm.ES512; } throw new IdentityOAuth2Exception("Unsupported Signature Algorithm in identity.xml"); }
Example 2
Source File: DefaultIDTokenBuilder.java From carbon-identity with Apache License 2.0 | 6 votes |
/** * This method map signature algorithm define in identity.xml to nimbus * signature algorithm * format, Strings are defined inline hence there are not being used any * where * * @param signatureAlgorithm * @return * @throws IdentityOAuth2Exception */ protected JWSAlgorithm mapSignatureAlgorithm(String signatureAlgorithm) throws IdentityOAuth2Exception { if (NONE.equals(signatureAlgorithm)) { return new JWSAlgorithm(JWSAlgorithm.NONE.getName()); } else if (SHA256_WITH_RSA.equals(signatureAlgorithm)) { return JWSAlgorithm.RS256; } else if (SHA384_WITH_RSA.equals(signatureAlgorithm)) { return JWSAlgorithm.RS384; } else if (SHA512_WITH_RSA.equals(signatureAlgorithm)) { return JWSAlgorithm.RS512; } else if (SHA256_WITH_HMAC.equals(signatureAlgorithm)) { return JWSAlgorithm.HS256; } else if (SHA384_WITH_HMAC.equals(signatureAlgorithm)) { return JWSAlgorithm.HS384; } else if (SHA512_WITH_HMAC.equals(signatureAlgorithm)) { return JWSAlgorithm.HS512; } else if (SHA256_WITH_EC.equals(signatureAlgorithm)) { return JWSAlgorithm.ES256; } else if (SHA384_WITH_EC.equals(signatureAlgorithm)) { return JWSAlgorithm.ES384; } else if (SHA512_WITH_EC.equals(signatureAlgorithm)) { return JWSAlgorithm.ES512; } throw new IdentityOAuth2Exception("Unsupported Signature Algorithm in identity.xml"); }
Example 3
Source File: ClientCredentialsGrantHandler.java From attic-stratos with Apache License 2.0 | 6 votes |
protected JWSAlgorithm mapSignatureAlgorithm(String signatureAlgorithm) throws IdentityOAuth2Exception { if ("SHA256withRSA".equals(signatureAlgorithm)) { return JWSAlgorithm.RS256; } else if ("SHA384withRSA".equals(signatureAlgorithm)) { return JWSAlgorithm.RS384; } else if ("SHA512withRSA".equals(signatureAlgorithm)) { return JWSAlgorithm.RS512; } else if ("SHA256withHMAC".equals(signatureAlgorithm)) { return JWSAlgorithm.HS256; } else if ("SHA384withHMAC".equals(signatureAlgorithm)) { return JWSAlgorithm.HS384; } else if ("SHA512withHMAC".equals(signatureAlgorithm)) { return JWSAlgorithm.HS512; } else if ("SHA256withEC".equals(signatureAlgorithm)) { return JWSAlgorithm.ES256; } else if ("SHA384withEC".equals(signatureAlgorithm)) { return JWSAlgorithm.ES384; } else if ("SHA512withEC".equals(signatureAlgorithm)) { return JWSAlgorithm.ES512; } log.error("Unsupported Signature Algorithm in identity.xml"); throw new IdentityOAuth2Exception("Unsupported Signature Algorithm in identity.xml"); }
Example 4
Source File: JWTTokenGenerator.java From carbon-identity with Apache License 2.0 | 5 votes |
/** * This method map signature algorithm define in identity.xml to nimbus * signature algorithm * format, Strings are defined inline hence there are not being used any * where * * @param signatureAlgorithm * @return * @throws IdentityOAuth2Exception */ protected JWSAlgorithm mapSignatureAlgorithm(String signatureAlgorithm) throws IdentityOAuth2Exception { if ("SHA256withRSA".equals(signatureAlgorithm)) { return JWSAlgorithm.RS256; } else if ("SHA384withRSA".equals(signatureAlgorithm)) { return JWSAlgorithm.RS384; } else if ("SHA512withRSA".equals(signatureAlgorithm)) { return JWSAlgorithm.RS512; } else if ("SHA256withHMAC".equals(signatureAlgorithm)) { return JWSAlgorithm.HS256; } else if ("SHA384withHMAC".equals(signatureAlgorithm)) { return JWSAlgorithm.HS384; } else if ("SHA512withHMAC".equals(signatureAlgorithm)) { return JWSAlgorithm.HS512; } else if ("SHA256withEC".equals(signatureAlgorithm)) { return JWSAlgorithm.ES256; } else if ("SHA384withEC".equals(signatureAlgorithm)) { return JWSAlgorithm.ES384; } else if ("SHA512withEC".equals(signatureAlgorithm)) { return JWSAlgorithm.ES512; } else if(NONE.equals(signatureAlgorithm)){ return new JWSAlgorithm(JWSAlgorithm.NONE.getName()); } log.error("Unsupported Signature Algorithm in identity.xml"); throw new IdentityOAuth2Exception("Unsupported Signature Algorithm in identity.xml"); }