List of usage examples for org.bouncycastle.x509 PKIXCertPathReviewer getNotifications
public List getNotifications(int index)
From source file:gov.nih.nci.cacis.nav.ValidateSignedMail.java
License:BSD License
private void handleCertPathReviewNotifications(PKIXCertPathReviewer review) { LOG.warn("Notifications:"); final Iterator notificationsIt = review.getNotifications(-1).iterator(); while (notificationsIt.hasNext()) { final ErrorBundle noteMsg = (ErrorBundle) notificationsIt.next(); LOG.warn("\t" + noteMsg.getText(loc)); }/*from w w w .j av a2 s .c o m*/ }
From source file:gov.nih.nci.cacis.nav.ValidateSignedMail.java
License:BSD License
private void handleCertificateErrorsAndNotifications(PKIXCertPathReviewer review) { // per certificate errors and notifications final Iterator certIt = review.getCertPath().getCertificates().iterator(); int i = 0;/*w w w .ja v a 2s .co m*/ while (certIt.hasNext()) { final X509Certificate cert = (X509Certificate) certIt.next(); LOG.warn("\nCertificate " + i + "\n========"); LOG.warn("Issuer: " + cert.getIssuerDN().getName()); LOG.warn("Subject: " + cert.getSubjectDN().getName()); // errors LOG.warn("\tErrors:"); final Iterator errorsIt = review.getErrors(i).iterator(); while (errorsIt.hasNext()) { final ErrorBundle errorMsg = (ErrorBundle) errorsIt.next(); if (dbgLvl == DETAIL) { LOG.warn(DBL_TAB + errorMsg.getDetail(loc)); } else { LOG.warn(DBL_TAB + errorMsg.getText(loc)); } } // notifications LOG.warn("\tNotifications:"); final Iterator notificationsIt = review.getNotifications(i).iterator(); while (notificationsIt.hasNext()) { final ErrorBundle noteMsg = (ErrorBundle) notificationsIt.next(); if (dbgLvl == DETAIL) { LOG.warn(DBL_TAB + noteMsg.getDetail(loc)); } else { LOG.warn(DBL_TAB + noteMsg.getText(loc)); } } i++; } }