3 # Run import/export tests for PKCS7.
5 # Run this from SecurityTests/clxutils/importExport. The
6 # kcImport and kcExport programs must exist in the location
7 # specified by the LOCAL_BUILD_DIR env var.
13 set PKCS7_FILE
=${BUILD_DIR}/certs.p7r
14 set PKCS7_FILE_PEM
=${PKCS7_FILE}.pem
16 # user specified variables
24 # Verify existence of a few crucial things before we start.
26 if( ( ! -e $KCIMPORT ) || \
27 ( ! -e $KCEXPORT ) || \
28 ( ! -e $RSATOOL) ) then
29 echo === You
do not seem to have all of the required executables.
30 echo === Please build all of cspxutils and clxutils.
31 echo === See the README files
in those directories
for info.
53 echo Usage
: importExportPkcs7 \
[q\
(uiet\
)\
] \
[n\
(oACL\
)\
] \
[N\
(oClean\
)\
]
58 echo === Begin PKCS7
test ====
59 if ($QUIET == NO
) then
63 if ($QUIET == NO
) then
64 echo Creating PKCS7 DER blob with openssl...
66 set cmd
="$OPENSSL crl2pkcs7 -outform DER -nocrl -certfile cdnow_v300.pem -certfile amazon_v3.100.pem -certfile localcert.pem -out $PKCS7_FILE"
67 if ($QUIET == NO
) then
71 if ($QUIET == NO
) then
72 echo Importing result...
74 set cmd
="$KCIMPORT $PKCS7_FILE -k $KEYCHAIN -C 3 -K 0 -I 0 -T agg -F pkcs7 -q $NOACL_ARG"
75 if ($QUIET == NO
) then
80 if ($QUIET == NO
) then
81 echo Creating PKCS7 PEM blob with openssl...
83 set cmd
="$OPENSSL crl2pkcs7 -outform PEM -nocrl -certfile cdnow_v300.pem -certfile amazon_v3.100.pem -certfile localcert.pem -out $PKCS7_FILE_PEM"
84 if ($QUIET == NO
) then
88 if ($QUIET == NO
) then
89 echo Importing result...
93 set cmd
="$KCIMPORT $PKCS7_FILE_PEM -f pkcs7 -k $KEYCHAIN -C 3 -K 0 -I 0 -T agg -F pkcs7 -q $NOACL_ARG"
94 if ($QUIET == NO
) then
99 if ($QUIET == NO
) then
100 echo Exporting PKCS7 PEM blob...
102 set cmd
="$RM $PKCS7_FILE_PEM $PKCS7_FILE"
103 if ($QUIET == NO
) then
107 set cmd
="$KCEXPORT $KEYCHAIN -t all -f pkcs7 -o $PKCS7_FILE -q"
108 if ($QUIET == NO
) then
112 if ($QUIET == NO
) then
113 echo Importing result...
117 set cmd
="$KCIMPORT $PKCS7_FILE -k $KEYCHAIN -C 3 -K 0 -I 0 -T agg -F pkcs7 -q $NOACL_ARG"
118 if ($QUIET == NO
) then
124 if($NOCLEAN == NO
) then
125 set cmd
="rm -f $PKCS7_FILE $PKCS7_FILE_PEM"
126 if ($QUIET == NO
) then
132 if ($QUIET == NO
) then
133 echo === PKCS7
test complete
===