You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/09/26 09:33:24 UTC

svn commit: r1175704 - in /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl: SSLCAStore.java SSLCRLStore.java

Author: mturk
Date: Mon Sep 26 07:33:24 2011
New Revision: 1175704

URL: http://svn.apache.org/viewvc?rev=1175704&view=rev
Log:
Override store methods. Mostly so we can create a proper documentation

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCAStore.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCRLStore.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCAStore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCAStore.java?rev=1175704&r1=1175703&r2=1175704&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCAStore.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCAStore.java Mon Sep 26 07:33:24 2011
@@ -16,6 +16,8 @@
 
 package org.apache.commons.runtime.ssl;
 
+import org.apache.commons.runtime.InvalidArgumentException;
+
 /**
  * Represents the SSL Certificate Authority (CA).
  */
@@ -25,5 +27,66 @@ public class SSLCAStore extends SSLStore
     public SSLCAStore()
     {
     }
-    
+
+    /**
+     * Set default locations for trusted CA certificates.
+     * <p>
+     * Set the path that points to a file of CA certificates
+     * in PEM format. The file can contain several CA certificates
+     * identified by
+     * <pre>
+     * -----BEGIN CERTIFICATE-----
+     * ... (CA certificate in base64 encoding) ...
+     * -----END CERTIFICATE-----
+     * </pre>
+     * sequences. Before, between, and after the certificates text is allowed
+     * which can be used e.g. for descriptions of the certificates.
+     *
+     * @param path PEM format file of CA's.
+     *
+     * @throws InvalidArgumentException if the file does not exist or is empty.
+     * @throws SecurityException if security manager denies access
+     *          to the file.
+     */
+    @Override
+    public synchronized void setFile(String path)
+        throws InvalidArgumentException,
+               SecurityException
+    {
+        super.setFile(path);
+    }
+
+    /**
+     * Set default locations for trusted CA certificates.
+     * <p>
+     * Set the path that points to a directory containing
+     * CA certificates in PEM format. The files each contain one CA
+     * certificate. The files are looked up by the CA subject name hash
+     * value, which must hence be available. If more than one CA certificate
+     * with the same name hash value exist, the extension must be different
+     * (e.g. {@code 9d66eef0.0, 9d66eef0.1} etc). The search is performed in
+     * the ordering of the extension number, regardless of other properties
+     * of the certificates. Use the {@code c_rehash} utility to create the
+     * necessary links.
+     * <p>
+     * </p>
+     * The certificates in {@code path} are only looked up when required,
+     * e.g. when building the certificate chain or when actually performing
+     * the verification of a peer certificate.
+     * </p>
+     * @param path PEM format directory of CA's.
+     *
+     * @throws InvalidArgumentException if the path does not exist or is not
+     *          an directory.
+     * @throws SecurityException if security manager denies access
+     *          to the path
+     */
+    @Override
+    public synchronized void setPath(String path)
+        throws InvalidArgumentException,
+               SecurityException
+    {
+        super.setPath(path);
+    }
+
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCRLStore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCRLStore.java?rev=1175704&r1=1175703&r2=1175704&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCRLStore.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ssl/SSLCRLStore.java Mon Sep 26 07:33:24 2011
@@ -16,6 +16,8 @@
 
 package org.apache.commons.runtime.ssl;
 
+import org.apache.commons.runtime.InvalidArgumentException;
+
 /**
  * Represents the SSL Certificate Revocation Lists (CRL) store.
  */
@@ -25,5 +27,42 @@ public class SSLCRLStore extends SSLStor
     public SSLCRLStore()
     {
     }
-    
+
+    /**
+     * Sets the all-in-one file where you can assemble the Certificate
+     * Revocation Lists (CRL) of Certification Authorities (CA) whose
+     * clients you deal with.
+     * These are used for Client Authentication. Such a file is simply the
+     * concatenation of the various PEM-encoded CRL files, in order
+     * of preference. This can be used alternatively and/or additionally
+     * to {@code setCARevocationPath}.
+     *
+     * @param path file containg PEM-encoded CRL list.
+     * @throws SSLException if path cannot be set.
+     */
+    @Override
+    public synchronized void setFile(String path)
+        throws InvalidArgumentException,
+               SecurityException
+    {
+        super.setFile(path);
+    }
+
+    /**
+     * Sets the directory where you keep the Certificate Revocation Lists
+     * (CRL) of Certification Authorities (CAs) whose clients you deal with.
+     * These are used to revoke the client certificate on Client
+     * Authentication.
+     *
+     * @param path directory containg CRL list.
+     * @throws SSLException if path cannot be set.
+     */
+    @Override
+    public synchronized void setPath(String path)
+        throws InvalidArgumentException,
+               SecurityException
+    {
+        super.setPath(path);
+    }
+
 }