]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/rootStoreTool/rootUtils.h
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / rootStoreTool / rootUtils.h
1 /*
2 * Copyright (c) 2005-2006 Apple Computer, Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24 /*
25 * rootUtils.h - utility routines for rootStoreTool
26 */
27
28 #ifndef _ROOT_UTILS_H_
29 #define _ROOT_UTILS_H_
30
31 #include <CoreFoundation/CoreFoundation.h>
32 #include <security_cdsa_utils/cuOidParser.h>
33 #include <Security/Security.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 void indentIncr(void);
40 void indentDecr(void);
41 void indent(void);
42
43 void printAscii(
44 const char *buf,
45 unsigned len,
46 unsigned maxLen);
47 void printHex(
48 const unsigned char *buf,
49 unsigned len,
50 unsigned maxLen);
51 void printOid(
52 const void *buf,
53 unsigned len,
54 OidParser &parser);
55
56 typedef enum {
57 PD_Hex,
58 PD_ASCII,
59 PD_OID
60 } PrintDataType;
61
62 void printData(
63 const char *label,
64 CFDataRef data,
65 PrintDataType whichType,
66 OidParser &parser);
67
68 /* print the contents of a CFString */
69 void printCfStr(
70 CFStringRef cfstr);
71
72 void printCFDate(
73 CFDateRef dateRef);
74
75 void printCfNumber(
76 CFNumberRef cfNum);
77
78 /* print a CFNumber as a resultType */
79 void printResult(
80 CFNumberRef cfNum);
81
82 /* print a CFNumber as SecUserTrustKeyUsage */
83 void printKeyUsage(
84 CFNumberRef cfNum);
85
86 /* print a CFNumber as CSSM_RETURN string */
87 void printCssmErr(
88 CFNumberRef cfNum);
89
90 /* print cert's label (the one SecCertificate infers) */
91 OSStatus printCertLabel(
92 SecCertificateRef certRef);
93
94 /* print a CFData as an X509 Name (i.e., subject or issuer) */
95 void printCfName(
96 CFDataRef nameData,
97 OidParser &parser);
98
99 #ifdef __cplusplus
100 }
101 #endif
102
103 #endif /* _ROOT_UTILS_H_ */
104