oid.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*
  2. * Copyright 2014-2023 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. #ifndef GMSSL_OID_H
  10. #define GMSSL_OID_H
  11. #include <stdint.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. enum {
  16. OID_undef = 0,
  17. // ShangMi schemes in GM/T 0006-2012
  18. OID_sm1,
  19. OID_ssf33,
  20. OID_sm4,
  21. OID_zuc,
  22. OID_sm2,
  23. OID_sm2sign,
  24. OID_sm2keyagreement,
  25. OID_sm2encrypt,
  26. OID_sm9,
  27. OID_sm9sign,
  28. OID_sm9keyagreement,
  29. OID_sm9encrypt,
  30. OID_sm3,
  31. OID_sm3_keyless,
  32. OID_hmac_sm3,
  33. OID_sm2sign_with_sm3,
  34. OID_rsasign_with_sm3,
  35. OID_ec_public_key, // X9.62 ecPublicKey
  36. OID_prime192v1,
  37. OID_prime256v1,
  38. OID_secp256k1,
  39. OID_secp192k1,
  40. OID_secp224k1,
  41. OID_secp224r1,
  42. OID_secp384r1,
  43. OID_secp521r1,
  44. OID_at_name,
  45. OID_at_surname,
  46. OID_at_given_name,
  47. OID_at_initials,
  48. OID_at_generation_qualifier,
  49. OID_at_common_name,
  50. OID_at_locality_name,
  51. OID_at_state_or_province_name,
  52. OID_at_organization_name,
  53. OID_at_organizational_unit_name,
  54. OID_at_title,
  55. OID_at_dn_qualifier,
  56. OID_at_country_name,
  57. OID_at_serial_number,
  58. OID_at_pseudonym,
  59. OID_domain_component,
  60. OID_email_address,
  61. // Cert Extensions
  62. OID_ce_authority_key_identifier,
  63. OID_ce_subject_key_identifier,
  64. OID_ce_key_usage,
  65. OID_ce_certificate_policies,
  66. OID_ce_policy_mappings,
  67. OID_ce_subject_alt_name,
  68. OID_ce_issuer_alt_name,
  69. OID_ce_subject_directory_attributes,
  70. OID_ce_basic_constraints,
  71. OID_ce_name_constraints,
  72. OID_ce_policy_constraints,
  73. OID_ce_ext_key_usage,
  74. OID_ce_crl_distribution_points,
  75. OID_ce_inhibit_any_policy,
  76. OID_ce_freshest_crl,
  77. OID_netscape_cert_type,
  78. OID_netscape_cert_comment,
  79. OID_ct_precertificate_scts,
  80. OID_ad_ca_issuers,
  81. OID_ad_ocsp,
  82. // CRL Extensions
  83. //OID_ce_authority_key_identifier,
  84. //OID_ce_issuer_alt_name,
  85. OID_ce_crl_number,
  86. OID_ce_delta_crl_indicator,
  87. OID_ce_issuing_distribution_point,
  88. //OID_ce_freshest_crl,
  89. OID_pe_authority_info_access,
  90. // CRL Entry Extensions
  91. OID_ce_crl_reasons,
  92. OID_ce_invalidity_date,
  93. OID_ce_certificate_issuer,
  94. // X.509 KeyPropuseID
  95. OID_any_extended_key_usage,
  96. OID_kp_server_auth,
  97. OID_kp_client_auth,
  98. OID_kp_code_signing,
  99. OID_kp_email_protection,
  100. OID_kp_time_stamping,
  101. OID_kp_ocsp_signing,
  102. OID_qt_cps,
  103. OID_qt_unotice,
  104. OID_md5,
  105. OID_sha1,
  106. OID_sha224,
  107. OID_sha256,
  108. OID_sha384,
  109. OID_sha512,
  110. OID_sha512_224,
  111. OID_sha512_256,
  112. OID_hmac_sha1,
  113. OID_hmac_sha224,
  114. OID_hmac_sha256,
  115. OID_hmac_sha384,
  116. OID_hmac_sha512,
  117. OID_hmac_sha512_224,
  118. OID_hmac_sha512_256,
  119. OID_pbkdf2, // {pkcs-5 12}
  120. OID_pbes2, // {pkcs-5 13}
  121. OID_sm4_ecb, // 1 2 156 10197 1 104 1
  122. OID_sm4_cbc, // 1 2 156 10197 1 104 2
  123. OID_aes,
  124. OID_aes128_cbc,
  125. OID_aes192_cbc,
  126. OID_aes256_cbc,
  127. OID_aes128, // 没有OID
  128. OID_ecdsa_with_sha1,
  129. OID_ecdsa_with_sha224,
  130. OID_ecdsa_with_sha256,
  131. OID_ecdsa_with_sha384,
  132. OID_ecdsa_with_sha512,
  133. OID_rsasign_with_md5,
  134. OID_rsasign_with_sha1,
  135. OID_rsasign_with_sha224,
  136. OID_rsasign_with_sha256,
  137. OID_rsasign_with_sha384,
  138. OID_rsasign_with_sha512,
  139. OID_rsa_encryption,
  140. OID_rsaes_oaep,
  141. OID_any_policy,
  142. OID_cms_data,
  143. OID_cms_signed_data,
  144. OID_cms_enveloped_data,
  145. OID_cms_signed_and_enveloped_data,
  146. OID_cms_encrypted_data,
  147. OID_cms_key_agreement_info,
  148. };
  149. // {iso(1) org(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7)}
  150. #define oid_pkix 1,3,6,1,5,5,7
  151. #define oid_pe oid_pkix,1
  152. #define oid_qt oid_pkix,2
  153. #define oid_kp oid_pkix,3
  154. #define oid_ad oid_pkix,48
  155. // {iso(1) member-body(2) us(840) rsadsi(113549)}
  156. #define oid_rsadsi 1,2,840,113549
  157. #define oid_pkcs oid_rsadsi,1
  158. #define oid_pkcs5 oid_pkcs,5
  159. // {iso(1) member-body(2) us(840) ansi-x962(10045)}
  160. #define oid_x9_62 1,2,840,10045
  161. #define oid_at 2,5,4
  162. #define oid_ce 2,5,29
  163. #define oid_sm 1,2,156,10197
  164. #define oid_sm_algors oid_sm,1
  165. #define oid_sm2_cms oid_sm,6,1,4,2
  166. #define oid_cnt(nodes) (sizeof(nodes)/sizeof((nodes)[0]))
  167. #ifdef __cplusplus
  168. }
  169. #endif
  170. #endif