]> git.saurik.com Git - apple/security.git/blob - OSX/include/security_asn1/oidsbase.h
Security-57336.1.9.tar.gz
[apple/security.git] / OSX / include / security_asn1 / oidsbase.h
1 /*
2 * Copyright (c) 1999-2001,2003-2004,2008-2010,2012,2014 Apple 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 * oidsbase.h -- Basic Object Identifier Macros and Data Types.
24 */
25
26 #include "SecAsn1Types.h"
27
28 #ifndef _OIDSBASE_H_
29 #define _OIDSBASE_H_ 1
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #define SECASN1OID_DEF(NAME, VALUE, ARGS...) \
36 static const uint8_t _##NAME[] = { VALUE, ## ARGS }; \
37 const SecAsn1Oid NAME = { sizeof(_##NAME), (uint8_t *)_##NAME }
38
39 /* Intel CSSM */
40
41 #define INTEL 96, 134, 72, 1, 134, 248, 77
42 #define INTEL_LENGTH 7
43
44 #define INTEL_CDSASECURITY INTEL, 2
45 #define INTEL_CDSASECURITY_LENGTH (INTEL_LENGTH + 1)
46
47 #define INTEL_SEC_FORMATS INTEL_CDSASECURITY, 1
48 #define INTEL_SEC_FORMATS_LENGTH (INTEL_CDSASECURITY_LENGTH + 1)
49
50 #define INTEL_SEC_ALGS INTEL_CDSASECURITY, 2, 5
51 #define INTEL_SEC_ALGS_LENGTH (INTEL_CDSASECURITY_LENGTH + 2)
52
53 #define INTEL_SEC_OBJECT_BUNDLE INTEL_SEC_FORMATS, 4
54 #define INTEL_SEC_OBJECT_BUNDLE_LENGTH (INTEL_SEC_FORMATS_LENGTH + 1)
55
56 #define INTEL_CERT_AND_PRIVATE_KEY_2_0 INTEL_SEC_OBJECT_BUNDLE, 1
57 #define INTEL_CERT_AND_PRIVATE_KEY_2_0_LENGTH (INTEL_SEC_OBJECT_BUNDLE_LENGTH + 1)
58
59 /* Suffix specifying format or representation of a field value */
60 /* Note that if a format suffix is not specified, a flat data
61 representation is implied */
62 #define INTEL_X509_C_DATATYPE 1
63 #define INTEL_X509_LDAPSTRING_DATATYPE 2
64
65 #define OID_ISO_CCITT_DIR_SERVICE 85
66 #define OID_DS OID_ISO_CCITT_DIR_SERVICE
67 #define OID_DS_LENGTH 1
68 #define OID_ATTR_TYPE OID_DS, 4
69 #define OID_ATTR_TYPE_LENGTH OID_DS_LENGTH + 1
70 #define OID_EXTENSION OID_DS, 29
71 #define OID_EXTENSION_LENGTH OID_DS_LENGTH + 1
72 #define OID_ISO_STANDARD 40
73 #define OID_ISO_MEMBER 42
74 #define OID_US OID_ISO_MEMBER, 134, 72
75
76 #define OID_ISO_IDENTIFIED_ORG 43
77 #define OID_OSINET OID_ISO_IDENTIFIED_ORG, 4
78 #define OID_GOSIP OID_ISO_IDENTIFIED_ORG, 5
79 #define OID_DOD OID_ISO_IDENTIFIED_ORG, 6
80 #define OID_OIW OID_ISO_IDENTIFIED_ORG, 14
81
82 #define OID_ITU_RFCDATA_MEMBER_LENGTH 1
83 #define OID_ITU_RFCDATA 9
84
85 /* From the PKCS Standards */
86 #define OID_ISO_MEMBER_LENGTH 1
87 #define OID_US_LENGTH OID_ISO_MEMBER_LENGTH + 2
88 #define OID_RSA OID_US, 134, 247, 13
89 #define OID_RSA_LENGTH OID_US_LENGTH + 3
90 #define OID_RSA_HASH OID_RSA, 2
91 #define OID_RSA_HASH_LENGTH OID_RSA_LENGTH + 1
92 #define OID_RSA_ENCRYPT OID_RSA, 3
93 #define OID_RSA_ENCRYPT_LENGTH OID_RSA_LENGTH + 1
94 #define OID_PKCS OID_RSA, 1
95 #define OID_PKCS_LENGTH OID_RSA_LENGTH +1
96 #define OID_PKCS_1 OID_PKCS, 1
97 #define OID_PKCS_1_LENGTH OID_PKCS_LENGTH +1
98 #define OID_PKCS_2 OID_PKCS, 2
99 #define OID_PKCS_3 OID_PKCS, 3
100 #define OID_PKCS_3_LENGTH OID_PKCS_LENGTH +1
101 #define OID_PKCS_4 OID_PKCS, 4
102 #define OID_PKCS_5 OID_PKCS, 5
103 #define OID_PKCS_5_LENGTH OID_PKCS_LENGTH +1
104 #define OID_PKCS_6 OID_PKCS, 6
105 #define OID_PKCS_7 OID_PKCS, 7
106 #define OID_PKCS_7_LENGTH OID_PKCS_LENGTH +1
107 #define OID_PKCS_8 OID_PKCS, 8
108 #define OID_PKCS_9 OID_PKCS, 9
109 #define OID_PKCS_9_LENGTH OID_PKCS_LENGTH +1
110 #define OID_PKCS_10 OID_PKCS, 10
111 #define OID_PKCS_11 OID_PKCS, 11
112 #define OID_PKCS_11_LENGTH OID_PKCS_LENGTH +1
113 #define OID_PKCS_12 OID_PKCS, 12
114 #define OID_PKCS_12_LENGTH OID_PKCS_LENGTH +1
115
116 /* ANSI X9.42 */
117 #define OID_ANSI_X9_42 OID_US, 206, 62, 2
118 #define OID_ANSI_X9_42_LEN OID_US_LENGTH + 3
119 #define OID_ANSI_X9_42_SCHEME OID_ANSI_X9_42, 3
120 #define OID_ANSI_X9_42_SCHEME_LEN OID_ANSI_X9_42_LEN + 1
121 #define OID_ANSI_X9_42_NAMED_SCHEME OID_ANSI_X9_42, 4
122 #define OID_ANSI_X9_42_NAMED_SCHEME_LEN OID_ANSI_X9_42_LEN + 1
123
124 /* ANSI X9.62 (1 2 840 10045) */
125 #define OID_ANSI_X9_62 0x2A, 0x86, 0x48, 0xCE, 0x3D
126 #define OID_ANSI_X9_62_LEN 5
127 #define OID_ANSI_X9_62_FIELD_TYPE OID_ANSI_X9_62, 1
128 #define OID_ANSI_X9_62_PUBKEY_TYPE OID_ANSI_X9_62, 2
129 #define OID_ANSI_X9_62_ELL_CURVE OID_ANSI_X9_62, 3
130 #define OID_ANSI_X9_62_ELL_CURVE_LEN OID_ANSI_X9_62_LEN+1
131 #define OID_ANSI_X9_62_C_TWO_CURVE OID_ANSI_X9_62_ELL_CURVE, 0
132 #define OID_ANSI_X9_62_PRIME_CURVE OID_ANSI_X9_62_ELL_CURVE, 1
133 #define OID_ANSI_X9_62_SIG_TYPE OID_ANSI_X9_62, 4
134 #define OID_ANSI_X9_62_SIG_TYPE_LEN OID_ANSI_X9_62_LEN+1
135
136 /* PKIX */
137 #define OID_PKIX OID_DOD, 1, 5, 5, 7
138 #define OID_PKIX_LENGTH 6
139 #define OID_PE OID_PKIX, 1
140 #define OID_PE_LENGTH OID_PKIX_LENGTH + 1
141 #define OID_QT OID_PKIX, 2
142 #define OID_QT_LENGTH OID_PKIX_LENGTH + 1
143 #define OID_KP OID_PKIX, 3
144 #define OID_KP_LENGTH OID_PKIX_LENGTH + 1
145 #define OID_OTHER_NAME OID_PKIX, 8
146 #define OID_OTHER_NAME_LENGTH OID_PKIX_LENGTH + 1
147 #define OID_PDA OID_PKIX, 9
148 #define OID_PDA_LENGTH OID_PKIX_LENGTH + 1
149 #define OID_QCS OID_PKIX, 11
150 #define OID_QCS_LENGTH OID_PKIX_LENGTH + 1
151 #define OID_AD OID_PKIX, 48
152 #define OID_AD_LENGTH OID_PKIX_LENGTH + 1
153 #define OID_AD_OCSP OID_AD, 1
154 #define OID_AD_OCSP_LENGTH OID_AD_LENGTH + 1
155
156 /* ETSI */
157 #define OID_ETSI 0x04, 0x00
158 #define OID_ETSI_LENGTH 2
159 #define OID_ETSI_QCS 0x04, 0x00, 0x8E, 0x46, 0x01
160 #define OID_ETSI_QCS_LENGTH 5
161
162 #define OID_OIW_SECSIG OID_OIW, 3
163 #define OID_OIW_LENGTH 2
164 #define OID_OIW_SECSIG_LENGTH OID_OIW_LENGTH +1
165
166 #define OID_OIW_ALGORITHM OID_OIW_SECSIG, 2
167 #define OID_OIW_ALGORITHM_LENGTH OID_OIW_SECSIG_LENGTH +1
168
169 /* NIST defined digest algorithm arc (2, 16, 840, 1, 101, 3, 4, 2) */
170 #define OID_NIST_HASHALG 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02
171 #define OID_NIST_HASHALG_LENGTH 8
172
173 /* Kerberos PKINIT */
174 #define OID_KERBv5 0x2b, 6, 1, 5, 2
175 #define OID_KERBv5_LEN 5
176 #define OID_KERBv5_PKINIT OID_KERBv5, 3
177 #define OID_KERBv5_PKINIT_LEN OID_KERBv5_LEN + 1
178
179 /* Certicom (1 3 132) */
180 #define OID_CERTICOM 0x2B, 0x81, 0x04
181 #define OID_CERTICOM_LEN 3
182 #define OID_CERTICOM_ELL_CURVE OID_CERTICOM, 0
183 #define OID_CERTICOM_ELL_CURVE_LEN OID_CERTICOM_LEN+1
184
185 /*
186 * Apple-specific OID bases
187 */
188
189 /*
190 * apple OBJECT IDENTIFIER ::=
191 * { iso(1) member-body(2) US(840) 113635 }
192 *
193 * BER = 06 06 2A 86 48 86 F7 63
194 */
195 #define APPLE_OID OID_US, 0x86, 0xf7, 0x63
196 #define APPLE_OID_LENGTH OID_US_LENGTH + 3
197
198 /* appleDataSecurity OBJECT IDENTIFIER ::=
199 * { apple 100 }
200 * { 1 2 840 113635 100 }
201 *
202 * BER = 06 07 2A 86 48 86 F7 63 64
203 */
204 #define APPLE_ADS_OID APPLE_OID, 0x64
205 #define APPLE_ADS_OID_LENGTH APPLE_OID_LENGTH + 1
206
207 /*
208 * appleTrustPolicy OBJECT IDENTIFIER ::=
209 * { appleDataSecurity 1 }
210 * { 1 2 840 113635 100 1 }
211 *
212 * BER = 06 08 2A 86 48 86 F7 63 64 01
213 */
214 #define APPLE_TP_OID APPLE_ADS_OID, 1
215 #define APPLE_TP_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
216
217 /*
218 * appleSecurityAlgorithm OBJECT IDENTIFIER ::=
219 * { appleDataSecurity 2 }
220 * { 1 2 840 113635 100 2 }
221 *
222 * BER = 06 08 2A 86 48 86 F7 63 64 02
223 */
224 #define APPLE_ALG_OID APPLE_ADS_OID, 2
225 #define APPLE_ALG_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
226
227 /*
228 * appleDotMacCertificate OBJECT IDENTIFIER ::=
229 * { appleDataSecurity 3 }
230 * { 1 2 840 113635 100 3 }
231 */
232 #define APPLE_DOTMAC_CERT_OID APPLE_ADS_OID, 3
233 #define APPLE_DOTMAC_CERT_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
234
235 /*
236 * Basis of Policy OIDs for .mac TP requests
237 *
238 * dotMacCertificateRequest OBJECT IDENTIFIER ::=
239 * { appleDotMacCertificate 1 }
240 * { 1 2 840 113635 100 3 1 }
241 */
242 #define APPLE_DOTMAC_CERT_REQ_OID APPLE_DOTMAC_CERT_OID, 1
243 #define APPLE_DOTMAC_CERT_REQ_OID_LENGTH APPLE_DOTMAC_CERT_OID_LENGTH + 1
244
245 /*
246 * Basis of .mac Certificate Extensions
247 *
248 * dotMacCertificateExtension OBJECT IDENTIFIER ::=
249 * { appleDotMacCertificate 2 }
250 * { 1 2 840 113635 100 3 2 }
251 */
252 #define APPLE_DOTMAC_CERT_EXTEN_OID APPLE_DOTMAC_CERT_OID, 2
253 #define APPLE_DOTMAC_CERT_EXTEN_OID_LENGTH APPLE_DOTMAC_CERT_OID_LENGTH + 1
254
255 /*
256 * Basis of .mac Certificate request OID/value identifiers
257 *
258 * dotMacCertificateRequestValues OBJECT IDENTIFIER ::=
259 * { appleDotMacCertificate 3 }
260 * { 1 2 840 113635 100 3 3 }
261 */
262 #define APPLE_DOTMAC_CERT_REQ_VALUE_OID APPLE_DOTMAC_CERT_OID, 3
263 #define APPLE_DOTMAC_CERT_REQ_VALUE_OID_LENGTH APPLE_DOTMAC_CERT_OID_LENGTH + 1
264
265 /*
266 * Basis of Apple-specific extended key usages
267 *
268 * appleExtendedKeyUsage OBJECT IDENTIFIER ::=
269 * { appleDataSecurity 4 }
270 * { 1 2 840 113635 100 4 }
271 */
272 #define APPLE_EKU_OID APPLE_ADS_OID, 4
273 #define APPLE_EKU_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
274
275 /*
276 * Basis of Apple Code Signing extended key usages
277 * appleCodeSigning OBJECT IDENTIFIER ::=
278 * { appleExtendedKeyUsage 1 }
279 * { 1 2 840 113635 100 4 1 }
280 */
281 #define APPLE_EKU_CODE_SIGNING APPLE_EKU_OID, 1
282 #define APPLE_EKU_CODE_SIGNING_LENGTH APPLE_EKU_OID_LENGTH + 1
283
284 /*
285 * Basis of Apple-specific Certificate Policy identifiers
286 * appleCertificatePolicies OBJECT IDENTIFIER ::=
287 * { appleDataSecurity 5 }
288 * { 1 2 840 113635 100 5 }
289 */
290 #define APPLE_CERT_POLICIES APPLE_ADS_OID, 5
291 #define APPLE_CERT_POLICIES_LENGTH APPLE_ADS_OID_LENGTH + 1
292
293 /*
294 * Basis of Apple-specific certificate extensions
295 * appleCertificateExtensions OBJECT IDENTIFIER ::=
296 * { appleDataSecurity 6 }
297 * { 1 2 840 113635 100 6 }
298 */
299 #define APPLE_EXTENSION_OID APPLE_ADS_OID, 6
300 #define APPLE_EXTENSION_OID_LENGTH APPLE_ADS_OID_LENGTH + 1
301
302 /*
303 * Basis of Apple-specific Code Signing certificate extensions
304 * appleCertificateExtensionCodeSigning OBJECT IDENTIFIER ::=
305 * { appleCertificateExtensions 1 }
306 * { 1 2 840 113635 100 6 1 }
307 */
308 #define APPLE_EXTENSION_CODE_SIGNING APPLE_EXTENSION_OID, 1
309 #define APPLE_EXTENSION_CODE_SIGNING_LENGTH APPLE_EXTENSION_OID_LENGTH + 1
310
311 /*
312 * Netscape OIDs.
313 */
314 #define NETSCAPE_BASE_OID 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42
315 #define NETSCAPE_BASE_OID_LEN 7
316
317 /*
318 * Netscape cert extension.
319 *
320 * netscape-cert-extension OBJECT IDENTIFIER ::=
321 * { 2 16 840 1 113730 1 }
322 *
323 * BER = 06 08 60 86 48 01 86 F8 42 01
324 */
325 #define NETSCAPE_CERT_EXTEN NETSCAPE_BASE_OID, 0x01
326 #define NETSCAPE_CERT_EXTEN_LENGTH NETSCAPE_BASE_OID_LEN + 1
327
328 #define NETSCAPE_CERT_POLICY NETSCAPE_BASE_OID, 0x04
329 #define NETSCAPE_CERT_POLICY_LENGTH NETSCAPE_BASE_OID_LEN + 1
330
331
332 /* Google OIDs: 1.3.6.1.4.1.11129. */
333 #define GOOGLE_BASE_OID OID_DOD, 0x01, 0x04, 0x01, 0xD6, 0x79
334 #define GOOGLE_BASE_OID_LEN OID_DOD_LEN + 5
335 #define GOOGLE_EMBEDDED_SCT_OID GOOGLE_BASE_OID, 0x02, 0x04, 0x02
336 #define GOOGLE_OCSP_SCT_OID GOOGLE_BASE_OID, 0x02, 0x04, 0x05
337
338 /*
339 * Domain Component OID
340 */
341 #define OID_ITU_RFCDATA_2342 OID_ITU_RFCDATA, 0x49, 0x86
342 #define OID_ITU_RFCDATA_2342_LENGTH OID_ITU_RFCDATA_MEMBER_LENGTH + 2
343
344 #define OID_ITU_RFCDATA_2342_UCL OID_ITU_RFCDATA_2342, 0x49, 0x1F, 0x12, 0x8C
345 #define OID_ITU_RFCDATA_2342_UCL_LENGTH OID_ITU_RFCDATA_2342_LENGTH + 4
346
347 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT OID_ITU_RFCDATA_2342_UCL, 0xE4
348 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_LENGTH OID_ITU_RFCDATA_2342_UCL_LENGTH + 1
349
350 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT, 0x81
351 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_LENGTH OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_LENGTH + 1
352
353 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_DOMAINCOMPONENT OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES, 0x99
354 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_DOMAINCOMPONENT_LENGTH OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_LENGTH + 1
355
356 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_USERID OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES, 0x81
357 #define OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_USERID_LENGTH OID_ITU_RFCDATA_2342_UCL_DIRECTORYPILOT_ATTRIBUTES_LENGTH + 1
358
359 #ifdef __cplusplus
360 }
361 #endif
362
363 #endif /* _OIDSBASE_H_ */