Example usage for java.security.cert CRLException CRLException

List of usage examples for java.security.cert CRLException CRLException

Introduction

In this page you can find the example usage for java.security.cert CRLException CRLException.

Prototype

public CRLException(String message, Throwable cause) 

Source Link

Document

Creates a CRLException with the specified detail message and cause.

Usage

From source file:mitm.common.security.crl.PKIXRevocationChecker.java

private void verifyCertificate(X509Certificate certificate, PublicKey issuerPublicKey) throws CRLException {
    try {//from  w w  w  . ja v a 2s.c o m
        certificate.verify(issuerPublicKey, securityFactory.getNonSensitiveProvider());
    } catch (InvalidKeyException e) {
        throw new CRLException("Certificate verification failed.", e);
    } catch (CertificateException e) {
        throw new CRLException("Certificate verification failed.", e);
    } catch (NoSuchAlgorithmException e) {
        throw new CRLException("Certificate verification failed.", e);
    } catch (NoSuchProviderException e) {
        throw new CRLException("Certificate verification failed.", e);
    } catch (SignatureException e) {
        throw new CRLException("Certificate verification failed.", e);
    }
}

From source file:be.fedict.trust.service.bean.HarvesterMDB.java

/**
 * Returns if the specified CRL is indirect.
 * //from  www .  ja va  2 s  .  c om
 * @param crl
 *            the CRL
 * @return true or false
 * @throws CRLException
 *             something went wrong reading the
 *             {@link org.bouncycastle.asn1.x509.IssuingDistributionPoint}.
 */
private boolean isIndirectCRL(X509CRL crl) throws CRLException {
    byte[] idp = crl.getExtensionValue(X509Extensions.IssuingDistributionPoint.getId());
    boolean isIndirect = false;
    try {
        if (idp != null) {
            isIndirect = IssuingDistributionPoint.getInstance(X509ExtensionUtil.fromExtensionValue(idp))
                    .isIndirectCRL();
        }
    } catch (Exception e) {
        throw new CRLException("Exception reading IssuingDistributionPoint", e);
    }

    return isIndirect;
}

From source file:org.viafirma.nucleo.validacion.CRLUtil.java

/**
 * Se conecta a la url indicada y se descarga las crls. No se esta usando
 * /*from   ww w .ja  v a 2s . c  o  m*/
 * @param hostURL
 * @return
 * @throws CRLException
 *             No se ha podido recuperar el listado
 */
public InputStream getIoCrlFromUrl(String hostURL) throws CRLException {
    URL url;
    try {
        url = new URL(hostURL);
        return url.openStream();
    } catch (MalformedURLException e) {
        throw new CRLException("La url  host: " + hostURL + " esta mal formada", e);
    } catch (IOException e) {
        throw new CRLException(
                "No se ha podido conectar al host: " + hostURL + " para recuperar el listado de CRLs", e);
    }

}