Added generation of secret for Cyprto Handle to ant build.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 24 Feb 2003 23:31:20 +0000 (23:31 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Mon, 24 Feb 2003 23:31:20 +0000 (23:31 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@505 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

build.xml
src/edu/internet2/middleware/shibboleth/utils/HandleRepositorySecretGenerator.java

index 3749615..8aaa2a4 100755 (executable)
--- a/build.xml
+++ b/build.xml
@@ -5,16 +5,17 @@
     <!-- Set global properties for this build -->
     <property name="distname" value="shibboleth" />
     <property name="root" value="." />
     <!-- Set global properties for this build -->
     <property name="distname" value="shibboleth" />
     <property name="root" value="." />
-    <property name="src" value="${root}/src" />
-    <property name="approot" value="${root}/webApplication" />
-    <property name="configroot" value="${root}/webAppConfig" />
-    <property name="build" value="${approot}/WEB-INF/classes" />
-    <property name="libdir" value="${approot}/WEB-INF/lib" />
-    <property name="buildlibs" value="${root}/lib" />
-    <property name="distlibs" value="${root}/lib" />
-    <property name="dist" value="${root}/dist" />
-    <property name="docs" value="${root}/docs" />
-    <property name="javadocs" value="${docs}/api" />
+    <property name="src" value="${root}/src/" />
+    <property name="approot" value="${root}/webApplication/" />
+    <property name="appconfig" value="${src}/conf/" />
+    <property name="configroot" value="${root}/webAppConfig/" />
+    <property name="build" value="${approot}/WEB-INF/classes/" />
+    <property name="libdir" value="${approot}/WEB-INF/lib/" />
+    <property name="buildlibs" value="${root}/lib/" />
+    <property name="distlibs" value="${root}/lib/" />
+    <property name="dist" value="${root}/dist/" />
+    <property name="docs" value="${root}/docs/" />
+    <property name="javadocs" value="${docs}/api/" />
 
     <property name="year" value="2002"/>
     <property name="copyright" value="Copyright &#169; ${year} UCAID. All Rights Reserved."/>
 
     <property name="year" value="2002"/>
     <property name="copyright" value="Copyright &#169; ${year} UCAID. All Rights Reserved."/>
         </delete>
     </target>
 
         </delete>
     </target>
 
-    
     <!-- Run automated tests on compiled code -->
     <target name="test-all" depends="test-origin, test-wayf" />
     <target name="test-origin" depends="test-common">
     <!-- Run automated tests on compiled code -->
     <target name="test-all" depends="test-origin, test-wayf" />
     <target name="test-origin" depends="test-common">
     </target>
     <target name="test-wayf" depends="test-common" />
     <target name="test-common" depends="compile-all"/>
     </target>
     <target name="test-wayf" depends="test-common" />
     <target name="test-common" depends="compile-all"/>
+    
+       <target name="genSecret" depends="compile-all">
+       <taskdef name="genSecret" classname="edu.internet2.middleware.shibboleth.utils.HandleRepositorySecretGenerator" classpathref="build.path"/>
+               <genSecret keyStorePath="${appconfig}/handle.jks" keyStorePassword="shibhs" keyStoreKeyAlias="handleKey" keyStoreKeyPassword="shibhs" />
+       </target>
 
 </project>
 
 </project>
index 017b5ef..1746448 100755 (executable)
  
 package edu.internet2.middleware.shibboleth.utils;
 
  
 package edu.internet2.middleware.shibboleth.utils;
 
+import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.security.GeneralSecurityException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.security.GeneralSecurityException;
-import java.security.InvalidKeyException;
 import java.security.KeyStore;
 import java.security.KeyStore;
-import java.security.KeyStoreException;
-import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.security.SecureRandom;
-import java.security.cert.CertificateException;
-import java.security.spec.InvalidKeySpecException;
 
 import javax.crypto.SecretKey;
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.DESedeKeySpec;
 
 
 import javax.crypto.SecretKey;
 import javax.crypto.SecretKeyFactory;
 import javax.crypto.spec.DESedeKeySpec;
 
-import sun.misc.BASE64Encoder;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 
@@ -76,11 +71,10 @@ import org.apache.tools.ant.Task;
  */
 public class HandleRepositorySecretGenerator extends Task {
 
  */
 public class HandleRepositorySecretGenerator extends Task {
 
-       private String keyStorePath;
+       private File keyStorePath;
        private String keyStorePassword;
        private String keyStoreKeyAlias;
        private String keyStoreKeyPassword;
        private String keyStorePassword;
        private String keyStoreKeyAlias;
        private String keyStoreKeyPassword;
-
        public void execute() throws BuildException {
                try {
                        if (keyStorePath == null
        public void execute() throws BuildException {
                try {
                        if (keyStorePath == null
@@ -136,7 +130,7 @@ public class HandleRepositorySecretGenerator extends Task {
         * Sets the keyStorePath.
         * @param keyStorePath The keyStorePath to set
         */
         * Sets the keyStorePath.
         * @param keyStorePath The keyStorePath to set
         */
-       public void setKeyStorePath(String keyStorePath) {
+       public void setKeyStorePath(File keyStorePath) {
                this.keyStorePath = keyStorePath;
        }
 
                this.keyStorePath = keyStorePath;
        }