|
From: Brian D. (ext) <Bri...@lu...> - 2016-10-14 07:10:32
|
Hello,
I'm using CMP and after an Initialisation Request, I got a signed response from EJBCA.
In 'Certificate Confirmation' > 'default CA' -> I've got a CA ('test'), created in EJBCA and its issuer is the default CA ManagementCA.
With which public key should I verify this signature ?
I tried with the 3 public keys in the 'Crypto Token' view and I just can't make this work properly.
I use this (Java):
byte[] decodedPkey = Base64.decode(publicKeyString);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
KeySpec publicKeySpec = new X509EncodedKeySpec(decodedPkey);
PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
sig.initVerify(publicKey);
sig.update(message.getEncoded());
sig.verify(message.getProtection().getBytes())
Thanks a lot
Have a good day
|