]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/certInCrl/certInCrl.cpp
2 * certInCrl.c - simple "see if cert is in CRL"
4 #include <security_cdsa_utils/cuFileIo.h>
5 #include <utilLib/common.h>
6 #include <clAppUtils/clutils.h>
10 #include <Security/cssm.h>
12 static void usage(char **argv
)
14 printf("Usage: %s certFile crlFile [l=loops]\n", argv
[0]);
18 int main(int argc
, char **argv
)
23 CSSM_CL_HANDLE clHand
;
32 for(arg
=3; arg
<argc
; arg
++) {
33 switch(argv
[arg
][0]) {
35 loops
= atoi(&argv
[arg
][2]);
42 rtn
= readFile(argv
[1], &cert
.Data
, &len
);
44 printf("Error reading %s; %s\n", argv
[1], strerror(rtn
));
48 rtn
= readFile(argv
[2], &crl
.Data
, &len
);
50 printf("Error reading %s; %s\n", argv
[1], strerror(rtn
));
56 if(clHand
== CSSM_INVALID_HANDLE
) {
60 for(loop
=0; loop
<loops
; loop
++) {
61 crtn
= CSSM_CL_IsCertInCrl(
67 printError("CSSM_CL_IsCertInCrl", crtn
);
71 printf("CertFound TRUE\n");
74 printf("CertFound FALSE\n");
78 printf("CR to continue, q to quit: ");