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

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

本文整理了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

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

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

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

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

/**
 * Parses a {@link PlainHeader}, {@link JWSHeader} or {@link JWEHeader} 
 * from the specified JSON object.
 *
 * @param jsonObject      The JSON object to parse. Must not be
 *                        {@code null}.
 * @param parsedBase64URL The original parsed Base64URL, {@code null}
 *                        if not applicable.
 *
 * @return The header.
 *
 * @throws ParseException If the specified JSON object doesn't 
 *                        represent a valid header.
 */
public static Header parse(final JSONObject jsonObject,
        final Base64URL parsedBase64URL)
  throws ParseException {
  Algorithm alg = parseAlgorithm(jsonObject);
  if (alg.equals(Algorithm.NONE)) {
    return PlainHeader.parse(jsonObject, parsedBase64URL);
  } else if (alg instanceof JWSAlgorithm) {
    return JWSHeader.parse(jsonObject, parsedBase64URL);
  } else if (alg instanceof JWEAlgorithm) {
    return JWEHeader.parse(jsonObject, parsedBase64URL);
  } else {
    throw new AssertionError("Unexpected algorithm type: " + alg);
  }
}

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

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

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

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

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

private void setRequestObjectValues(String requestObjectString, RequestObject requestObjectInstance) throws
    RequestObjectException {
  try {
    JOSEObject jwt = JOSEObject.parse(requestObjectString);
    if (jwt.getHeader().getAlgorithm() == null || jwt.getHeader().getAlgorithm().equals(JWSAlgorithm.NONE)) {
      requestObjectInstance.setPlainJWT(PlainJWT.parse(requestObjectString));
    } else {
      requestObjectInstance.setSignedJWT(SignedJWT.parse(requestObjectString));
    }
  } catch (ParseException e) {
    String errorMessage = "No Valid JWT is found for the Request Object.";
    if (log.isDebugEnabled()) {
      log.debug(errorMessage + "Received Request Object: " + requestObjectString, e);
    }
    throw new RequestObjectException(OAuth2ErrorCodes.INVALID_REQUEST, errorMessage);
  }
}

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

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

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

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

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

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

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

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

相关文章