com.nimbusds.jose.util.X509CertUtils Java Examples

The following examples show how to use com.nimbusds.jose.util.X509CertUtils. 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: IssuerDataService.java    From XS2A-Sandbox with Apache License 2.0 5 votes vote down vote up
public X509Certificate getCertificateFromClassPath() {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();
    InputStream is = loader.getResourceAsStream("certificates/" + ISSUER_CERTIFICATE);

    if (is == null) {
        throw new CertificateException("Could not find certificate in classpath");
    }

    try {
        byte[] bytes = IOUtils.toByteArray(is);
        return X509CertUtils.parse(bytes);
    } catch (IOException ex) {
        throw new CertificateException("Could not read certificate from classpath", ex);
    }
}
 
Example #2
Source File: FirebaseJwtTokenDecoder.java    From spring-cloud-gcp with Apache License 2.0 4 votes vote down vote up
private X509Certificate convertToX509Cert(String certificateString) {
	X509Certificate certificate = X509CertUtils.parse(certificateString);
	Assert.notNull(certificate, "Could not parse certificate String");
	return certificate;
}
 
Example #3
Source File: RSAJWKSourceResolver.java    From graviteeio-access-management with Apache License 2.0 4 votes vote down vote up
public RSAJWKSourceResolver(String publicKey) {
    X509Certificate cert = X509CertUtils.parse(publicKey);
    jwk = parse(cert);
}