use of com.amazonaws.services.kms.model.GetPublicKeyResult in project di-authentication-api by alphagov.
the class TokenValidationService method createJwk.
private ECKey createJwk(String keyId) {
GetPublicKeyRequest getPublicKeyRequest = new GetPublicKeyRequest();
getPublicKeyRequest.setKeyId(keyId);
GetPublicKeyResult publicKeyResult = kmsConnectionService.getPublicKey(getPublicKeyRequest);
PublicKey publicKey = createPublicKey(publicKeyResult);
return new ECKey.Builder(Curve.P_256, (ECPublicKey) publicKey).keyID(hashSha256String(publicKeyResult.getKeyId())).keyUse(KeyUse.SIGNATURE).algorithm(new Algorithm(JWSAlgorithm.ES256.getName())).build();
}
Aggregations