• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
3  *
4  *  Licensed under the Apache License, Version 2.0 (the License); you may
5  *  not use this file except in compliance with the License.
6  *
7  *  http://www.apache.org/licenses/LICENSE-2.0
8  */
9 
10 
11 
12 #ifndef GMSSL_OID_H
13 #define GMSSL_OID_H
14 
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 enum {
22 	OID_undef = 0,
23 
24 	// ShangMi schemes in GM/T 0006-2012
25 	OID_sm1,
26 	OID_ssf33,
27 	OID_sm4,
28 	OID_zuc,
29 	OID_sm2,
30 	OID_sm2sign,
31 	OID_sm2keyagreement,
32 	OID_sm2encrypt,
33 	OID_sm9,
34 	OID_sm9sign,
35 	OID_sm9keyagreement,
36 	OID_sm9encrypt,
37 	OID_sm3,
38 	OID_sm3_keyless,
39 	OID_hmac_sm3,
40 	OID_sm2sign_with_sm3,
41 	OID_rsasign_with_sm3,
42 	OID_ec_public_key, // X9.62 ecPublicKey
43 	OID_prime192v1,
44 	OID_prime256v1,
45 	OID_secp256k1,
46 	OID_secp192k1,
47 	OID_secp224k1,
48 	OID_secp224r1,
49 	OID_secp384r1,
50 	OID_secp521r1,
51 
52 	OID_at_name,
53 	OID_at_surname,
54 	OID_at_given_name,
55 	OID_at_initials,
56 	OID_at_generation_qualifier,
57 	OID_at_common_name,
58 	OID_at_locality_name,
59 	OID_at_state_or_province_name,
60 	OID_at_organization_name,
61 	OID_at_organizational_unit_name,
62 	OID_at_title,
63 	OID_at_dn_qualifier,
64 	OID_at_country_name,
65 	OID_at_serial_number,
66 	OID_at_pseudonym,
67 	OID_domain_component,
68 	OID_email_address,
69 
70 	// Cert Extensions
71 	OID_ce_authority_key_identifier,
72 	OID_ce_subject_key_identifier,
73 	OID_ce_key_usage,
74 	OID_ce_certificate_policies,
75 	OID_ce_policy_mappings,
76 	OID_ce_subject_alt_name,
77 	OID_ce_issuer_alt_name,
78 	OID_ce_subject_directory_attributes,
79 	OID_ce_basic_constraints,
80 	OID_ce_name_constraints,
81 	OID_ce_policy_constraints,
82 	OID_ce_ext_key_usage,
83 	OID_ce_crl_distribution_points,
84 	OID_ce_inhibit_any_policy,
85 	OID_ce_freshest_crl,
86 	OID_netscape_cert_type,
87 	OID_netscape_cert_comment,
88 	OID_cert_authority_info_access,
89 	OID_ct_precertificate_scts,
90 
91 	// CRL Extensions
92 	//OID_ce_authority_key_identifier,
93 	//OID_ce_issuer_alt_name,
94 	OID_ce_crl_number,
95 	OID_ce_delta_crl_indicator,
96 	OID_ce_issuing_distribution_point,
97 	//OID_ce_freshest_crl,
98 	OID_pe_authority_info_access,
99 
100 	// CRL Entry Extensions
101 	OID_ce_crl_reasons,
102 	OID_ce_invalidity_date,
103 	OID_ce_certificate_issuer,
104 
105 	// X.509 KeyPropuseID
106 	OID_kp_server_auth,
107 	OID_kp_client_auth,
108 	OID_kp_code_signing,
109 	OID_kp_email_protection,
110 	OID_kp_time_stamping,
111 	OID_kp_ocsp_signing,
112 
113 	OID_qt_cps,
114 	OID_qt_unotice,
115 
116 	OID_md5,
117 	OID_sha1,
118 	OID_sha224,
119 	OID_sha256,
120 	OID_sha384,
121 	OID_sha512,
122 	OID_sha512_224,
123 	OID_sha512_256,
124 
125 
126 	OID_hmac_sha1,
127 	OID_hmac_sha224,
128 	OID_hmac_sha256,
129 	OID_hmac_sha384,
130 	OID_hmac_sha512,
131 	OID_hmac_sha512_224,
132 	OID_hmac_sha512_256,
133 
134 	OID_pbkdf2, // {pkcs-5 12}
135 	OID_pbes2,  // {pkcs-5 13}
136 
137 
138 
139 	OID_sm4_ecb, // 1 2 156 10197 1 104 1
140 	OID_sm4_cbc, // 1 2 156 10197 1 104 2
141 
142 	OID_aes,
143 	OID_aes128_cbc,
144 	OID_aes192_cbc,
145 	OID_aes256_cbc,
146 
147 	OID_aes128, // 没有OID
148 
149 	OID_ecdsa_with_sha1,
150 	OID_ecdsa_with_sha224,
151 	OID_ecdsa_with_sha256,
152 	OID_ecdsa_with_sha384,
153 	OID_ecdsa_with_sha512,
154 
155 	OID_rsasign_with_md5,
156 	OID_rsasign_with_sha1,
157 	OID_rsasign_with_sha224,
158 	OID_rsasign_with_sha256,
159 	OID_rsasign_with_sha384,
160 	OID_rsasign_with_sha512,
161 
162 	OID_rsa_encryption,
163 	OID_rsaes_oaep,
164 
165 	OID_any_policy,
166 
167 	OID_cms_data,
168 	OID_cms_signed_data,
169 	OID_cms_enveloped_data,
170 	OID_cms_signed_and_enveloped_data,
171 	OID_cms_encrypted_data,
172 	OID_cms_key_agreement_info,
173 };
174 
175 // {iso(1) org(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
176 #define oid_pkix	1,3,6,1,5,5,7
177 
178 #define oid_pe		oid_pkix,1
179 #define oid_qt		oid_pkix,2
180 #define oid_kp		oid_pkix,3
181 #define oid_ad		oid_pkix,48
182 
183 // {iso(1) member-body(2) us(840) rsadsi(113549)}
184 #define oid_rsadsi	1,2,840,113549
185 #define oid_pkcs	oid_rsadsi,1
186 #define oid_pkcs5	oid_pkcs,5
187 
188 // {iso(1) member-body(2) us(840) ansi-x962(10045)}
189 #define oid_x9_62	1,2,840,10045
190 
191 
192 
193 #define oid_at	2,5,4
194 #define oid_ce	2,5,29
195 
196 
197 #define oid_sm		1,2,156,10197
198 #define oid_sm_algors	oid_sm,1
199 #define oid_sm2_cms	oid_sm,6,1,4,2
200 
201 
202 
203 
204 
205 #define oid_cnt(nodes)	(sizeof(nodes)/sizeof(int))
206 
207 
208 
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 #endif
214