com.nimbusds.jose.util.Base64.encode()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(284)

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

Base64.encode介绍

[英]Base64-encodes the specified string.
[中]Base64对指定的字符串进行编码。

代码示例

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

@Override
  protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
    ClientHttpRequest httpRequest = super.createRequest(url, method);
    httpRequest.getHeaders().add("Authorization",
        String.format("Basic %s", Base64.encode(String.format("%s:%s", clientId, clientSecret)) ));
    return httpRequest;
  }
};

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

@Override
  protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
    ClientHttpRequest httpRequest = super.createRequest(url, method);
    httpRequest.getHeaders().add("Authorization",
        String.format("Basic %s", Base64.encode(String.format("%s:%s",
            UriUtils.encodePathSegment(clientConfig.getClientId(), "UTF-8"),
            UriUtils.encodePathSegment(clientConfig.getClientSecret(), "UTF-8")))));
    return httpRequest;
  }
};

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

/**
   * Base64-encodes the specified string.
   *
   * @param text The string to encode. Must be in the UTF-8 character set
   *             and not {@code null}.
   *
   * @return The resulting Base64 object.
   */
  public static Base64 encode(final String text) {

    return encode(text.getBytes(StandardCharset.UTF_8));
  }
}

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

/**
 * Base64-encodes the specified big integer, without the sign bit.
 *
 * @param bigInt The big integer to encode. Must not be {@code null}.
 *
 * @return The resulting Base64 object.
 */
public static Base64 encode(final BigInteger bigInt) {
  return encode(BigIntegerUtils.toBytesUnsigned(bigInt));
}

代码示例来源:origin: org.pac4j/pac4j-jwt

public String getSecretBase64() {
  return Base64.encode(secret).toString();
}

代码示例来源:origin: org.pac4j/pac4j-jwt

public String getSecretBase64() {
  return Base64.encode(secret).toString();
}

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

@Override
  protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
    ClientHttpRequest httpRequest = super.createRequest(url, method);
    httpRequest.getHeaders().add("Authorization",
        String.format("Basic %s", Base64.encode(String.format("%s:%s", clientId, clientSecret)) ));
    return httpRequest;
  }
};

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

sb.append(Base64.encode(cert.getEncoded()).toString());
} catch (CertificateEncodingException e) {
  return null;

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

encode(String.format("%s:%s", clientId, clientSecret))).trim());

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

@Override
  protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
    ClientHttpRequest httpRequest = super.createRequest(url, method);
    httpRequest.getHeaders().add("Authorization",
        String.format("Basic %s", Base64.encode(String.format("%s:%s",
            UriUtils.encodePathSegment(clientConfig.getClientId(), "UTF-8"),
            UriUtils.encodePathSegment(clientConfig.getClientSecret(), "UTF-8")))));
    return httpRequest;
  }
};

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

@Override
  protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
    ClientHttpRequest httpRequest = super.createRequest(url, method);
    httpRequest.getHeaders().add("Authorization",
        String.format("Basic %s", Base64.encode(String.format("%s:%s",
            UriUtils.encodePathSegment(clientConfig.getClientId(), "UTF-8"),
            UriUtils.encodePathSegment(clientConfig.getClientSecret(), "UTF-8")))));
    return httpRequest;
  }
};

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

.keyUse(KeyUse.from(cert))
.keyID(cert.getSerialNumber().toString(10))
.x509CertChain(Collections.singletonList(Base64.encode(cert.getEncoded())))
.x509CertSHA256Thumbprint(Base64URL.encode(sha256.digest(cert.getEncoded())))
.build();

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

.keyUse(KeyUse.from(cert))
.keyID(cert.getSerialNumber().toString(10))
.x509CertChain(Collections.singletonList(Base64.encode(cert.getEncoded())))
.x509CertSHA256Thumbprint(Base64URL.encode(sha256.digest(cert.getEncoded())))
.build();

相关文章