]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/importExport/importExportPkcs8Tool
3 # Run one iteration of PKCS8 portion of import/export tests.
4 # Only used as a subroutine call from importExportPkcs8.
7 # importExportPkcs8Tool rawKey p8key keychain pbe_vers pbe_alg keyAlg keySize quiet(YES|NO) noACL(YES|NO) p8Format(PEM|DER) securePhrase(YES|NO)
9 if ( $#argv != 11 ) then
21 if ($QUIET == YES
) then
25 if ($argv[9] == YES
) then
29 set SECURE_PHRASE_ARG
=
30 if ($argv[11] == YES
) then
31 set SECURE_PHRASE_ARG
=-Z
37 set OS_PWD_ARG
="-passout pass:$PASSWORD"
40 # convert raw private key to specified P8 form using openssl
42 set cmd
="$RM -f $P8KEY"
43 if ($QUIET == NO
) then
47 set cmd
="$OPENSSL pkcs8 -topk8 -inform PEM -outform $FORMAT -in $RAWKEY -out $P8KEY $OS_PWD_ARG $PBE_VERS $PBE_ALG"
48 if ($QUIET == NO
) then
54 if ($QUIET == NO
) then
60 set cmd
="$KCIMPORT $P8KEY -k $KEYCHAIN -z $PASSWORD -f pkcs8 -K 1 $QUIET_ARG $NOACL_ARG $SECURE_PHRASE_ARG"
61 if ($QUIET == NO
) then
66 # verify by examining the keychain
67 set cmd
="$DBVERIFY $KEYCHAIN_PATH $KEY_ALG priv $KEY_SIZE $QUIET_ARG"
68 if ($QUIET == NO
) then