]> git.saurik.com Git - apple/security.git/blob - cdsa/cssm/oidsalg.c
Security-54.1.3.tar.gz
[apple/security.git] / cdsa / cssm / oidsalg.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 * oidsalg.c - OIDs defining crypto algorithms
21 */
22
23 #include <Security/oidsbase.h>
24 #include <Security/cssmtype.h>
25
26 static const uint8
27 OID_MD2[] = { OID_RSA_HASH, 2 },
28 OID_MD4[] = { OID_RSA_HASH, 4 },
29 OID_MD5[] = { OID_RSA_HASH, 5 },
30 OID_RSAEncryption[] = { OID_PKCS_1, 1 },
31 OID_MD2WithRSA[] = { OID_PKCS_1, 2 },
32 OID_MD4WithRSA[] = { OID_PKCS_1, 3 },
33 OID_MD5WithRSA[] = { OID_PKCS_1, 4 },
34 OID_SHA1WithRSA[] = { OID_PKCS_1, 5 },
35 OID_DHKeyAgreement[] = { OID_PKCS_3, 1 },
36 OID_OIW_DSA[] = { OID_OIW_ALGORITHM, 12 },
37 OID_OIW_DSAWithSHA1[] = { OID_OIW_ALGORITHM, 27 },
38 OID_OIW_SHA1[] = { OID_OIW_ALGORITHM, 26 };
39
40 const CSSM_OID
41 CSSMOID_MD2 = {OID_RSA_HASH_LENGTH+1, (uint8 *)OID_MD2},
42 CSSMOID_MD4 = {OID_RSA_HASH_LENGTH+1, (uint8 *)OID_MD4},
43 CSSMOID_MD5 = {OID_RSA_HASH_LENGTH+1, (uint8 *)OID_MD5},
44 CSSMOID_RSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_RSAEncryption},
45 CSSMOID_MD2WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_MD2WithRSA},
46 CSSMOID_MD4WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_MD4WithRSA},
47 CSSMOID_MD5WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_MD5WithRSA},
48 CSSMOID_SHA1WithRSA = {OID_PKCS_1_LENGTH+1, (uint8 *)OID_SHA1WithRSA},
49 CSSMOID_DH = {OID_PKCS_3_LENGTH+1, (uint8 *)OID_DHKeyAgreement},
50 CSSMOID_DSA = {OID_OIW_ALGORITHM_LENGTH+1, (uint8 *)OID_OIW_DSA},
51 CSSMOID_SHA1WithDSA = {OID_OIW_ALGORITHM_LENGTH+1, (uint8 *)OID_OIW_DSAWithSHA1},
52 CSSMOID_SHA1 = {OID_OIW_ALGORITHM_LENGTH+1, (uint8 *)OID_OIW_SHA1};
53
54
55 /* iSignTP OBJECT IDENTIFIER ::=
56 * { appleTrustPolicy 1 }
57 * { 1 2 840 113635 100 1 1 }
58 *
59 * BER = 06 09 2A 86 48 86 F7 63 64 01 01
60 */
61 static const uint8
62 APPLE_TP_ISIGN[] = {APPLE_TP_OID, 1},
63
64 /* AppleX509Basic OBJECT IDENTIFIER ::=
65 * { appleTrustPolicy 2 }
66 * { 1 2 840 113635 100 1 2 }
67 *
68 * BER = 06 09 2A 86 48 86 F7 63 64 01 01
69 */
70 APPLE_TP_X509_BASIC[] = {APPLE_TP_OID, 2},
71
72 /* AppleSSLPolicy := {appleTrustPolicy 3 } */
73 APPLE_TP_SSL[] = {APPLE_TP_OID, 3},
74
75 /* AppleLocalCertGenPolicy := {appleTrustPolicy 4 } */
76 APPLE_TP_LOCAL_CERT_GEN[] = {APPLE_TP_OID, 4},
77
78 /* AppleCSRGenPolicy := {appleTrustPolicy 5 } */
79 APPLE_TP_CSR_GEN[] = {APPLE_TP_OID, 5},
80
81 /*
82 * fee OBJECT IDENTIFIER ::=
83 * { appleSecurityAlgorithm 1 }
84 * { 1 2 840 113635 100 2 1 }
85 *
86 * BER = 06 09 2A 86 48 86 F7 63 64 02 01
87 */
88 APPLE_FEE[] = {APPLE_ALG_OID, 1},
89
90 /*
91 * asc OBJECT IDENTIFIER ::=
92 * { appleSecurityAlgorithm 2 }
93 * { 1 2 840 113635 100 2 2 }
94 *
95 * BER = 06 09 2A 86 48 86 F7 63 64 02 02
96 */
97 APPLE_ASC[] = {APPLE_ALG_OID, 2},
98
99 /*
100 * fee_MD5 OBJECT IDENTIFIER ::=
101 * { appleSecurityAlgorithm 3 }
102 * { 1 2 840 113635 100 2 3 }
103 *
104 * BER = 06 09 2A 86 48 86 F7 63 64 02 03
105 */
106 APPLE_FEE_MD5[] = {APPLE_ALG_OID, 3},
107
108 /*
109 * fee_SHA1 OBJECT IDENTIFIER ::=
110 * { appleSecurityAlgorithm 4 }
111 * { 1 2 840 113635 100 2 4 }
112 *
113 * BER = 06 09 2A 86 48 86 F7 63 64 02 04
114 */
115 APPLE_FEE_SHA1[] = {APPLE_ALG_OID, 4},
116
117 /*
118 * feed OBJECT IDENTIFIER ::=
119 * { appleSecurityAlgorithm 5 }
120 * { 1 2 840 113635 100 2 5 }
121 *
122 * BER = 06 09 2A 86 48 86 F7 63 64 02 05
123 */
124 APPLE_FEED[] = {APPLE_ALG_OID, 5},
125
126 /*
127 * feedExp OBJECT IDENTIFIER ::=
128 * { appleSecurityAlgorithm 6 }
129 * { 1 2 840 113635 100 2 6 }
130 *
131 * BER = 06 09 2A 86 48 86 F7 63 64 02 06
132 */
133 APPLE_FEEDEXP[] = {APPLE_ALG_OID, 6},
134
135 /*
136 * AppleECDSA OBJECT IDENTIFIER ::=
137 * { appleSecurityAlgorithm 7 }
138 * { 1 2 840 113635 100 2 7 }
139 *
140 * BER = 06 09 2A 86 48 86 F7 63 64 02 07
141 */
142 APPLE_ECDSA[] = {APPLE_ALG_OID, 7};
143
144 const CSSM_OID
145
146 CSSMOID_APPLE_ISIGN = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_ISIGN},
147 CSSMOID_APPLE_X509_BASIC = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_X509_BASIC},
148 CSSMOID_APPLE_TP_SSL = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_SSL},
149 CSSMOID_APPLE_TP_LOCAL_CERT_GEN =
150 {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_LOCAL_CERT_GEN},
151 CSSMOID_APPLE_TP_CSR_GEN = {APPLE_TP_OID_LENGTH+1, (uint8 *)APPLE_TP_CSR_GEN},
152 CSSMOID_APPLE_FEE = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEE},
153 CSSMOID_APPLE_ASC = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_ASC},
154 CSSMOID_APPLE_FEE_MD5 = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEE_MD5},
155 CSSMOID_APPLE_FEE_SHA1 = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEE_SHA1},
156 CSSMOID_APPLE_FEED = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEED},
157 CSSMOID_APPLE_FEEDEXP = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_FEEDEXP},
158 CSSMOID_APPLE_ECDSA = {APPLE_ALG_OID_LENGTH+1, (uint8 *)APPLE_ECDSA};
159
160