io.jsonwebtoken.lang.RuntimeEnvironment Java Examples

The following examples show how to use io.jsonwebtoken.lang.RuntimeEnvironment. 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: ConfigJwkResolver.java    From juiser with Apache License 2.0 6 votes vote down vote up
protected Function<Resource, Key> createResourceKeyFunction(Resource keyResource, boolean keyStringSpecified) {

        if (!isClassAvailable("org.bouncycastle.openssl.PEMParser")) {

            String msg = "The org.bouncycastle:bcpkix-jdk15on:1.56 artifact (or newer) must be in the " +
                "classpath to be able to parse the " +
                (keyStringSpecified ?
                    "juiser.header.jwt.key.value PEM-encoded value" :
                    "juiser.header.jwt.key.resource [" + keyResource + "].");
            throw new IllegalStateException(msg);
        } else {
            RuntimeEnvironment.enableBouncyCastleIfPossible();
        }

        return new PemResourceKeyResolver();
    }
 
Example #2
Source File: SignatureProvider.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
protected boolean isBouncyCastleAvailable() {
    return RuntimeEnvironment.BOUNCY_CASTLE_AVAILABLE;
}
 
Example #3
Source File: SignatureProvider.java    From jjwt with Apache License 2.0 4 votes vote down vote up
protected boolean isBouncyCastleAvailable() {
    return RuntimeEnvironment.BOUNCY_CASTLE_AVAILABLE;
}