]> git.saurik.com Git - apple/security.git/blob - cdsa/cssm/oidsattr.c
Security-54.1.tar.gz
[apple/security.git] / cdsa / cssm / oidsattr.c
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 * oidsattr.c - Cert/CRL related OIDs.
21 */
22
23 #include <Security/oidsattr.h>
24
25
26 /*
27 * Directory name component identifiers.
28 */
29 static const uint8
30 OID_ObjectClass[] = { OID_ATTR_TYPE, 0 },
31 OID_AliasedEntryName[] = { OID_ATTR_TYPE, 1 },
32 OID_KnowledgeInformation[] = { OID_ATTR_TYPE, 2 },
33 OID_CommonName[] = { OID_ATTR_TYPE, 3 },
34 OID_Surname[] = { OID_ATTR_TYPE, 4 },
35 OID_SerialNumber[] = { OID_ATTR_TYPE, 5 },
36 OID_CountryName[] = { OID_ATTR_TYPE, 6 },
37 OID_LocalityName[] = { OID_ATTR_TYPE, 7 },
38 OID_StateProvinceName[] = { OID_ATTR_TYPE, 8 },
39 OID_CollectiveStateProvinceName[] = { OID_ATTR_TYPE, 8, 1 },
40 OID_StreetAddress[] = { OID_ATTR_TYPE, 9 },
41 OID_CollectiveStreetAddress[] = { OID_ATTR_TYPE, 9, 1 },
42 OID_OrganizationName[] = { OID_ATTR_TYPE, 10 },
43 OID_CollectiveOrganizationName[] = { OID_ATTR_TYPE, 10, 1 },
44 OID_OrganizationalUnitName[] = { OID_ATTR_TYPE, 11 },
45 OID_CollectiveOrganizationalUnitName[]
46 = { OID_ATTR_TYPE, 11, 1 },
47 OID_Title[] = { OID_ATTR_TYPE, 12 },
48 OID_Description[] = { OID_ATTR_TYPE, 13 },
49 OID_SearchGuide[] = { OID_ATTR_TYPE, 14 },
50 OID_BusinessCategory[] = { OID_ATTR_TYPE, 15 },
51 OID_PostalAddress[] = { OID_ATTR_TYPE, 16 },
52 OID_CollectivePostalAddress[] = { OID_ATTR_TYPE, 16, 1 },
53 OID_PostalCode[] = { OID_ATTR_TYPE, 17 },
54 OID_CollectivePostalCode[] = { OID_ATTR_TYPE, 17, 1 },
55 OID_PostOfficeBox[] = { OID_ATTR_TYPE, 18 },
56 OID_CollectivePostOfficeBox[] = { OID_ATTR_TYPE, 18, 1 },
57 OID_PhysicalDeliveryOfficeName[] = { OID_ATTR_TYPE, 19 },
58 OID_CollectivePhysicalDeliveryOfficeName[]
59 = { OID_ATTR_TYPE, 19, 1 },
60 OID_TelephoneNumber[] = { OID_ATTR_TYPE, 20 },
61 OID_CollectiveTelephoneNumber[] = { OID_ATTR_TYPE, 20, 1 },
62 OID_TelexNumber[] = { OID_ATTR_TYPE, 21 },
63 OID_CollectiveTelexNumber[] = { OID_ATTR_TYPE, 21, 1 },
64 OID_TelexTerminalIdentifier[] = { OID_ATTR_TYPE, 22 },
65 OID_CollectiveTelexTerminalIdentifier[]
66 = { OID_ATTR_TYPE, 22, 1 },
67 OID_FacsimileTelephoneNumber[] = { OID_ATTR_TYPE, 23 },
68 OID_CollectiveFacsimileTelephoneNumber[]
69 = { OID_ATTR_TYPE, 23, 1 },
70 OID_X_121Address[] = { OID_ATTR_TYPE, 24 },
71 OID_InternationalISDNNumber[] = { OID_ATTR_TYPE, 25 },
72 OID_CollectiveInternationalISDNNumber[]
73 = { OID_ATTR_TYPE, 25, 1 },
74 OID_RegisteredAddress[] = { OID_ATTR_TYPE, 26 },
75 OID_DestinationIndicator[] = { OID_ATTR_TYPE, 27 },
76 OID_PreferredDeliveryMethod[] = { OID_ATTR_TYPE, 28 },
77 OID_PresentationAddress[] = { OID_ATTR_TYPE, 29 },
78 OID_SupportedApplicationContext[] = { OID_ATTR_TYPE, 30 },
79 OID_Member[] = { OID_ATTR_TYPE, 31 },
80 OID_Owner[] = { OID_ATTR_TYPE, 32 },
81 OID_RoleOccupant[] = { OID_ATTR_TYPE, 33 },
82 OID_SeeAlso[] = { OID_ATTR_TYPE, 34 },
83 OID_UserPassword[] = { OID_ATTR_TYPE, 35 },
84 OID_UserCertificate[] = { OID_ATTR_TYPE, 36 },
85 OID_CACertificate[] = { OID_ATTR_TYPE, 37 },
86 OID_AuthorityRevocationList[] = { OID_ATTR_TYPE, 38 },
87 OID_CertificateRevocationList[] = { OID_ATTR_TYPE, 39 },
88 OID_CrossCertificatePair[] = { OID_ATTR_TYPE, 40 },
89 OID_Name[] = { OID_ATTR_TYPE, 41 },
90 OID_GivenName[] = { OID_ATTR_TYPE, 42 },
91 OID_Initials[] = { OID_ATTR_TYPE, 43 },
92 OID_GenerationQualifier[] = { OID_ATTR_TYPE, 44 },
93 OID_UniqueIdentifier[] = { OID_ATTR_TYPE, 45 },
94 OID_DNQualifier[] = { OID_ATTR_TYPE, 46 },
95 OID_EnhancedSearchGuide[] = { OID_ATTR_TYPE, 47 },
96 OID_ProtocolInformation[] = { OID_ATTR_TYPE, 48 },
97 OID_DistinguishedName[] = { OID_ATTR_TYPE, 49 },
98 OID_UniqueMember[] = { OID_ATTR_TYPE, 50 },
99 OID_HouseIdentifier[] = { OID_ATTR_TYPE, 51 }
100 ;
101
102 const CSSM_OID
103 CSSMOID_ObjectClass = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_ObjectClass},
104 CSSMOID_AliasedEntryName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_AliasedEntryName},
105 CSSMOID_KnowledgeInformation = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_KnowledgeInformation},
106 CSSMOID_CommonName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_CommonName},
107 CSSMOID_Surname = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Surname},
108 CSSMOID_SerialNumber = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_SerialNumber},
109 CSSMOID_CountryName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_CountryName},
110 CSSMOID_LocalityName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_LocalityName},
111 CSSMOID_StateProvinceName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_StateProvinceName},
112 CSSMOID_CollectiveStateProvinceName
113 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveStateProvinceName},
114 CSSMOID_StreetAddress = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_StreetAddress},
115 CSSMOID_CollectiveStreetAddress = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveStreetAddress},
116 CSSMOID_OrganizationName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_OrganizationName},
117 CSSMOID_CollectiveOrganizationName
118 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveOrganizationName},
119 CSSMOID_OrganizationalUnitName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_OrganizationalUnitName},
120 CSSMOID_CollectiveOrganizationalUnitName
121 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveOrganizationalUnitName},
122 CSSMOID_Title = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Title},
123 CSSMOID_Description = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Description},
124 CSSMOID_SearchGuide = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_SearchGuide},
125 CSSMOID_BusinessCategory = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_BusinessCategory},
126 CSSMOID_PostalAddress = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_PostalAddress},
127 CSSMOID_CollectivePostalAddress = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectivePostalAddress},
128 CSSMOID_PostalCode = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_PostalCode},
129 CSSMOID_CollectivePostalCode = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectivePostalCode},
130 CSSMOID_PostOfficeBox = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_PostOfficeBox},
131 CSSMOID_CollectivePostOfficeBox = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectivePostOfficeBox},
132 CSSMOID_PhysicalDeliveryOfficeName
133 = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_PhysicalDeliveryOfficeName},
134 CSSMOID_CollectivePhysicalDeliveryOfficeName
135 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectivePhysicalDeliveryOfficeName},
136 CSSMOID_TelephoneNumber = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_TelephoneNumber},
137 CSSMOID_CollectiveTelephoneNumber
138 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveTelephoneNumber},
139 CSSMOID_TelexNumber = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_TelexNumber},
140 CSSMOID_CollectiveTelexNumber = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveTelexNumber},
141 CSSMOID_TelexTerminalIdentifier = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_TelexTerminalIdentifier},
142 CSSMOID_CollectiveTelexTerminalIdentifier
143 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveTelexTerminalIdentifier},
144 CSSMOID_FacsimileTelephoneNumber= { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_FacsimileTelephoneNumber},
145 CSSMOID_CollectiveFacsimileTelephoneNumber
146 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveFacsimileTelephoneNumber},
147 CSSMOID_X_121Address = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_X_121Address},
148 CSSMOID_InternationalISDNNumber = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_InternationalISDNNumber},
149 CSSMOID_CollectiveInternationalISDNNumber
150 = { OID_ATTR_TYPE_LENGTH+2, (uint8 *)OID_CollectiveInternationalISDNNumber},
151 CSSMOID_RegisteredAddress = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_RegisteredAddress},
152 CSSMOID_DestinationIndicator = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_DestinationIndicator},
153 CSSMOID_PreferredDeliveryMethod = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_PreferredDeliveryMethod},
154 CSSMOID_PresentationAddress = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_PresentationAddress},
155 CSSMOID_SupportedApplicationContext
156 = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_SupportedApplicationContext},
157 CSSMOID_Member = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Member},
158 CSSMOID_Owner = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Owner},
159 CSSMOID_RoleOccupant = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_RoleOccupant},
160 CSSMOID_SeeAlso = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_SeeAlso},
161 CSSMOID_UserPassword = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_UserPassword},
162 CSSMOID_UserCertificate = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_UserCertificate},
163 CSSMOID_CACertificate = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_CACertificate},
164 CSSMOID_AuthorityRevocationList = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_AuthorityRevocationList},
165 CSSMOID_CertificateRevocationList
166 = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_CertificateRevocationList},
167 CSSMOID_CrossCertificatePair = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_CrossCertificatePair},
168 CSSMOID_Name = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Name},
169 CSSMOID_GivenName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_GivenName},
170 CSSMOID_Initials = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_Initials},
171 CSSMOID_GenerationQualifier = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_GenerationQualifier},
172 CSSMOID_UniqueIdentifier = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_UniqueIdentifier},
173 CSSMOID_DNQualifier = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_DNQualifier},
174 CSSMOID_EnhancedSearchGuide = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_EnhancedSearchGuide},
175 CSSMOID_ProtocolInformation = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_ProtocolInformation},
176 CSSMOID_DistinguishedName = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_DistinguishedName},
177 CSSMOID_UniqueMember = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_UniqueMember},
178 CSSMOID_HouseIdentifier = { OID_ATTR_TYPE_LENGTH+1, (uint8 *)OID_HouseIdentifier}
179 ;
180
181
182 /* From PKCS 9 */
183 static const uint8
184 OID_EmailAddress[] = { OID_PKCS_9, 1 },
185 OID_UnstructuredName[] = { OID_PKCS_9, 2 },
186 OID_ContentType[] = { OID_PKCS_9, 3 },
187 OID_MessageDigest[] = { OID_PKCS_9, 4 },
188 OID_SigningTime[] = { OID_PKCS_9, 5 },
189 OID_CounterSignature[] = { OID_PKCS_9, 6 },
190 OID_ChallengePassword[] = { OID_PKCS_9, 7 },
191 OID_UnstructuredAddress[] = { OID_PKCS_9, 8 },
192 OID_ExtendedCertificateAttributes[] = { OID_PKCS_9, 9 }
193 ;
194
195 const CSSM_OID
196 CSSMOID_EmailAddress = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_EmailAddress},
197 CSSMOID_UnstructuredName = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_UnstructuredName},
198 CSSMOID_ContentType = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_ContentType},
199 CSSMOID_MessageDigest = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_MessageDigest},
200 CSSMOID_SigningTime = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_SigningTime},
201 CSSMOID_CounterSignature = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_CounterSignature},
202 CSSMOID_ChallengePassword = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_ChallengePassword},
203 CSSMOID_UnstructuredAddress = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_UnstructuredAddress},
204 CSSMOID_ExtendedCertificateAttributes = {OID_PKCS_9_LENGTH+1, (uint8 *)OID_ExtendedCertificateAttributes};
205
206 /* PKIX */
207 static const uint8
208 OID_QT_CPS[] = { OID_QT, 1},
209 OID_QT_UNOTICE[] = { OID_QT, 2}
210 ;
211
212 const CSSM_OID
213 CSSMOID_QT_CPS = {OID_QT_LENGTH+1, (uint8 *)OID_QT_CPS},
214 CSSMOID_QT_UNOTICE = {OID_QT_LENGTH+1, (uint8 *)OID_QT_UNOTICE}
215 ;
216