You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by he...@apache.org on 2002/08/14 16:15:04 UTC

cvs commit: jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/crypto TurbineCrypto.java

henning     2002/08/14 07:15:04

  Modified:    xdocs/howto crypto-service.xml
               src/java/org/apache/fulcrum/crypto TurbineCrypto.java
  Log:
  Added a facade method for getCryptoAlgorithm. Changed docs to reflect this
  
  Revision  Changes    Path
  1.3       +1 -1      jakarta-turbine-fulcrum/xdocs/howto/crypto-service.xml
  
  Index: crypto-service.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/xdocs/howto/crypto-service.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- crypto-service.xml	15 Jul 2002 11:29:52 -0000	1.2
  +++ crypto-service.xml	14 Aug 2002 14:15:04 -0000	1.3
  @@ -87,7 +87,7 @@
   {
       public String doMD5Encryption(String input)
       {
  -        CryptoAlgorithm ca = TurbineCrypto.getService().getCryptoAlgorithm("default");
  +        CryptoAlgorithm ca = TurbineCrypto.getCryptoAlgorithm("default");
   
           ca.setCipher("MD5");
   
  
  
  
  1.2       +21 -1     jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/crypto/TurbineCrypto.java
  
  Index: TurbineCrypto.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/src/java/org/apache/fulcrum/crypto/TurbineCrypto.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TurbineCrypto.java	1 Jul 2002 16:33:37 -0000	1.1
  +++ TurbineCrypto.java	14 Aug 2002 14:15:04 -0000	1.2
  @@ -54,6 +54,8 @@
    * <http://www.apache.org/>.
    */
   
  +import java.security.NoSuchAlgorithmException;
  +
   import org.apache.fulcrum.TurbineServices;
   
   /**
  @@ -81,5 +83,23 @@
       {
           return (CryptoService) TurbineServices.getInstance()
               .getService(CryptoService.SERVICE_NAME);
  +    }
  +
  +
  +    /**
  +     * Returns a CryptoAlgorithm Object which represents the requested
  +     * crypto algorithm.
  +     *
  +     * @param algo      Name of the requested algorithm
  +     *
  +     * @return An Object representing the algorithm
  +     *
  +     * @throws NoSuchAlgorithmException  Requested algorithm is not available
  +     *
  +     */
  +    public static CryptoAlgorithm getCryptoAlgorithm(String algo)
  +        throws NoSuchAlgorithmException
  +    {
  +        return getService().getCryptoAlgorithm(algo);
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>