]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/parseCert/parseCert.cpp
2 * parseCert.cpp - CL-based cert parser.
4 * See oidParser.h for info on config file.
6 #include <security_cdsa_utils/cuPrintCert.h>
7 #include <security_cdsa_utils/cuFileIo.h>
12 static void usage(char **argv
)
14 printf("Usage: %s certFile [v(erbose) [l(oop)]\n", argv
[0]);
18 int main(int argc
, char **argv
)
20 unsigned char *rawCert
= NULL
;
23 CSSM_BOOL verbose
= CSSM_FALSE
;
30 for(arg
=2; arg
<argc
; arg
++) {
31 switch(argv
[arg
][0]) {
42 rtn
= readFile(argv
[1], &rawCert
, &rawCertSize
);
44 printf("Error reading %s; %s\n", argv
[1], strerror(rtn
));
48 printCert(rawCert
, rawCertSize
, verbose
);
50 printf("Enter q to quit, anything else to continue: ");