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 Dittmann Werner <we...@siemens.com> on 2004/03/17 09:47:27 UTC

AW: cvs commit: ws-fx/wss4j/test/interop TestInteropKeys.java Pac kageTests.java

All,

using that setup (one jks for both certs)
works with JDK 1.4.2_03-b02. According to
the bug parade a bug fix was accouned for
JDK 1.4.2_02. Thus I re-tested with above
version.

Regards,
Werner

> -----Ursprüngliche Nachricht-----
> Von: dims@apache.org [mailto:dims@apache.org] 
> Gesendet: Montag, 15. März 2004 18:15
> An: ws-fx-cvs@apache.org
> Betreff: cvs commit: ws-fx/wss4j/test/interop 
> TestInteropKeys.java PackageTests.java
> 
> 
> dims        2004/03/15 09:15:15
> 
>   Modified:    wss4j    build.xml
>                wss4j/interop wsstest1.properties wsstest2.properties
>                wss4j/interop/org/apache/ws/axis/oasis PWCallback1.java
>                wss4j/src/org/apache/ws/security/components/crypto
>                         Merlin.java
>                wss4j/test/interop PackageTests.java
>   Added:       wss4j/interop interop.jks
>                wss4j/test/interop TestInteropKeys.java
>   Log:
>   Use one jks store for both certs. Interop tests works witk 
> JDK1.5Beta ONLY. JDK1.4.2 has a bug that prevents loading the 
> keystore.
>   
>   Revision  Changes    Path
>   1.6       +8 -2      ws-fx/wss4j/build.xml
>   
>   Index: build.xml
>   ===================================================================
>   RCS file: /home/cvs/ws-fx/wss4j/build.xml,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- build.xml	10 Mar 2004 20:36:40 -0000	1.5
>   +++ build.xml	15 Mar 2004 17:15:15 -0000	1.6
>   @@ -254,6 +254,11 @@
>                <classpath refid="classpath.test"/>
>            </available>
>    
>   +        <available property="jdk15.present" 
> classname="java.lang.instrument.Instrumentation">
>   +            <!-- check whether JDK15 is available -->
>   +            <classpath refid="classpath.test"/>
>   +        </available>
>   +
>            <available property="bc.present" 
> classname="org.bouncycastle.jce.provider.BouncyCastleProvider">
>                <!-- check whether BouncyCastle is available -->
>                <classpath refid="classpath.test"/>
>   @@ -262,6 +267,7 @@
>            <echo message="--- Flags (Note: If the {property 
> name} is displayed, "/>
>            <echo message="           then the component is 
> not present)"/>
>            <echo message="jdk14.present=${jdk14.present}"/>
>   +        <echo message="jdk15.present=${jdk15.present}"/>
>            <echo message="bc.present=${bc.present}"/>
>    
>        </target>
>   @@ -399,7 +405,7 @@
>            </java>
>        </target>
>    
>   -    <target name="interopTests" depends="init">
>   +    <target name="interopTests" depends="init" if="jdk15.present">
>            <echo message="Running system tests - BEGIN..."/>
>    
>            <path id="deploy.xml.files">
>   @@ -417,7 +423,7 @@
>                <fileset dir="${dir.keys}" includes="**"/>
>            </copy>
>            <copy todir="${build.dir}/interop">
>   -            <fileset dir="${dir.interop}" includes="*.pfx"/>
>   +            <fileset dir="${dir.interop}" includes="*.jks"/>
>            </copy>
>            
>            <property name="deploy.xml.property" 
> refid="deploy.xml.files"/>
>   
>   
>   
>   1.3       +3 -4      ws-fx/wss4j/interop/wsstest1.properties
>   
>   Index: wsstest1.properties
>   ===================================================================
>   RCS file: /home/cvs/ws-fx/wss4j/interop/wsstest1.properties,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- wsstest1.properties	10 Mar 2004 20:36:40 -0000	1.2
>   +++ wsstest1.properties	15 Mar 2004 17:15:15 -0000	1.3
>   @@ -1,6 +1,5 @@
>    
> org.apache.ws.security.crypto.provider=org.apache.ws.security.
> components.crypto.Merlin
>   -org.apache.ws.security.crypto.merlin.keystore.type=pkcs12
>   -org.apache.ws.security.crypto.merlin.keystore.provider=BC
>   -org.apache.ws.security.crypto.merlin.keystore.password=xyz
>   +org.apache.ws.security.crypto.merlin.keystore.type=jks
>   +org.apache.ws.security.crypto.merlin.keystore.password=interop
>    
> org.apache.ws.security.crypto.merlin.keystore.alias=7706c71b06
> 28d6ecc85ea1e8ad62be60_a8272f6f-2c94-436e-aa71-d8d2be4647f6
>   -org.apache.ws.security.crypto.merlin.file=interop/WSSTest1.pfx
>   +org.apache.ws.security.crypto.merlin.file=interop/interop.jks
>   
>   
>   
>   1.3       +4 -4      ws-fx/wss4j/interop/wsstest2.properties
>   
>   Index: wsstest2.properties
>   ===================================================================
>   RCS file: /home/cvs/ws-fx/wss4j/interop/wsstest2.properties,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- wsstest2.properties	10 Mar 2004 20:36:40 -0000	1.2
>   +++ wsstest2.properties	15 Mar 2004 17:15:15 -0000	1.3
>   @@ -1,6 +1,6 @@
>    
> org.apache.ws.security.crypto.provider=org.apache.ws.security.
> components.crypto.Merlin
>   -org.apache.ws.security.crypto.merlin.keystore.type=pkcs12
>   -org.apache.ws.security.crypto.merlin.keystore.provider=BC
>   -org.apache.ws.security.crypto.merlin.keystore.password=xyz
>   +org.apache.ws.security.crypto.merlin.keystore.type=jks
>   +org.apache.ws.security.crypto.merlin.keystore.password=interop
>    
> org.apache.ws.security.crypto.merlin.keystore.alias=86ab6c4828
> bcde6983d81b2b59ff426c_a8272f6f-2c94-436e-aa71-d8d2be4647f6
>   -org.apache.ws.security.crypto.merlin.file=interop/WSSTest2.pfx
>   +org.apache.ws.security.crypto.merlin.file=interop/interop.jks
>   +
>   
>   
>   
>   1.1                  ws-fx/wss4j/interop/interop.jks
>   
>   	<<Binary file>>
>   
>   
>   1.2       +4 -0      
> ws-fx/wss4j/interop/org/apache/ws/axis/oasis/PWCallback1.java
>   
>   Index: PWCallback1.java
>   ===================================================================
>   RCS file: 
> /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/PWCallb
> ack1.java,v
>   retrieving revision 1.1
>   retrieving revision 1.2
>   diff -u -r1.1 -r1.2
>   --- PWCallback1.java	8 Mar 2004 16:05:06 -0000	1.1
>   +++ PWCallback1.java	15 Mar 2004 17:15:15 -0000	1.2
>   @@ -68,6 +68,10 @@
>                     */
>                    if (pc.getUsage() == WSPasswordCallback.KEY_NAME) {
>                        pc.setKey(key);
>   +                } else 
> if(pc.getIdentifer().equals("7706c71b0628d6ecc85ea1e8ad62be60_
> a8272f6f-2c94-436e-aa71-d8d2be4647f6")) {
>   +                    pc.setPassword("interop");
>   +                } else 
> if(pc.getIdentifer().equals("86ab6c4828bcde6983d81b2b59ff426c_
> a8272f6f-2c94-436e-aa71-d8d2be4647f6")) {
>   +                    pc.setPassword("interop");
>                    } else {
>                        pc.setPassword("sirhC");
>                    }
>   
>   
>   
>   1.9       +5 -1      
> 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/cr
> ypto/Merlin.java,v
>   retrieving revision 1.8
>   retrieving revision 1.9
>   diff -u -r1.8 -r1.9
>   --- Merlin.java	15 Mar 2004 13:30:14 -0000	1.8
>   +++ Merlin.java	15 Mar 2004 17:15:15 -0000	1.9
>   @@ -81,7 +81,11 @@
>            } catch (Exception e) {
>                throw new CredentialException(3, 
> "proxyNotFound", new Object[]{getProxyKeyStore(this.properties)});
>            }
>   -        load(is);
>   +        try {
>   +            load(is);
>   +        } finally {
>   +            is.close();
>   +        }
>        }
>    
>        /**
>   
>   
>   
>   1.3       +1 -0      ws-fx/wss4j/test/interop/PackageTests.java
>   
>   Index: PackageTests.java
>   ===================================================================
>   RCS file: /home/cvs/ws-fx/wss4j/test/interop/PackageTests.java,v
>   retrieving revision 1.2
>   retrieving revision 1.3
>   diff -u -r1.2 -r1.3
>   --- PackageTests.java	11 Mar 2004 22:16:47 -0000	1.2
>   +++ PackageTests.java	15 Mar 2004 17:15:15 -0000	1.3
>   @@ -49,6 +49,7 @@
>    
>        public static Test suite() {
>            TestSuite suite = new TestSuite();
>   +        suite.addTestSuite(TestInteropKeys.class);
>            suite.addTestSuite(TestScenario1.class);
>            suite.addTestSuite(TestScenario2.class);
>            suite.addTestSuite(TestScenario3.class);
>   
>   
>   
>   1.1                  ws-fx/wss4j/test/interop/TestInteropKeys.java
>   
>   Index: TestInteropKeys.java
>   ===================================================================
>   package interop;
>   
>   import junit.framework.TestCase;
>   import junit.framework.Test;
>   import junit.framework.TestSuite;
>   import org.apache.ws.security.components.crypto.Crypto;
>   import org.apache.ws.security.components.crypto.CryptoFactory;
>   
>   import java.security.cert.X509Certificate;
>   import java.security.PrivateKey;
>   
>   /**
>    * Created by IntelliJ IDEA.
>    * User: srida01
>    * Date: Mar 15, 2004
>    * Time: 10:47:59 AM
>    * To change this template use File | Settings | File Templates.
>    */
>   public class TestInteropKeys extends TestCase {
>       /**
>        * TestScenario1 constructor
>        * <p/>
>        * 
>        * @param name name of the test
>        */
>       public TestInteropKeys(String name) {
>           super(name);
>       }
>   
>       /**
>        * JUnit suite
>        * <p/>
>        * 
>        * @return a junit test suite
>        */
>       public static Test suite() {
>           return new TestSuite(TestInteropKeys.class);
>       }
>   
>       public void testInteropKeys1() throws Exception {
>           Crypto c = CryptoFactory.getInstance("wsstest1.properties");
>           X509Certificate[] certs = 
> c.getCertificates("7706c71b0628d6ecc85ea1e8ad62be60_a8272f6f-2
c94-436e-aa71-d8d2be4647f6");
>           assertTrue(certs != null);
>           assertTrue(certs[0] != null);
>           PrivateKey privKey = 
> c.getPrivateKey("7706c71b0628d6ecc85ea1e8ad62be60_a8272f6f-2c9
4-436e-aa71-d8d2be4647f6","interop");
>           assertTrue(privKey != null);
>       }
>   
>       public void testInteropKeys2() throws Exception {
>           Crypto c = CryptoFactory.getInstance("wsstest2.properties");
>           X509Certificate[] certs = 
> c.getCertificates("86ab6c4828bcde6983d81b2b59ff426c_a8272f6f-2
c94-436e-aa71-d8d2be4647f6");
>           assertTrue(certs != null);
>           assertTrue(certs[0] != null);
>           PrivateKey privKey = 
> c.getPrivateKey("86ab6c4828bcde6983d81b2b59ff426c_a8272f6f-2c9
4-436e-aa71-d8d2be4647f6","interop");
>           assertTrue(privKey != null);
>       }
>   }
>   
>   
>   
> 

Re: AW: cvs commit: ws-fx/wss4j/test/interop TestInteropKeys.java Pac kageTests.java

Posted by Davanum Srinivas <di...@apache.org>.
thanks for checking up on this. will fix build.xml

thanks,
dims

--- Dittmann Werner <we...@siemens.com> wrote:
> All,
> 
> using that setup (one jks for both certs)
> works with JDK 1.4.2_03-b02. According to
> the bug parade a bug fix was accouned for
> JDK 1.4.2_02. Thus I re-tested with above
> version.
> 
> Regards,
> Werner
> 
> > -----Urspr�ngliche Nachricht-----
> > Von: dims@apache.org [mailto:dims@apache.org] 
> > Gesendet: Montag, 15. M�rz 2004 18:15
> > An: ws-fx-cvs@apache.org
> > Betreff: cvs commit: ws-fx/wss4j/test/interop 
> > TestInteropKeys.java PackageTests.java
> > 
> > 
> > dims        2004/03/15 09:15:15
> > 
> >   Modified:    wss4j    build.xml
> >                wss4j/interop wsstest1.properties wsstest2.properties
> >                wss4j/interop/org/apache/ws/axis/oasis PWCallback1.java
> >                wss4j/src/org/apache/ws/security/components/crypto
> >                         Merlin.java
> >                wss4j/test/interop PackageTests.java
> >   Added:       wss4j/interop interop.jks
> >                wss4j/test/interop TestInteropKeys.java
> >   Log:
> >   Use one jks store for both certs. Interop tests works witk 
> > JDK1.5Beta ONLY. JDK1.4.2 has a bug that prevents loading the 
> > keystore.
> >   
> >   Revision  Changes    Path
> >   1.6       +8 -2      ws-fx/wss4j/build.xml
> >   
> >   Index: build.xml
> >   ===================================================================
> >   RCS file: /home/cvs/ws-fx/wss4j/build.xml,v
> >   retrieving revision 1.5
> >   retrieving revision 1.6
> >   diff -u -r1.5 -r1.6
> >   --- build.xml	10 Mar 2004 20:36:40 -0000	1.5
> >   +++ build.xml	15 Mar 2004 17:15:15 -0000	1.6
> >   @@ -254,6 +254,11 @@
> >                <classpath refid="classpath.test"/>
> >            </available>
> >    
> >   +        <available property="jdk15.present" 
> > classname="java.lang.instrument.Instrumentation">
> >   +            <!-- check whether JDK15 is available -->
> >   +            <classpath refid="classpath.test"/>
> >   +        </available>
> >   +
> >            <available property="bc.present" 
> > classname="org.bouncycastle.jce.provider.BouncyCastleProvider">
> >                <!-- check whether BouncyCastle is available -->
> >                <classpath refid="classpath.test"/>
> >   @@ -262,6 +267,7 @@
> >            <echo message="--- Flags (Note: If the {property 
> > name} is displayed, "/>
> >            <echo message="           then the component is 
> > not present)"/>
> >            <echo message="jdk14.present=${jdk14.present}"/>
> >   +        <echo message="jdk15.present=${jdk15.present}"/>
> >            <echo message="bc.present=${bc.present}"/>
> >    
> >        </target>
> >   @@ -399,7 +405,7 @@
> >            </java>
> >        </target>
> >    
> >   -    <target name="interopTests" depends="init">
> >   +    <target name="interopTests" depends="init" if="jdk15.present">
> >            <echo message="Running system tests - BEGIN..."/>
> >    
> >            <path id="deploy.xml.files">
> >   @@ -417,7 +423,7 @@
> >                <fileset dir="${dir.keys}" includes="**"/>
> >            </copy>
> >            <copy todir="${build.dir}/interop">
> >   -            <fileset dir="${dir.interop}" includes="*.pfx"/>
> >   +            <fileset dir="${dir.interop}" includes="*.jks"/>
> >            </copy>
> >            
> >            <property name="deploy.xml.property" 
> > refid="deploy.xml.files"/>
> >   
> >   
> >   
> >   1.3       +3 -4      ws-fx/wss4j/interop/wsstest1.properties
> >   
> >   Index: wsstest1.properties
> >   ===================================================================
> >   RCS file: /home/cvs/ws-fx/wss4j/interop/wsstest1.properties,v
> >   retrieving revision 1.2
> >   retrieving revision 1.3
> >   diff -u -r1.2 -r1.3
> >   --- wsstest1.properties	10 Mar 2004 20:36:40 -0000	1.2
> >   +++ wsstest1.properties	15 Mar 2004 17:15:15 -0000	1.3
> >   @@ -1,6 +1,5 @@
> >    
> > org.apache.ws.security.crypto.provider=org.apache.ws.security.
> > components.crypto.Merlin
> >   -org.apache.ws.security.crypto.merlin.keystore.type=pkcs12
> >   -org.apache.ws.security.crypto.merlin.keystore.provider=BC
> >   -org.apache.ws.security.crypto.merlin.keystore.password=xyz
> >   +org.apache.ws.security.crypto.merlin.keystore.type=jks
> >   +org.apache.ws.security.crypto.merlin.keystore.password=interop
> >    
> > org.apache.ws.security.crypto.merlin.keystore.alias=7706c71b06
> > 28d6ecc85ea1e8ad62be60_a8272f6f-2c94-436e-aa71-d8d2be4647f6
> >   -org.apache.ws.security.crypto.merlin.file=interop/WSSTest1.pfx
> >   +org.apache.ws.security.crypto.merlin.file=interop/interop.jks
> >   
> >   
> >   
> >   1.3       +4 -4      ws-fx/wss4j/interop/wsstest2.properties
> >   
> >   Index: wsstest2.properties
> >   ===================================================================
> >   RCS file: /home/cvs/ws-fx/wss4j/interop/wsstest2.properties,v
> >   retrieving revision 1.2
> >   retrieving revision 1.3
> >   diff -u -r1.2 -r1.3
> >   --- wsstest2.properties	10 Mar 2004 20:36:40 -0000	1.2
> >   +++ wsstest2.properties	15 Mar 2004 17:15:15 -0000	1.3
> >   @@ -1,6 +1,6 @@
> >    
> > org.apache.ws.security.crypto.provider=org.apache.ws.security.
> > components.crypto.Merlin
> >   -org.apache.ws.security.crypto.merlin.keystore.type=pkcs12
> >   -org.apache.ws.security.crypto.merlin.keystore.provider=BC
> >   -org.apache.ws.security.crypto.merlin.keystore.password=xyz
> >   +org.apache.ws.security.crypto.merlin.keystore.type=jks
> >   +org.apache.ws.security.crypto.merlin.keystore.password=interop
> >    
> > org.apache.ws.security.crypto.merlin.keystore.alias=86ab6c4828
> > bcde6983d81b2b59ff426c_a8272f6f-2c94-436e-aa71-d8d2be4647f6
> >   -org.apache.ws.security.crypto.merlin.file=interop/WSSTest2.pfx
> >   +org.apache.ws.security.crypto.merlin.file=interop/interop.jks
> >   +
> >   
> >   
> >   
> >   1.1                  ws-fx/wss4j/interop/interop.jks
> >   
> >   	<<Binary file>>
> >   
> >   
> >   1.2       +4 -0      
> > ws-fx/wss4j/interop/org/apache/ws/axis/oasis/PWCallback1.java
> >   
> >   Index: PWCallback1.java
> >   ===================================================================
> >   RCS file: 
> > /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/PWCallb
> > ack1.java,v
> >   retrieving revision 1.1
> >   retrieving revision 1.2
> >   diff -u -r1.1 -r1.2
> >   --- PWCallback1.java	8 Mar 2004 16:05:06 -0000	1.1
> >   +++ PWCallback1.java	15 Mar 2004 17:15:15 -0000	1.2
> >   @@ -68,6 +68,10 @@
> >                     */
> >                    if (pc.getUsage() == WSPasswordCallback.KEY_NAME) {
> >                        pc.setKey(key);
> >   +                } else 
> > if(pc.getIdentifer().equals("7706c71b0628d6ecc85ea1e8ad62be60_
> > a8272f6f-2c94-436e-aa71-d8d2be4647f6")) {
> >   +                    pc.setPassword("interop");
> >   +                } else 
> > if(pc.getIdentifer().equals("86ab6c4828bcde6983d81b2b59ff426c_
> > a8272f6f-2c94-436e-aa71-d8d2be4647f6")) {
> >   +                    pc.setPassword("interop");
> >                    } else {
> >                        pc.setPassword("sirhC");
> >                    }
> >   
> >   
> >   
> >   1.9       +5 -1      
> > 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/cr
> > ypto/Merlin.java,v
> >   retrieving revision 1.8
> >   retrieving revision 1.9
> >   diff -u -r1.8 -r1.9
> >   --- Merlin.java	15 Mar 2004 13:30:14 -0000	1.8
> >   +++ Merlin.java	15 Mar 2004 17:15:15 -0000	1.9
> >   @@ -81,7 +81,11 @@
> >            } catch (Exception e) {
> >                throw new CredentialException(3, 
> > "proxyNotFound", new Object[]{getProxyKeyStore(this.properties)});
> >            }
> >   -        load(is);
> 
=== message truncated ===


=====
Davanum Srinivas - http://webservices.apache.org/~dims/