com.nimbusds.jose.Algorithm.equals()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中com.nimbusds.jose.Algorithm.equals()方法的一些代码示例,展示了Algorithm.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Algorithm.equals()方法的具体详情如下:
包路径:com.nimbusds.jose.Algorithm
类名称:Algorithm
方法名:equals

Algorithm.equals介绍

[英]Overrides Object.equals().
[中]覆盖对象。等于()。

代码示例

代码示例来源:origin: mitreid-connect/OpenID-Connect-Java-Spring-Server

  1. if (!clientAlg.equals(tokenAlg)) {
  2. throw new AuthenticationServiceException("Token algorithm " + tokenAlg + " does not match expected algorithm " + clientAlg);
  3. if (tokenAlg != null && !tokenAlg.equals(Algorithm.NONE)) {
  4. throw new AuthenticationServiceException("Unsigned token received, expected signature with " + tokenAlg);
  5. if (tokenAlg.equals(JWSAlgorithm.HS256)
  6. || tokenAlg.equals(JWSAlgorithm.HS384)
  7. || tokenAlg.equals(JWSAlgorithm.HS512)) {

代码示例来源:origin: com.nimbusds/nimbus-jose-jwt

  1. if (alg.equals(Algorithm.NONE)) {
  2. return PlainJWT.parse(s);
  3. } else if (alg instanceof JWSAlgorithm) {

代码示例来源:origin: com.nimbusds/nimbus-jose-jwt

  1. /**
  2. * Parses a {@link PlainHeader}, {@link JWSHeader} or {@link JWEHeader}
  3. * from the specified JSON object.
  4. *
  5. * @param jsonObject The JSON object to parse. Must not be
  6. * {@code null}.
  7. * @param parsedBase64URL The original parsed Base64URL, {@code null}
  8. * if not applicable.
  9. *
  10. * @return The header.
  11. *
  12. * @throws ParseException If the specified JSON object doesn't
  13. * represent a valid header.
  14. */
  15. public static Header parse(final JSONObject jsonObject,
  16. final Base64URL parsedBase64URL)
  17. throws ParseException {
  18. Algorithm alg = parseAlgorithm(jsonObject);
  19. if (alg.equals(Algorithm.NONE)) {
  20. return PlainHeader.parse(jsonObject, parsedBase64URL);
  21. } else if (alg instanceof JWSAlgorithm) {
  22. return JWSHeader.parse(jsonObject, parsedBase64URL);
  23. } else if (alg instanceof JWEAlgorithm) {
  24. return JWEHeader.parse(jsonObject, parsedBase64URL);
  25. } else {
  26. throw new AssertionError("Unexpected algorithm type: " + alg);
  27. }
  28. }

代码示例来源:origin: com.nimbusds/nimbus-jose-jwt

  1. if (alg.equals(Algorithm.NONE)) {
  2. return PlainObject.parse(s);
  3. } else if (alg instanceof JWSAlgorithm) {

代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.hostobjects.oidc

  1. if (!clientAlg.equals(tokenAlg)) {
  2. isValid = false;
  3. log.error("Token algorithm " + tokenAlg + " does not match expected algorithm " + clientAlg);

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth

  1. private void setRequestObjectValues(String requestObjectString, RequestObject requestObjectInstance) throws
  2. RequestObjectException {
  3. try {
  4. JOSEObject jwt = JOSEObject.parse(requestObjectString);
  5. if (jwt.getHeader().getAlgorithm() == null || jwt.getHeader().getAlgorithm().equals(JWSAlgorithm.NONE)) {
  6. requestObjectInstance.setPlainJWT(PlainJWT.parse(requestObjectString));
  7. } else {
  8. requestObjectInstance.setSignedJWT(SignedJWT.parse(requestObjectString));
  9. }
  10. } catch (ParseException e) {
  11. String errorMessage = "No Valid JWT is found for the Request Object.";
  12. if (log.isDebugEnabled()) {
  13. log.debug(errorMessage + "Received Request Object: " + requestObjectString, e);
  14. }
  15. throw new RequestObjectException(OAuth2ErrorCodes.INVALID_REQUEST, errorMessage);
  16. }
  17. }

代码示例来源:origin: com.moomanow/moomanow-oauth2

  1. if (!clientAlg.equals(tokenAlg)) {
  2. throw new AuthenticationServiceException("Token algorithm " + tokenAlg + " does not match expected algorithm " + clientAlg);
  3. if (tokenAlg != null && !tokenAlg.equals(Algorithm.NONE)) {
  4. throw new AuthenticationServiceException("Unsigned token received, expected signature with " + tokenAlg);
  5. if (tokenAlg.equals(JWSAlgorithm.HS256)
  6. || tokenAlg.equals(JWSAlgorithm.HS384)
  7. || tokenAlg.equals(JWSAlgorithm.HS512)) {

代码示例来源:origin: org.mitre/openid-connect-client

  1. if (!clientAlg.equals(tokenAlg)) {
  2. throw new AuthenticationServiceException("Token algorithm " + tokenAlg + " does not match expected algorithm " + clientAlg);
  3. if (tokenAlg != null && !tokenAlg.equals(Algorithm.NONE)) {
  4. throw new AuthenticationServiceException("Unsigned token received, expected signature with " + tokenAlg);
  5. if (tokenAlg.equals(JWSAlgorithm.HS256)
  6. || tokenAlg.equals(JWSAlgorithm.HS384)
  7. || tokenAlg.equals(JWSAlgorithm.HS512)) {

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.oauth

  1. if(!JWSAlgorithm.NONE.equals(signatureAlgorithm)){
  2. JWSHeader header = new JWSHeader(JWSAlgorithm.RS256);
  3. header.setX509CertThumbprint(new Base64URL(getThumbPrint(tenantDomain, tenantID)));

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.oauth2/org.wso2.carbon.identity.oauth

  1. if(!JWSAlgorithm.NONE.equals(signatureAlgorithm)){
  2. jwt = OAuth2Util.signJWT(claimsSet, signatureAlgorithm, tenantDomain);
  3. } else {

相关文章