Inline CRLs in the metadata are now honored during pkix validation. Junit tests...
[java-idp.git] / bin / extkeytool
index 9b6689c..2a070e2 100755 (executable)
@@ -1,8 +1,57 @@
 #!/bin/sh
 
-if [ -n JAVA_HOME ]
-       then
-               $JAVA_HOME/bin/java -cp ../dist/shib-util.jar:../lib/log4j-1.2.5.jar edu.internet2.middleware.shibboleth.utils.ExtKeyTool $@
-       else
-               echo "JAVA_HOME not set."
+##We need a JVM
+if [ ! -n "$JAVA_HOME" ] ; then
+  echo "Error: JAVA_HOME is not defined."
+  exit
 fi
+
+if [ ! -n "$JAVACMD" ] ; then
+  JAVACMD=$JAVA_HOME/bin/java
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+  echo "Error: JAVA_HOME is not defined correctly."
+  echo "Cannot execute $JAVACMD"
+  exit
+fi
+
+
+##Find the shibboleth components
+if [ ! -n "$SHIB_HOME" ] ; then
+  echo "Error: SHIB_HOME is not defined."
+  exit
+fi
+
+## Where log4j config file is
+LOG_CONFIG=$SHIB_HOME/conf/log4j.properties
+
+if [ ! \( -f "$SHIB_HOME/lib/shib-util.jar" -a -r "$SHIB_HOME/lib/shib-util.jar" \) ] ; then
+  echo "Error: Cannot find the shibboleth jar (shib-util.jar)."
+  echo "       If you downloaded the shibboleth source, you need to run \"ant build-util\""
+  exit
+fi
+
+
+##Grab all the dependencies
+if [ -n "$CLASSPATH" ] ; then
+  SHIB_UTIL_CLASSPATH=$CLASSPATH
+fi
+
+DIRLIBS=${SHIB_HOME}/lib/*.jar
+for i in ${DIRLIBS}
+do
+    # if the directory is empty, then it will return the input string
+    # this is stupid, so case for it
+    if [ "$i" != "${DIRLIBS}" ] ; then
+      if [ -z "$SHIB_UTIL_CLASSPATH" ] ; then
+        SHIB_UTIL_CLASSPATH=$i
+      else
+        SHIB_UTIL_CLASSPATH="$i":$SHIB_UTIL_CLASSPATH
+      fi
+    fi
+done
+SHIB_UTIL_CLASSPATH=$SHIB_UTIL_CLASSPATH:"$SHIB_HOME"
+
+##Here we go
+$JAVACMD -Dlog4j.configuration="$LOG_CONFIG" -cp $SHIB_UTIL_CLASSPATH  edu.internet2.middleware.shibboleth.utils.ExtKeyTool "$@"