You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by di...@apache.org on 2004/04/16 05:30:38 UTC

cvs commit: ws-fx/wss4j/src/org/apache/ws/security/components/crypto Crypto.java Merlin.java

dims        2004/04/15 20:30:38

  Modified:    wss4j/src/org/apache/ws/security/components/crypto
                        Crypto.java Merlin.java
  Log:
  Patch from "Anderson Jonathan" <an...@bah.com>
  that "exposes some previously private data members, and cleans up JavaDoc"
  
  Revision  Changes    Path
  1.4       +23 -7     ws-fx/wss4j/src/org/apache/ws/security/components/crypto/Crypto.java
  
  Index: Crypto.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/components/crypto/Crypto.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Crypto.java	21 Mar 2004 14:40:40 -0000	1.3
  +++ Crypto.java	16 Apr 2004 03:30:38 -0000	1.4
  @@ -22,8 +22,10 @@
   import java.io.InputStream;
   import java.math.BigInteger;
   import java.security.PrivateKey;
  +import java.security.KeyStore;
   import java.security.cert.Certificate;
   import java.security.cert.X509Certificate;
  +import java.security.cert.CertificateFactory;
   
   /**
    * Crypto.
  @@ -36,9 +38,9 @@
        * load a X509Certificate from the input stream.
        * <p/>
        * 
  -     * @param The <code>InputStream</code> array containg the X509 data
  -     * @throws GeneralSecurityException 
  -     * @return	Returns a X509 certificate
  +     * @param in The <code>InputStream</code> array containg the X509 data
  +     * @throws WSSecurityException
  +     * @return	An X509 certificate
        */
       X509Certificate loadCertificate(InputStream in) throws WSSecurityException;
   
  @@ -49,8 +51,7 @@
        * @param data    The <code>byte</code> array containg the X509 data
        * @param reverse If set the first certificate in input data will
        *                the last in the array
  -     * @throws IOException              
  -     * @throws GeneralSecurityException 
  +     * @throws WSSecurityException
        * @return		An array of X509 certificates, ordered according to
        * the reverse flag
        */
  @@ -63,8 +64,8 @@
        * @param reverse If set the first certificate in the array data will
        *                the last in the byte array
        * @param certs   The certificates to convert
  -     * @throws IOException                  
  -     * @throws CertificateEncodingException 
  +
  +     * @throws WSSecurityException
        * @return		The byte array for the certficates ordered according
        * to the reverse flag
        */
  @@ -146,5 +147,20 @@
   	 * @return 			 The byte array conating the binary SKI data
   	 */
   	public byte[] getSKIBytesFromCert(X509Certificate cert)	throws WSSecurityException;
  +
  +    /**
  +     * Gets the Keystore that was loaded by the underlying implementation
  +     *
  +     * @return the Keystore
  +     */
  +    public KeyStore getKeyStore();
  +
  +    /**
  +     * Gets the CertificateFactory instantiated by the underlying implementation
  +     *
  +     * @return the CertificateFactory
  +     * @throws WSSecurityException
  +     */
  +    public CertificateFactory getCertificateFactory() throws WSSecurityException;
   
   }
  
  
  
  1.14      +7 -2      ws-fx/wss4j/src/org/apache/ws/security/components/crypto/Merlin.java
  
  Index: Merlin.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/components/crypto/Merlin.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Merlin.java	12 Apr 2004 15:52:58 -0000	1.13
  +++ Merlin.java	16 Apr 2004 03:30:38 -0000	1.14
  @@ -60,7 +60,7 @@
   public class Merlin implements Crypto {
       private static Log log = LogFactory.getLog(Merlin.class);
       private static CertificateFactory certFact;
  -    private Properties properties = null;
  +    protected Properties properties = null;
       protected KeyStore keystore = null;
   
       /**
  @@ -125,7 +125,7 @@
        * 			X509 certficates
        * @throws	WSSecurityException
        */
  -    private static synchronized CertificateFactory getCertificateFactory() throws WSSecurityException {
  +    public synchronized CertificateFactory getCertificateFactory() throws WSSecurityException {
           if (certFact == null) {
   			try {
   				certFact = CertificateFactory.getInstance("X.509","BC");
  @@ -591,5 +591,10 @@
   		*/
   		return abyte0;
   	}
  +
  +    public KeyStore getKeyStore()
  +    {
  +        return this.keystore;
  +    }
   }