1/*
2 * Copyright (c) 2005-2009,2011-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
24
25/*
26 * oids.h - declaration of OID consts
27 *
28 */
29
30#ifndef	_LIB_DER_OIDS_H_
31#define _LIB_DER_OIDS_H_
32
33#include <libDER/libDER.h>
34#include <stdbool.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40/* Algorithm oids. */
41extern const DERItem
42    oidRsa,         /* PKCS1 RSA encryption, used to identify RSA keys */
43    oidMd2Rsa,      /* PKCS1 md2withRSAEncryption signature alg */
44    oidMd5Rsa,      /* PKCS1 md5withRSAEncryption signature alg */
45    oidSha1Rsa,     /* PKCS1 sha1withRSAEncryption signature alg */
46    oidSha256Rsa,   /* PKCS1 sha256WithRSAEncryption signature alg */
47    oidEcPubKey,    /* ECDH or ECDSA public key in a certificate */
48    oidSha1Ecdsa,   /* ECDSA with SHA1 signature alg */
49    oidSha224Ecdsa, /* ECDSA with SHA224 signature alg */
50    oidSha256Ecdsa, /* ECDSA with SHA256 signature alg */
51    oidSha384Ecdsa, /* ECDSA with SHA384 signature alg */
52    oidSha512Ecdsa, /* ECDSA with SHA512 signature alg */
53    oidMd2,         /* OID_RSA_HASH 2 */
54    oidMd4,         /* OID_RSA_HASH 4 */
55    oidMd5,         /* OID_RSA_HASH 5 */
56    oidSha1,        /* OID_OIW_ALGORITHM 26 */
57    oidSha256,      /* OID_NIST_HASHALG 1 */
58    oidSha384,      /* OID_NIST_HASHALG 2 */
59    oidSha512,      /* OID_NIST_HASHALG 3 */
60    oidSha224;      /* OID_NIST_HASHALG 4 */
61
62/* Standard X.509 Cert and CRL extensions. */
63extern const DERItem
64    oidSubjectKeyIdentifier,
65    oidKeyUsage,
66    oidPrivateKeyUsagePeriod,
67    oidSubjectAltName,
68    oidIssuerAltName,
69    oidBasicConstraints,
70    oidCrlDistributionPoints,
71    oidCertificatePolicies,
72    oidAnyPolicy,
73    oidPolicyMappings,
74    oidAuthorityKeyIdentifier,
75    oidPolicyConstraints,
76    oidExtendedKeyUsage,
77    oidAnyExtendedKeyUsage,
78    oidInhibitAnyPolicy,
79    oidAuthorityInfoAccess,
80    oidSubjectInfoAccess,
81    oidAdOCSP,
82    oidAdCAIssuer,
83    oidNetscapeCertType,
84    oidEntrustVersInfo,
85    oidMSNTPrincipalName,
86    /* Policy Qualifier IDs for Internet policy qualifiers. */
87    oidQtCps,
88    oidQtUNotice,
89    /* X.501 Name IDs. */
90    oidCommonName,
91    oidCountryName,
92    oidLocalityName,
93    oidStateOrProvinceName,
94    oidOrganizationName,
95    oidOrganizationalUnitName,
96    oidDescription,
97    oidEmailAddress,
98    oidFriendlyName,
99    oidLocalKeyId,
100    oidExtendedKeyUsageServerAuth,
101    oidExtendedKeyUsageClientAuth,
102    oidExtendedKeyUsageCodeSigning,
103    oidExtendedKeyUsageEmailProtection,
104    oidExtendedKeyUsageOCSPSigning,
105    oidExtendedKeyUsageIPSec,
106    oidExtendedKeyUsageMicrosoftSGC,
107    oidExtendedKeyUsageNetscapeSGC,
108    /* Secure Boot Spec oid */
109    oidAppleSecureBootCertSpec,
110    oidAppleProvisioningProfile,
111    oidAppleApplicationSigning,
112    oidAppleInstallerPackagingSigningExternal,
113    oidAppleExtendedKeyUsageAppleID,
114    oidAppleExtendedKeyUsageShoebox,
115    oidAppleExtendedKeyUsageProfileSigning,
116    oidAppleExtendedKeyUsageQAProfileSigning,
117    oidAppleIntmMarkerAppleID,
118    oidAppleIntmMarkerAppleID2,
119    oidApplePushServiceClient,
120    oidApplePolicyMobileStore,
121    oidApplePolicyTestMobileStore,
122    oidApplePolicyEscrowService,
123    oidAppleCertExtensionAppleIDRecordValidationSigning,
124    oidAppleIntmMarkerAppleSystemIntg2,
125    oidAppleIntmMarkerAppleSystemIntgG3,
126    oidAppleCertExtAppleSMPEncryption,
127    oidAppleCertExtAppleServerAuthentication,
128    oidAppleIntmMarkerAppleServerAuthentication;
129
130/* Compare two decoded OIDs.  Returns true iff they are equivalent. */
131bool DEROidCompare(const DERItem *oid1, const DERItem *oid2);
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif	/* _LIB_DER_UTILS_H_ */
138