本文整理了Java中com.nimbusds.jose.util.Base64.decode()
方法的一些代码示例,展示了Base64.decode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Base64.decode()
方法的具体详情如下:
包路径:com.nimbusds.jose.util.Base64
类名称:Base64
方法名:decode
[英]Decodes this Base64 object to a byte array.
[中]将此Base64对象解码为字节数组。
代码示例来源:origin: com.nimbusds/nimbus-jose-jwt
/**
* Decodes this Base64 object to an unsigned big integer.
*
* <p>Same as {@code new BigInteger(1, base64.decode())}.
*
* @return The resulting big integer.
*/
public BigInteger decodeToBigInteger() {
return new BigInteger(1, decode());
}
代码示例来源:origin: com.nimbusds/nimbus-jose-jwt
/**
* Decodes this Base64 object to a string.
*
* @return The resulting string, in the UTF-8 character set.
*/
public String decodeToString() {
return new String(decode(), StandardCharset.UTF_8);
}
代码示例来源:origin: org.apereo.cas/cas-server-support-token-authentication
/**
* Convert secret to bytes honoring {@link RegisteredServiceProperty.RegisteredServiceProperties#TOKEN_SECRETS_ARE_BASE64_ENCODED}
* config parameter.
*
* @param secret - String to be represented to byte[]
* @param secretIsBase64Encoded - is this a base64 encoded #secret?
* @return byte[] representation of #secret
*/
private static byte[] getSecretBytes(final String secret, final boolean secretIsBase64Encoded) {
return secretIsBase64Encoded ? new Base64(secret).decode() : secret.getBytes(UTF_8);
}
}
代码示例来源:origin: org.pac4j/pac4j-jwt
public void setSecretBase64(final String secret) {
this.secret = new Base64(secret).decode();
}
代码示例来源:origin: de.adorsys.oauth/oauth-server
private static byte[] getSecretKey() {
return new Base64(SECRET_KEY).decode();
}
代码示例来源:origin: org.pac4j/pac4j-jwt
public void setSecretBase64(final String secret) {
this.secret = new Base64(secret).decode();
}
代码示例来源:origin: com.nimbusds/nimbus-jose-jwt
X509Certificate cert = X509CertUtils.parse(b64List.get(i).decode());
代码示例来源:origin: com.nimbusds/nimbus-jose-jwt
/**
* Parses a PEM-encoded X.509 certificate.
*
* @param pemEncodedCert The PEM-encoded X.509 certificate, as a
* string. May be {@code null}.
*
* @return The X.509 certificate, {@code null} if parsing failed.
*/
public static X509Certificate parse(final String pemEncodedCert) {
if (pemEncodedCert == null || pemEncodedCert.isEmpty()) {
return null;
}
final int markerStart = pemEncodedCert.indexOf(PEM_BEGIN_MARKER);
if (markerStart < 0) {
return null;
}
String buf = pemEncodedCert.substring(markerStart + PEM_BEGIN_MARKER.length());
final int markerEnd = buf.indexOf(PEM_END_MARKER);
if (markerEnd < 0) {
return null;
}
buf = buf.substring(0, markerEnd);
buf = buf.replaceAll("\\s", "");
return parse(new Base64(buf).decode());
}
代码示例来源:origin: GluuFederation/oxAuth
JWSObject jwsObject = JWSObject.parse(reader.readLine());
List<String> certificateChain = jwsObject.getHeader().getX509CertChain().stream().map(c -> base64Service.encodeToString(c.decode()))
.collect(Collectors.toList());
JWSAlgorithm algorithm = jwsObject.getHeader().getAlgorithm();
内容来源于网络,如有侵权,请联系作者删除!