3 # Run one iteration of keypair portion of import/export tests.
4 # Only used as a subroutine call from importExport.
7 # importExportKeyTool pubKey privKey keychain format quiet(YES|NO) noACL(YES|NO) noClean(YES|NO)
9 if ( $#argv != 7 ) then
18 if ($argv[6] == YES
) then
23 set BUILD_DIR
=$LOCAL_BUILD_DIR
25 set TMP_PUB_KEY
=${BUILD_DIR}/tmpPubKey.der
26 set TMP_PRIV_KEY
=${BUILD_DIR}/tmpPrivKey.der
31 # import both keys into empty keychain, typed and untyped
33 if ($QUIET == NO
) then
34 echo Importing both keys into empty keychain
, explicit type
/format...
36 if ($QUIET == NO
) then
40 set cmd
="$KCIMPORT $PUBKEY -k $KEYCHAIN -t pub -f $FORMAT -K 1 -F $FORMAT -T pub -q"
41 if ($QUIET == NO
) then
45 set cmd
="$KCIMPORT $PRIVKEY -k $KEYCHAIN -e -t priv -f $FORMAT -F $FORMAT -T priv -q $NOACL_ARG"
46 if ($QUIET == NO
) then
51 if ($QUIET == NO
) then
52 echo Importing both keys into empty keychain
, unspecified type
/format...
54 if ($QUIET == NO
) then
58 set cmd
="$KCIMPORT $PUBKEY -k $KEYCHAIN -K 1 -F $FORMAT -T pub -q"
59 if ($QUIET == NO
) then
63 set cmd
="$KCIMPORT $PRIVKEY -k $KEYCHAIN -e -F $FORMAT -T priv -q $NOACL_ARG"
64 if ($QUIET == NO
) then
70 # export both keys into tmp files, compare to original
72 if ($QUIET == NO
) then
73 echo Exporting and verifying both keys
in $FORMAT format...
75 set cmd
="$KCEXPORT $KEYCHAIN -t pubKeys -f $FORMAT -o $TMP_PUB_KEY -q"
76 if ($QUIET == NO
) then
80 set cmd
="$KCEXPORT $KEYCHAIN -t privKeys -f $FORMAT -o $TMP_PRIV_KEY -q"
81 if ($QUIET == NO
) then
86 set cmd
="$CMP $PUBKEY $TMP_PUB_KEY"
87 if ($QUIET == NO
) then
91 if ($status != 0) then
92 echo Raw
$FORMAT public key differs after import
/export
95 set cmd
="$CMP $PRIVKEY $TMP_PRIV_KEY"
96 if ($QUIET == NO
) then
100 if ($status != 0) then
101 echo Raw
$FORMAT private key differs after import
/export
106 if($NOCLEAN == NO
) then
107 set cmd
="rm -f $TMP_PUB_KEY $TMP_PRIV_KEY"
108 if ($QUIET == NO
) then