]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/importExport/importExportECDSA_P12_Tool
3 # Run one iteration of ECDSA/PKC12 portion of import/export tests.
4 # Only used as a subroutine call from importExportECDSA_P12.
7 # importExportECDSA_P12_Tool pfxFile clean(YES|NO) quiet(YES|NO)
9 if ( $#argv != 3 ) then
17 if ($QUIET == YES
) then
24 set PFX_PASSWORD
=password
25 set KEYBASE
=${BUILD_DIR}/ecdsaP12
26 set PRIV_KEY
=${KEYBASE}_priv.der
27 set PUB_KEY
=${KEYBASE}_pub.der
28 set CERT_PEM
=${BUILD_DIR}/ecdsa_certs.pem
29 set CERT_DER
=${BUILD_DIR}/ecdsa_certs.der
30 set PLAINTEXT
=somePlainText
31 set SIGFILE
=${BUILD_DIR}/ecdsasig
34 if ($QUIET == NO
) then
39 # import the p12 - No ACL, extractable in the clear
40 set cmd
="$KCIMPORT $PFX -k $KEYCHAIN -z $PFX_PASSWORD -t agg -f pkcs12 -n -e $QUIET_ARG"
41 if ($QUIET == NO
) then
46 # export key to clear OpenSSL form
47 set cmd
="$KCEXPORT $KEYCHAIN -t privKeys -f openssl -o $PRIV_KEY $QUIET_ARG"
48 if ($QUIET == NO
) then
54 set cmd
="$KCEXPORT $KEYCHAIN -t certs -o $CERT_PEM -f pemseq $QUIET_ARG"
55 if ($QUIET == NO
) then
61 set cmd
="$PEMTOOL d $CERT_PEM $CERT_DER $QUIET_FLAG"
62 if ($QUIET == NO
) then
67 # extract pub key from cert
68 set cmd
="$KEY_FROM_CERT $QUIET_ARG $CERT_DER $PUB_KEY"
69 if ($QUIET == NO
) then
75 set cmd
="$RSATOOL s a=e v=o k=$KEYBASE p=$PLAINTEXT s=$SIGFILE $QUIET_FLAG"
76 if ($QUIET == NO
) then
82 set cmd
="$RSATOOL v a=e k=$KEYBASE p=$PLAINTEXT s=$SIGFILE $QUIET_FLAG"
83 if ($QUIET == NO
) then
88 if($CLEAN == YES
) then
89 set cmd
="rm -f $PRIV_KEY $PUB_KEY $CERT_PEM $CERT_DER $SIGFILE"
90 if ($QUIET == NO
) then