List of usage examples for java.security SignatureException getMessage
public String getMessage()
From source file:org.ejbca.core.protocol.ws.EjbcaWS.java
/** Method called from cvcRequest that simply verifies a CVCertificate with a public key and throws AuthorizationDeniedException * if verification works. Used to check if a request is sent containing the same public key. * this could be replaced by enforcing unique public key on the CA (from EJBCA 3.10) actually... * //from w w w . j av a 2 s. c o m * @param pk * @param innerreq * @param holderref * @throws AuthorizationDeniedException */ private void checkInnerCollision(PublicKey pk, CVCertificate innerreq, String holderref) throws AuthorizationDeniedException { // Check to see that the inner signature does not verify using an old certificate (public key) // because that means the same keys were used, and that is not allowed according to the EU policy CardVerifiableCertificate innercert = new CardVerifiableCertificate(innerreq); try { innercert.verify(pk); String msg = intres.getLocalizedMessage("cvc.error.renewsamekeys", holderref); log.info(msg); throw new AuthorizationDeniedException(msg); } catch (SignatureException e) { // It was good if the verification failed } catch (NoSuchProviderException e) { String msg = intres.getLocalizedMessage("cvc.error.outersignature", holderref, e.getMessage()); log.warn(msg, e); throw new AuthorizationDeniedException(msg); } catch (InvalidKeyException e) { String msg = intres.getLocalizedMessage("cvc.error.outersignature", holderref, e.getMessage()); log.warn(msg, e); throw new AuthorizationDeniedException(msg); } catch (NoSuchAlgorithmException e) { String msg = intres.getLocalizedMessage("cvc.error.outersignature", holderref, e.getMessage()); log.info(msg, e); throw new AuthorizationDeniedException(msg); } catch (CertificateException e) { String msg = intres.getLocalizedMessage("cvc.error.outersignature", holderref, e.getMessage()); log.warn(msg, e); throw new AuthorizationDeniedException(msg); } }