List of usage examples for java.security.cert CertificateExpiredException getLocalizedMessage
public String getLocalizedMessage()
From source file:org.ejbca.core.protocol.cmp.authentication.EndEntityCertificateAuthenticationModule.java
private boolean isExtraCertValid() { X509Certificate cert = (X509Certificate) extraCert; try {/*from www.j a va 2 s . c o m*/ cert.checkValidity(); if (log.isDebugEnabled()) { log.debug("The certificate in extraCert is valid"); } } catch (CertificateExpiredException e) { this.errorMessage = "The certificate attached to the PKIMessage in the extraCert field in not valid."; if (log.isDebugEnabled()) { log.debug(this.errorMessage + " SubjectDN=" + CertTools.getSubjectDN(cert) + " - " + e.getLocalizedMessage()); } return false; } catch (CertificateNotYetValidException e) { this.errorMessage = "The certificate attached to the PKIMessage in the extraCert field in not valid."; if (log.isDebugEnabled()) { log.debug(this.errorMessage + " SubjectDN=" + CertTools.getSubjectDN(cert) + " - " + e.getLocalizedMessage()); } return false; } return true; }