CRYPTO-131: Provide FAQ page

Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/217de983
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/217de983
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/217de983

Branch: refs/heads/master
Commit: 217de983601c7de885223f3cf06f5ead54376f64
Parents: d11db42
Author: Benedikt Ritter <[email protected]>
Authored: Sat Nov 26 12:47:33 2016 +0100
Committer: Benedikt Ritter <[email protected]>
Committed: Sat Nov 26 12:47:33 2016 +0100

----------------------------------------------------------------------
 src/changes/changes.xml |  4 ++++
 src/site/site.xml       |  1 +
 src/site/xdoc/faq.xml   | 23 +++++++++++++++++++++--
 3 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/217de983/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 2f9023c..1aaf861 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -61,6 +61,10 @@
    -->
 
   <body>
+    <release version="1.1.0" date="tba" description="tba">
+      <action issue="CRYPTO-131" type="add" dev="britter" >Provide FAQ 
page.</action>
+    </release>
+
     <release version="1.0.0" date="2016-07-22" description="
 Initial release
  ===============

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/217de983/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index 34e99c3..7303639 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -28,6 +28,7 @@
             <item name="Download"
                    
href="http://commons.apache.org/proper/commons-crypto/download_crypto.cgi"/>
             <item name="Users guide"   href="/userguide.html"/>
+            <item name="FAQ"           href="/faq.html"/>
             <item name="Javadoc trunk" href="/apidocs/index.html"/>            
         </menu>
 

http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/217de983/src/site/xdoc/faq.xml
----------------------------------------------------------------------
diff --git a/src/site/xdoc/faq.xml b/src/site/xdoc/faq.xml
index 64f5f57..6f39ca9 100644
--- a/src/site/xdoc/faq.xml
+++ b/src/site/xdoc/faq.xml
@@ -23,11 +23,30 @@ limitations under the License.
 
   <body>
 
+    <h1>Frequently asked questions</h1>
+
     <section name="How to use a custom secret generator?">
       Commons Crypto provides the <code>CryptoRandom</code> interface for 
defining secret generators.
+      The <code>RandomProvider</code> enum in the 
<code>CryptoRandomFactory</code> defines some sensible default
+      implementations:
+
+      <dl>
+        <dt>OPENSSL</dt><dd>OpenSSL based JNI implementation shipped with 
Commons Crypto.</dd>
+        <dt>JAVA</dt><dd>The SecureRandom implementation from the JVM.</dd>
+        <dt>OS</dt><dd>The OS random device implementation. May not be 
available on some operation systems.</dd>
+      </dl>
+
+      When calling <code>CryptoRandomFactory.getCryptoRandom()</code>, Commons 
Crypto tries to use the OpenSSL
+      CryptoRandom implementation first. If this fails, the Java 
implementation is used.
+      In order use a different <code>CryptoRandom</code> implementation (e.g. 
OS), the
+      <code>CryptoRandomFactory.getCryptoRandom(Properties)</code> method can 
be used, passing in the desired
+      implementation class names:
 
-      props.setProperty(CryptoRandomFactory.CLASSES_KEY, 
CryptoRandomFactory.RandomProvider.JAVA.getClassName());
-      CryptoRandom random = CryptoRandomFactory.getCryptoRandom(props);
+<source>
+Properties props = new Properties();
+props.setProperty(CryptoRandomFactory.CLASSES_KEY, 
CryptoRandomFactory.RandomProvider.OS.getClassName());
+CryptoRandom random = CryptoRandomFactory.getCryptoRandom(props);
+</source>
 
     </section>
   </body>

Reply via email to