]> git.saurik.com Git - apple/security.git/blob - cdsa/cdsa/oidsbase.h
213aef50b8a5f7e37b10b449659d642c4d08ff0e
[apple/security.git] / cdsa / cdsa / oidsbase.h
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 /*
20 File: oidsbase.h
21
22 Contains: Basic Object Identifier Macros and Data Types.
23
24 Copyright: (c) 1999-2000 Apple Computer, Inc., all rights reserved.
25 */
26
27 #ifndef _OIDSBASE_H_
28 #define _OIDSBASE_H_ 1
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* Intel CSSM */
35
36 #define INTEL 96, 134, 72, 1, 134, 248, 77
37 #define INTEL_LENGTH 7
38
39 #define INTEL_CDSASECURITY INTEL, 2
40 #define INTEL_CDSASECURITY_LENGTH (INTEL_LENGTH + 1)
41
42 #define INTEL_SEC_FORMATS INTEL_CDSASECURITY, 1
43 #define INTEL_SEC_FORMATS_LENGTH (INTEL_CDSASECURITY_LENGTH + 1)
44
45 #define INTEL_SEC_ALGS INTEL_CDSASECURITY, 2, 5
46 #define INTEL_SEC_ALGS_LENGTH (INTEL_CDSASECURITY_LENGTH + 2)
47
48 #define INTEL_SEC_OBJECT_BUNDLE INTEL_SEC_FORMATS, 4
49 #define INTEL_SEC_OBJECT_BUNDLE_LENGTH (INTEL_SEC_FORMATS_LENGTH + 1)
50
51 #define INTEL_CERT_AND_PRIVATE_KEY_2_0 INTEL_SEC_OBJECT_BUNDLE, 1
52 #define INTEL_CERT_AND_PRIVATE_KEY_2_0_LENGTH (INTEL_SEC_OBJECT_BUNDLE_LENGTH + 1)
53
54 /* Suffix specifying format or representation of a field value */
55 /* Note that if a format suffix is not specified, a flat data
56 representation is implied */
57 #define INTEL_X509_C_DATATYPE 1
58 #define INTEL_X509_LDAPSTRING_DATATYPE 2
59
60 #define OID_ISO_CCITT_DIR_SERVICE 85
61 #define OID_DS OID_ISO_CCITT_DIR_SERVICE
62 #define OID_DS_LENGTH 1
63 #define OID_ATTR_TYPE OID_DS, 4
64 #define OID_ATTR_TYPE_LENGTH OID_DS_LENGTH + 1
65 #define OID_EXTENSION OID_DS, 29
66 #define OID_EXTENSION_LENGTH OID_DS_LENGTH + 1
67 #define OID_ISO_STANDARD 40
68 #define OID_ISO_MEMBER 42
69 #define OID_US OID_ISO_MEMBER, 134, 72
70
71 #define OID_ISO_IDENTIFIED_ORG 43
72 #define OID_OSINET OID_ISO_IDENTIFIED_ORG, 4
73 #define OID_GOSIP OID_ISO_IDENTIFIED_ORG, 5
74 #define OID_DOD OID_ISO_IDENTIFIED_ORG, 6
75 #define OID_OIW OID_ISO_IDENTIFIED_ORG, 14
76
77 /* From the PKCS Standards */
78 #define OID_ISO_MEMBER_LENGTH 1
79 #define OID_US_LENGTH OID_ISO_MEMBER_LENGTH + 2
80 #define OID_RSA OID_US, 134, 247, 13
81 #define OID_RSA_LENGTH OID_US_LENGTH + 3
82 #define OID_RSA_HASH OID_RSA, 2
83 #define OID_RSA_HASH_LENGTH OID_RSA_LENGTH + 1
84 #define OID_RSA_ENCRYPT OID_RSA, 3
85 #define OID_RSA_ENCRYPT_LENGTH OID_RSA_LENGTH + 1
86 #define OID_PKCS OID_RSA, 1
87 #define OID_PKCS_LENGTH OID_RSA_LENGTH +1
88 #define OID_PKCS_1 OID_PKCS, 1
89 #define OID_PKCS_1_LENGTH OID_PKCS_LENGTH +1
90 #define OID_PKCS_2 OID_PKCS, 2
91 #define OID_PKCS_3 OID_PKCS, 3
92 #define OID_PKCS_3_LENGTH OID_PKCS_LENGTH +1
93 #define OID_PKCS_4 OID_PKCS, 4
94 #define OID_PKCS_5 OID_PKCS, 5
95 #define OID_PKCS_5_LENGTH OID_PKCS_LENGTH +1
96 #define OID_PKCS_6 OID_PKCS, 6
97 #define OID_PKCS_7 OID_PKCS, 7
98 #define OID_PKCS_7_LENGTH OID_PKCS_LENGTH +1
99 #define OID_PKCS_8 OID_PKCS, 8
100 #define OID_PKCS_9 OID_PKCS, 9
101 #define OID_PKCS_9_LENGTH OID_PKCS_LENGTH +1
102 #define OID_PKCS_10 OID_PKCS, 10
103 #define OID_PKCS_11 OID_PKCS, 11
104 #define OID_PKCS_11_LENGTH OID_PKCS_LENGTH +1
105 #define OID_PKCS_12 OID_PKCS, 12
106 #define OID_PKCS_12_LENGTH OID_PKCS_LENGTH +1
107
108 /* ANSI X9.42 */
109 #define OID_ANSI_X9_42 OID_US, 206, 62, 2
110 #define OID_ANSI_X9_42_LEN OID_US_LENGTH + 3
111 #define OID_ANSI_X9_42_SCHEME OID_ANSI_X9_42, 3
112 #define OID_ANSI_X9_42_SCHEME_LEN OID_ANSI_X9_42_LEN + 1
113 #define OID_ANSI_X9_42_NAMED_SCHEME OID_ANSI_X9_42, 4
114 #define OID_ANSI_X9_42_NAMED_SCHEME_LEN OID_ANSI_X9_42_LEN + 1
115
116 #define OID_PKIX OID_DOD, 1, 5, 5, 7
117 #define OID_PKIX_LENGTH 6
118 #define OID_QT OID_PKIX, 2
119 #define OID_QT_LENGTH OID_PKIX_LENGTH + 1
120
121 #define OID_KP OID_PKIX, 3
122 #define OID_KP_LENGTH OID_PKIX_LENGTH + 1
123
124 #define OID_OIW_SECSIG OID_OIW, 3
125 #define OID_OIW_LENGTH 2
126 #define OID_OIW_SECSIG_LENGTH OID_OIW_LENGTH +1
127
128 #define OID_OIW_ALGORITHM OID_OIW_SECSIG, 2
129 #define OID_OIW_ALGORITHM_LENGTH OID_OIW_SECSIG_LENGTH +1
130
131 /*
132 * Apple-specific OID bases
133 */
134
135 /*
136 * apple OBJECT IDENTIFIER ::=
137 * { iso(1) member-body(2) US(840) 113635 }
138 *
139 * BER = 06 06 2A 86 48 86 F7 63
140 */
141 #define APPLE_OID OID_US, 0x86, 0xf7, 0x63
142 #define APPLE_OID_LENGTH OID_US_LENGTH + 3
143
144 /* appleDataSecurity OBJECT IDENTIFIER ::=
145 * { apple 100 }
146 * { 1 2 840 113635 100 }
147 *
148 * BER = 06 07 2A 86 48 86 F7 63 64
149 */
150 #define APPLE_ADS_OID APPLE_OID, 0x64
151 #define APPLE_ADS_OID_LENGTH APPLE_OID_LENGTH + 1
152
153 /*
154 * appleTrustPolicy OBJECT IDENTIFIER ::=
155 * { appleDataSecurity 1 }
156 * { 1 2 840 113635 100 1 }
157 *
158 * BER = 06 08 2A 86 48 86 F7 63 64 01
159 */
160 #define APPLE_TP_OID APPLE_ADS_OID, 1
161 #define APPLE_TP_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
162
163 /*
164 * appleSecurityAlgorithm OBJECT IDENTIFIER ::=
165 * { appleDataSecurity 2 }
166 * { 1 2 840 113635 100 2 }
167 *
168 * BER = 06 08 2A 86 48 86 F7 63 64 02
169 */
170 #define APPLE_ALG_OID APPLE_ADS_OID, 2
171 #define APPLE_ALG_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
172
173 /*
174 * Netscape extensions.
175 */
176 /*
177 * netscape-cert-extension OBJECT IDENTIFIER ::=
178 * { 2 16 840 1 113730 1 }
179 *
180 * BER = 06 08 60 86 48 01 86 F8 42 01
181 */
182 #define NETSCAPE_CERT_EXTEN 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01
183 #define NETSCAPE_CERT_EXTEN_LENGTH 8
184
185 #ifdef __cplusplus
186 }
187 #endif
188
189 #endif /* _OIDSBASE_H_ */