use of org.keycloak.crypto.AsymmetricSignatureSignerContext in project keycloak by keycloak.
the class OAuthClient method createSigner.
public SignatureSignerContext createSigner(PrivateKey privateKey, String kid, String algorithm) {
KeyWrapper keyWrapper = new KeyWrapper();
keyWrapper.setAlgorithm(algorithm);
keyWrapper.setKid(kid);
keyWrapper.setPrivateKey(privateKey);
SignatureSignerContext signer;
switch(algorithm) {
case Algorithm.ES256:
case Algorithm.ES384:
case Algorithm.ES512:
signer = new ServerECDSASignatureSignerContext(keyWrapper);
break;
default:
signer = new AsymmetricSignatureSignerContext(keyWrapper);
}
return signer;
}
Aggregations