Index: pkgdata/pkg_data_src.gpt.in =================================================================== RCS file: /home/globdev/CVS/globus-packages/gsi/cert_utils/source/pkgdata/pkg_data_src.gpt.in,v retrieving revision 1.48.6.7 diff -u -r1.48.6.7 pkg_data_src.gpt.in --- pkgdata/pkg_data_src.gpt.in 3 Dec 2007 17:12:22 -0000 1.48.6.7 +++ pkgdata/pkg_data_src.gpt.in 1 Oct 2008 13:17:13 -0000 @@ -3,7 +3,7 @@ - + Globus GSI Cert Utils Library Security Index: programs/grid-cert-info.in =================================================================== RCS file: /home/globdev/CVS/globus-packages/gsi/cert_utils/source/programs/grid-cert-info.in,v retrieving revision 1.9.4.1 diff -u -r1.9.4.1 grid-cert-info.in --- programs/grid-cert-info.in 3 Dec 2007 17:12:23 -0000 1.9.4.1 +++ programs/grid-cert-info.in 1 Oct 2008 13:17:13 -0000 @@ -89,6 +89,27 @@ fi } +certificate_format() +{ + testfile="$1" + _format='' + + if test "$testfile" = ""; then + : + elif echo "$certfile" | grep '\.p12$' > /dev/null 2>&1 ; then + _format=pkcs12 + elif echo "$certfile" | grep '\.pem$' > /dev/null 2>&1 ; then + _format=x509 + elif grep -- '-----BEGIN' "$testfile" > /dev/null 2>&1 ; then + _format="x509" + else + : + fi + + echo $_format +} + + globus_source $libexecdir/globus-args-parser-header $@ @@ -141,16 +162,10 @@ shift done -if test "$certfile" = ""; then +cert_format=`certificate_format "$certfile"` +if test "$cert_format" = ""; then echo "Error: Cannot locate certificate" 1>&2 exit 1; -elif echo "$certfile" | grep '\.p12' > /dev/null 2>&1 ; then - cert_format=pkcs12 -elif echo "$certfile" | grep '\.pem' > /dev/null 2>&1 ; then - cert_format=x509 -else - echo "Error: certificate file \"$certfile\" is not .pem or .p12" 1>&2 - exit 1; fi if [ "X$toprint" = "X" ]; then