下面列出了怎么用io.jsonwebtoken.lang.RuntimeEnvironment的API类实例代码及写法,或者点击链接到github查看源代码。
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();
}
protected boolean isBouncyCastleAvailable() {
return RuntimeEnvironment.BOUNCY_CASTLE_AVAILABLE;
}
protected boolean isBouncyCastleAvailable() {
return RuntimeEnvironment.BOUNCY_CASTLE_AVAILABLE;
}