use of org.orcid.core.oauth.openid.OpenIDConnectKeyService.OpenIDConnectKeyServiceConfig in project ORCID-Source by ORCID.
the class OpenIDConnectKeyServiceTest method testKeyGenAndSigning.
@Test
public void testKeyGenAndSigning() throws JOSEException, NoSuchAlgorithmException, IOException, ParseException, URISyntaxException {
OpenIDConnectKeyService.OpenIDConnectKeyServiceConfig config = new OpenIDConnectKeyServiceConfig();
config.keyName = "IntTestKey1";
config.jsonKey = testKey;
OpenIDConnectKeyService service = new OpenIDConnectKeyService(config);
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("test", "abcd1234");
JWTClaimsSet claims = new JWTClaimsSet.Builder().issuer("me").build();
SignedJWT signed = service.sign(claims);
JWSVerifier verifier = new RSASSAVerifier(((RSAKey) service.getPublicJWK()));
Assert.assertTrue(signed.verify(verifier));
}
Aggregations