You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2018/10/23 19:01:26 UTC
svn commit: r1844690 -
/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
Author: tilman
Date: Tue Oct 23 19:01:26 2018
New Revision: 1844690
URL: http://svn.apache.org/viewvc?rev=1844690&view=rev
Log:
PDFBOX-3017: improve javadoc; add some //TODOs
Modified:
pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java?rev=1844690&r1=1844689&r2=1844690&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java (original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/signature/validation/CertInformationCollector.java Tue Oct 23 19:01:26 2018
@@ -68,6 +68,8 @@ public class CertInformationCollector
private static final int MAX_CERTIFICATE_CHAIN_DEPTH = 5;
+ //TODO certificateStore name misleading, this is a map.
+ // even more confusing: there are also "certificatesStore" variables that are a Store
private final Map<BigInteger, X509Certificate> certificateStore = new HashMap<BigInteger, X509Certificate>();
private final JcaX509CertificateConverter certConverter = new JcaX509CertificateConverter();
@@ -360,8 +362,9 @@ public class CertInformationCollector
}
/**
- * Gets the X509Certificate out of the X509CertificateHolder
- *
+ * Gets the X509Certificate out of the X509CertificateHolder and add it to
+ * the certificateStore map.
+ *
* @param certificateHolder to get the certificate from
* @return a X509Certificate or <code>null</code> when there was an Error with the Certificate
* @throws CertificateProccessingException on failed conversion from X509CertificateHolder to X509Certificate
@@ -369,6 +372,7 @@ public class CertInformationCollector
private X509Certificate getCertFromHolder(X509CertificateHolder certificateHolder)
throws CertificateProccessingException
{
+ //TODO getCertFromHolder violates "do one thing" rule (adds to the map and returns a certificate)
if (!certificateStore.containsKey(certificateHolder.getSerialNumber()))
{
try