3 # Build a new X509Anchors or X509Certificates file from all of the certs in
6 if ( $#argv != 2 ) then
7 echo Usage
: buildX509Anchors anchors\
|certs anchor_dir
11 set KCDIR
=/System
/Library
/Keychains
13 set SECTOOL
=/usr
/bin
/security
17 set KCFILE
=$KCDIR/X509Anchors
18 set KCFILE_BACK
=$KCDIR/X509Anchors_old
19 set KC_PWD
=X509Anchors
22 set KCFILE
=$KCDIR/X509Certificates
23 set KCFILE_BACK
=$KCDIR/X509Certificates_old
24 set KC_PWD
=X509Certificates
27 echo Usage
: buildX509Anchors anchors\
|certs anchor_dir
31 if ( -e $KCFILE ) then
32 echo Saving old
$KCFILE...
33 set cmd
="rm -f $KCFILE_BACK"
36 set cmd
="mv $KCFILE $KCFILE_BACK"
40 echo Warning
: no existing
$KCFILE!
43 set cmd
="$SECTOOL create-keychain -p $KC_PWD $KCFILE"
46 set cmd
="cd $CERTSDIR"
50 if( ( -f "$i" ) && ( "$i" != X509Anchors
) ) then
51 set cmd
="$SECTOOL add-certificate -k $KCFILE $i"
53 $SECTOOL add
-certificate -k $KCFILE "$i" || exit(1)