win32cryptcon.py 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900
  1. # Generated by h2py from WinCrypt.h
  2. def GET_ALG_CLASS(x): return (x & (7 << 13))
  3. def GET_ALG_TYPE(x): return (x & (15 << 9))
  4. def GET_ALG_SID(x): return (x & (511))
  5. ALG_CLASS_ANY = (0)
  6. ALG_CLASS_SIGNATURE = (1 << 13)
  7. ALG_CLASS_MSG_ENCRYPT = (2 << 13)
  8. ALG_CLASS_DATA_ENCRYPT = (3 << 13)
  9. ALG_CLASS_HASH = (4 << 13)
  10. ALG_CLASS_KEY_EXCHANGE = (5 << 13)
  11. ALG_CLASS_ALL = (7 << 13)
  12. ALG_TYPE_ANY = (0)
  13. ALG_TYPE_DSS = (1 << 9)
  14. ALG_TYPE_RSA = (2 << 9)
  15. ALG_TYPE_BLOCK = (3 << 9)
  16. ALG_TYPE_STREAM = (4 << 9)
  17. ALG_TYPE_DH = (5 << 9)
  18. ALG_TYPE_SECURECHANNEL = (6 << 9)
  19. ALG_SID_ANY = (0)
  20. ALG_SID_RSA_ANY = 0
  21. ALG_SID_RSA_PKCS = 1
  22. ALG_SID_RSA_MSATWORK = 2
  23. ALG_SID_RSA_ENTRUST = 3
  24. ALG_SID_RSA_PGP = 4
  25. ALG_SID_DSS_ANY = 0
  26. ALG_SID_DSS_PKCS = 1
  27. ALG_SID_DSS_DMS = 2
  28. ALG_SID_DES = 1
  29. ALG_SID_3DES = 3
  30. ALG_SID_DESX = 4
  31. ALG_SID_IDEA = 5
  32. ALG_SID_CAST = 6
  33. ALG_SID_SAFERSK64 = 7
  34. ALG_SID_SAFERSK128 = 8
  35. ALG_SID_3DES_112 = 9
  36. ALG_SID_CYLINK_MEK = 12
  37. ALG_SID_RC5 = 13
  38. ALG_SID_AES_128 = 14
  39. ALG_SID_AES_192 = 15
  40. ALG_SID_AES_256 = 16
  41. ALG_SID_AES = 17
  42. ALG_SID_SKIPJACK = 10
  43. ALG_SID_TEK = 11
  44. CRYPT_MODE_CBCI = 6
  45. CRYPT_MODE_CFBP = 7
  46. CRYPT_MODE_OFBP = 8
  47. CRYPT_MODE_CBCOFM = 9
  48. CRYPT_MODE_CBCOFMI = 10
  49. ALG_SID_RC2 = 2
  50. ALG_SID_RC4 = 1
  51. ALG_SID_SEAL = 2
  52. ALG_SID_DH_SANDF = 1
  53. ALG_SID_DH_EPHEM = 2
  54. ALG_SID_AGREED_KEY_ANY = 3
  55. ALG_SID_KEA = 4
  56. ALG_SID_MD2 = 1
  57. ALG_SID_MD4 = 2
  58. ALG_SID_MD5 = 3
  59. ALG_SID_SHA = 4
  60. ALG_SID_SHA1 = 4
  61. ALG_SID_MAC = 5
  62. ALG_SID_RIPEMD = 6
  63. ALG_SID_RIPEMD160 = 7
  64. ALG_SID_SSL3SHAMD5 = 8
  65. ALG_SID_HMAC = 9
  66. ALG_SID_TLS1PRF = 10
  67. ALG_SID_HASH_REPLACE_OWF = 11
  68. ALG_SID_SHA_256 = 12
  69. ALG_SID_SHA_384 = 13
  70. ALG_SID_SHA_512 = 14
  71. ALG_SID_SSL3_MASTER = 1
  72. ALG_SID_SCHANNEL_MASTER_HASH = 2
  73. ALG_SID_SCHANNEL_MAC_KEY = 3
  74. ALG_SID_PCT1_MASTER = 4
  75. ALG_SID_SSL2_MASTER = 5
  76. ALG_SID_TLS1_MASTER = 6
  77. ALG_SID_SCHANNEL_ENC_KEY = 7
  78. ALG_SID_EXAMPLE = 80
  79. CALG_MD2 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2)
  80. CALG_MD4 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4)
  81. CALG_MD5 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5)
  82. CALG_SHA = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA)
  83. CALG_SHA1 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1)
  84. CALG_MAC = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC)
  85. CALG_RSA_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY)
  86. CALG_DSS_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY)
  87. CALG_NO_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY)
  88. CALG_RSA_KEYX = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA_ANY)
  89. CALG_DES = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DES)
  90. CALG_3DES_112 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3DES_112)
  91. CALG_3DES = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3DES)
  92. CALG_DESX = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX)
  93. CALG_RC2 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC2)
  94. CALG_RC4 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_RC4)
  95. CALG_SEAL = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_SEAL)
  96. CALG_DH_SF = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_SANDF)
  97. CALG_DH_EPHEM = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_EPHEM)
  98. CALG_AGREEDKEY_ANY = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_AGREED_KEY_ANY)
  99. CALG_KEA_KEYX = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_KEA)
  100. CALG_HUGHES_MD5 = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_ANY|ALG_SID_MD5)
  101. CALG_SKIPJACK = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_SKIPJACK)
  102. CALG_TEK = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_TEK)
  103. CALG_CYLINK_MEK = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_CYLINK_MEK)
  104. CALG_SSL3_SHAMD5 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5)
  105. CALG_SSL3_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SSL3_MASTER)
  106. CALG_SCHANNEL_MASTER_HASH = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_MASTER_HASH)
  107. CALG_SCHANNEL_MAC_KEY = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_MAC_KEY)
  108. CALG_SCHANNEL_ENC_KEY = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_ENC_KEY)
  109. CALG_PCT1_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_PCT1_MASTER)
  110. CALG_SSL2_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SSL2_MASTER)
  111. CALG_TLS1_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_TLS1_MASTER)
  112. CALG_RC5 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC5)
  113. CALG_HMAC = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC)
  114. CALG_TLS1PRF = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF)
  115. CALG_HASH_REPLACE_OWF = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF)
  116. CALG_AES_128 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128)
  117. CALG_AES_192 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_192)
  118. CALG_AES_256 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_256)
  119. CALG_AES = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES)
  120. CALG_SHA_256 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256)
  121. CALG_SHA_384 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384)
  122. CALG_SHA_512 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512)
  123. CRYPT_VERIFYCONTEXT = (-268435456)
  124. CRYPT_NEWKEYSET = 0x00000008
  125. CRYPT_DELETEKEYSET = 0x00000010
  126. CRYPT_MACHINE_KEYSET = 0x00000020
  127. CRYPT_SILENT = 0x00000040
  128. CRYPT_EXPORTABLE = 0x00000001
  129. CRYPT_USER_PROTECTED = 0x00000002
  130. CRYPT_CREATE_SALT = 0x00000004
  131. CRYPT_UPDATE_KEY = 0x00000008
  132. CRYPT_NO_SALT = 0x00000010
  133. CRYPT_PREGEN = 0x00000040
  134. CRYPT_RECIPIENT = 0x00000010
  135. CRYPT_INITIATOR = 0x00000040
  136. CRYPT_ONLINE = 0x00000080
  137. CRYPT_SF = 0x00000100
  138. CRYPT_CREATE_IV = 0x00000200
  139. CRYPT_KEK = 0x00000400
  140. CRYPT_DATA_KEY = 0x00000800
  141. CRYPT_VOLATILE = 0x00001000
  142. CRYPT_SGCKEY = 0x00002000
  143. CRYPT_ARCHIVABLE = 0x00004000
  144. RSA1024BIT_KEY = 0x04000000
  145. CRYPT_SERVER = 0x00000400
  146. KEY_LENGTH_MASK = (-65536)
  147. CRYPT_Y_ONLY = 0x00000001
  148. CRYPT_SSL2_FALLBACK = 0x00000002
  149. CRYPT_DESTROYKEY = 0x00000004
  150. CRYPT_OAEP = 0x00000040
  151. CRYPT_BLOB_VER3 = 0x00000080
  152. CRYPT_IPSEC_HMAC_KEY = 0x00000100
  153. CRYPT_DECRYPT_RSA_NO_PADDING_CHECK = 0x00000020
  154. CRYPT_SECRETDIGEST = 0x00000001
  155. CRYPT_OWF_REPL_LM_HASH = 0x00000001
  156. CRYPT_LITTLE_ENDIAN = 0x00000001
  157. CRYPT_NOHASHOID = 0x00000001
  158. CRYPT_TYPE2_FORMAT = 0x00000002
  159. CRYPT_X931_FORMAT = 0x00000004
  160. CRYPT_MACHINE_DEFAULT = 0x00000001
  161. CRYPT_USER_DEFAULT = 0x00000002
  162. CRYPT_DELETE_DEFAULT = 0x00000004
  163. SIMPLEBLOB = 0x1
  164. PUBLICKEYBLOB = 0x6
  165. PRIVATEKEYBLOB = 0x7
  166. PLAINTEXTKEYBLOB = 0x8
  167. OPAQUEKEYBLOB = 0x9
  168. PUBLICKEYBLOBEX = 0xA
  169. SYMMETRICWRAPKEYBLOB = 0xB
  170. AT_KEYEXCHANGE = 1
  171. AT_SIGNATURE = 2
  172. CRYPT_USERDATA = 1
  173. KP_IV = 1
  174. KP_SALT = 2
  175. KP_PADDING = 3
  176. KP_MODE = 4
  177. KP_MODE_BITS = 5
  178. KP_PERMISSIONS = 6
  179. KP_ALGID = 7
  180. KP_BLOCKLEN = 8
  181. KP_KEYLEN = 9
  182. KP_SALT_EX = 10
  183. KP_P = 11
  184. KP_G = 12
  185. KP_Q = 13
  186. KP_X = 14
  187. KP_Y = 15
  188. KP_RA = 16
  189. KP_RB = 17
  190. KP_INFO = 18
  191. KP_EFFECTIVE_KEYLEN = 19
  192. KP_SCHANNEL_ALG = 20
  193. KP_CLIENT_RANDOM = 21
  194. KP_SERVER_RANDOM = 22
  195. KP_RP = 23
  196. KP_PRECOMP_MD5 = 24
  197. KP_PRECOMP_SHA = 25
  198. KP_CERTIFICATE = 26
  199. KP_CLEAR_KEY = 27
  200. KP_PUB_EX_LEN = 28
  201. KP_PUB_EX_VAL = 29
  202. KP_KEYVAL = 30
  203. KP_ADMIN_PIN = 31
  204. KP_KEYEXCHANGE_PIN = 32
  205. KP_SIGNATURE_PIN = 33
  206. KP_PREHASH = 34
  207. KP_ROUNDS = 35
  208. KP_OAEP_PARAMS = 36
  209. KP_CMS_KEY_INFO = 37
  210. KP_CMS_DH_KEY_INFO = 38
  211. KP_PUB_PARAMS = 39
  212. KP_VERIFY_PARAMS = 40
  213. KP_HIGHEST_VERSION = 41
  214. KP_GET_USE_COUNT = 42
  215. PKCS5_PADDING = 1
  216. RANDOM_PADDING = 2
  217. ZERO_PADDING = 3
  218. CRYPT_MODE_CBC = 1
  219. CRYPT_MODE_ECB = 2
  220. CRYPT_MODE_OFB = 3
  221. CRYPT_MODE_CFB = 4
  222. CRYPT_MODE_CTS = 5
  223. CRYPT_ENCRYPT = 0x0001
  224. CRYPT_DECRYPT = 0x0002
  225. CRYPT_EXPORT = 0x0004
  226. CRYPT_READ = 0x0008
  227. CRYPT_WRITE = 0x0010
  228. CRYPT_MAC = 0x0020
  229. CRYPT_EXPORT_KEY = 0x0040
  230. CRYPT_IMPORT_KEY = 0x0080
  231. CRYPT_ARCHIVE = 0x0100
  232. HP_ALGID = 0x0001
  233. HP_HASHVAL = 0x0002
  234. HP_HASHSIZE = 0x0004
  235. HP_HMAC_INFO = 0x0005
  236. HP_TLS1PRF_LABEL = 0x0006
  237. HP_TLS1PRF_SEED = 0x0007
  238. CRYPT_FAILED = 0
  239. CRYPT_SUCCEED = 1
  240. def RCRYPT_SUCCEEDED(rt): return ((rt) == CRYPT_SUCCEED)
  241. def RCRYPT_FAILED(rt): return ((rt) == CRYPT_FAILED)
  242. PP_ENUMALGS = 1
  243. PP_ENUMCONTAINERS = 2
  244. PP_IMPTYPE = 3
  245. PP_NAME = 4
  246. PP_VERSION = 5
  247. PP_CONTAINER = 6
  248. PP_CHANGE_PASSWORD = 7
  249. PP_KEYSET_SEC_DESCR = 8
  250. PP_CERTCHAIN = 9
  251. PP_KEY_TYPE_SUBTYPE = 10
  252. PP_PROVTYPE = 16
  253. PP_KEYSTORAGE = 17
  254. PP_APPLI_CERT = 18
  255. PP_SYM_KEYSIZE = 19
  256. PP_SESSION_KEYSIZE = 20
  257. PP_UI_PROMPT = 21
  258. PP_ENUMALGS_EX = 22
  259. PP_ENUMMANDROOTS = 25
  260. PP_ENUMELECTROOTS = 26
  261. PP_KEYSET_TYPE = 27
  262. PP_ADMIN_PIN = 31
  263. PP_KEYEXCHANGE_PIN = 32
  264. PP_SIGNATURE_PIN = 33
  265. PP_SIG_KEYSIZE_INC = 34
  266. PP_KEYX_KEYSIZE_INC = 35
  267. PP_UNIQUE_CONTAINER = 36
  268. PP_SGC_INFO = 37
  269. PP_USE_HARDWARE_RNG = 38
  270. PP_KEYSPEC = 39
  271. PP_ENUMEX_SIGNING_PROT = 40
  272. PP_CRYPT_COUNT_KEY_USE = 41
  273. CRYPT_FIRST = 1
  274. CRYPT_NEXT = 2
  275. CRYPT_SGC_ENUM = 4
  276. CRYPT_IMPL_HARDWARE = 1
  277. CRYPT_IMPL_SOFTWARE = 2
  278. CRYPT_IMPL_MIXED = 3
  279. CRYPT_IMPL_UNKNOWN = 4
  280. CRYPT_IMPL_REMOVABLE = 8
  281. CRYPT_SEC_DESCR = 0x00000001
  282. CRYPT_PSTORE = 0x00000002
  283. CRYPT_UI_PROMPT = 0x00000004
  284. CRYPT_FLAG_PCT1 = 0x0001
  285. CRYPT_FLAG_SSL2 = 0x0002
  286. CRYPT_FLAG_SSL3 = 0x0004
  287. CRYPT_FLAG_TLS1 = 0x0008
  288. CRYPT_FLAG_IPSEC = 0x0010
  289. CRYPT_FLAG_SIGNING = 0x0020
  290. CRYPT_SGC = 0x0001
  291. CRYPT_FASTSGC = 0x0002
  292. PP_CLIENT_HWND = 1
  293. PP_CONTEXT_INFO = 11
  294. PP_KEYEXCHANGE_KEYSIZE = 12
  295. PP_SIGNATURE_KEYSIZE = 13
  296. PP_KEYEXCHANGE_ALG = 14
  297. PP_SIGNATURE_ALG = 15
  298. PP_DELETEKEY = 24
  299. PROV_RSA_FULL = 1
  300. PROV_RSA_SIG = 2
  301. PROV_DSS = 3
  302. PROV_FORTEZZA = 4
  303. PROV_MS_EXCHANGE = 5
  304. PROV_SSL = 6
  305. PROV_RSA_SCHANNEL = 12
  306. PROV_DSS_DH = 13
  307. PROV_EC_ECDSA_SIG = 14
  308. PROV_EC_ECNRA_SIG = 15
  309. PROV_EC_ECDSA_FULL = 16
  310. PROV_EC_ECNRA_FULL = 17
  311. PROV_DH_SCHANNEL = 18
  312. PROV_SPYRUS_LYNKS = 20
  313. PROV_RNG = 21
  314. PROV_INTEL_SEC = 22
  315. PROV_REPLACE_OWF = 23
  316. PROV_RSA_AES = 24
  317. MS_DEF_PROV_A = "Microsoft Base Cryptographic Provider v1.0"
  318. MS_DEF_PROV = MS_DEF_PROV_A
  319. MS_ENHANCED_PROV_A = "Microsoft Enhanced Cryptographic Provider v1.0"
  320. MS_ENHANCED_PROV = MS_ENHANCED_PROV_A
  321. MS_STRONG_PROV_A = "Microsoft Strong Cryptographic Provider"
  322. MS_STRONG_PROV = MS_STRONG_PROV_A
  323. MS_DEF_RSA_SIG_PROV_A = "Microsoft RSA Signature Cryptographic Provider"
  324. MS_DEF_RSA_SIG_PROV = MS_DEF_RSA_SIG_PROV_A
  325. MS_DEF_RSA_SCHANNEL_PROV_A = "Microsoft RSA SChannel Cryptographic Provider"
  326. MS_DEF_RSA_SCHANNEL_PROV = MS_DEF_RSA_SCHANNEL_PROV_A
  327. MS_DEF_DSS_PROV_A = "Microsoft Base DSS Cryptographic Provider"
  328. MS_DEF_DSS_PROV = MS_DEF_DSS_PROV_A
  329. MS_DEF_DSS_DH_PROV_A = "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
  330. MS_DEF_DSS_DH_PROV = MS_DEF_DSS_DH_PROV_A
  331. MS_ENH_DSS_DH_PROV_A = "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"
  332. MS_ENH_DSS_DH_PROV = MS_ENH_DSS_DH_PROV_A
  333. MS_DEF_DH_SCHANNEL_PROV_A = "Microsoft DH SChannel Cryptographic Provider"
  334. MS_DEF_DH_SCHANNEL_PROV = MS_DEF_DH_SCHANNEL_PROV_A
  335. MS_SCARD_PROV_A = "Microsoft Base Smart Card Crypto Provider"
  336. MS_SCARD_PROV = MS_SCARD_PROV_A
  337. MS_ENH_RSA_AES_PROV_A = "Microsoft Enhanced RSA and AES Cryptographic Provider"
  338. MS_ENH_RSA_AES_PROV = MS_ENH_RSA_AES_PROV_A
  339. MAXUIDLEN = 64
  340. EXPO_OFFLOAD_REG_VALUE = "ExpoOffload"
  341. EXPO_OFFLOAD_FUNC_NAME = "OffloadModExpo"
  342. szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS = \
  343. "Software\\Policies\\Microsoft\\Cryptography"
  344. szFORCE_KEY_PROTECTION = "ForceKeyProtection"
  345. dwFORCE_KEY_PROTECTION_DISABLED = 0x0
  346. dwFORCE_KEY_PROTECTION_USER_SELECT = 0x1
  347. dwFORCE_KEY_PROTECTION_HIGH = 0x2
  348. szKEY_CACHE_ENABLED = "CachePrivateKeys"
  349. szKEY_CACHE_SECONDS = "PrivateKeyLifetimeSeconds"
  350. CUR_BLOB_VERSION = 2
  351. SCHANNEL_MAC_KEY = 0x00000000
  352. SCHANNEL_ENC_KEY = 0x00000001
  353. INTERNATIONAL_USAGE = 0x00000001
  354. szOID_RSA = "1.2.840.113549"
  355. szOID_PKCS = "1.2.840.113549.1"
  356. szOID_RSA_HASH = "1.2.840.113549.2"
  357. szOID_RSA_ENCRYPT = "1.2.840.113549.3"
  358. szOID_PKCS_1 = "1.2.840.113549.1.1"
  359. szOID_PKCS_2 = "1.2.840.113549.1.2"
  360. szOID_PKCS_3 = "1.2.840.113549.1.3"
  361. szOID_PKCS_4 = "1.2.840.113549.1.4"
  362. szOID_PKCS_5 = "1.2.840.113549.1.5"
  363. szOID_PKCS_6 = "1.2.840.113549.1.6"
  364. szOID_PKCS_7 = "1.2.840.113549.1.7"
  365. szOID_PKCS_8 = "1.2.840.113549.1.8"
  366. szOID_PKCS_9 = "1.2.840.113549.1.9"
  367. szOID_PKCS_10 = "1.2.840.113549.1.10"
  368. szOID_PKCS_12 = "1.2.840.113549.1.12"
  369. szOID_RSA_RSA = "1.2.840.113549.1.1.1"
  370. szOID_RSA_MD2RSA = "1.2.840.113549.1.1.2"
  371. szOID_RSA_MD4RSA = "1.2.840.113549.1.1.3"
  372. szOID_RSA_MD5RSA = "1.2.840.113549.1.1.4"
  373. szOID_RSA_SHA1RSA = "1.2.840.113549.1.1.5"
  374. szOID_RSA_SETOAEP_RSA = "1.2.840.113549.1.1.6"
  375. szOID_RSA_DH = "1.2.840.113549.1.3.1"
  376. szOID_RSA_data = "1.2.840.113549.1.7.1"
  377. szOID_RSA_signedData = "1.2.840.113549.1.7.2"
  378. szOID_RSA_envelopedData = "1.2.840.113549.1.7.3"
  379. szOID_RSA_signEnvData = "1.2.840.113549.1.7.4"
  380. szOID_RSA_digestedData = "1.2.840.113549.1.7.5"
  381. szOID_RSA_hashedData = "1.2.840.113549.1.7.5"
  382. szOID_RSA_encryptedData = "1.2.840.113549.1.7.6"
  383. szOID_RSA_emailAddr = "1.2.840.113549.1.9.1"
  384. szOID_RSA_unstructName = "1.2.840.113549.1.9.2"
  385. szOID_RSA_contentType = "1.2.840.113549.1.9.3"
  386. szOID_RSA_messageDigest = "1.2.840.113549.1.9.4"
  387. szOID_RSA_signingTime = "1.2.840.113549.1.9.5"
  388. szOID_RSA_counterSign = "1.2.840.113549.1.9.6"
  389. szOID_RSA_challengePwd = "1.2.840.113549.1.9.7"
  390. szOID_RSA_unstructAddr = "1.2.840.113549.1.9.8"
  391. szOID_RSA_extCertAttrs = "1.2.840.113549.1.9.9"
  392. szOID_RSA_certExtensions = "1.2.840.113549.1.9.14"
  393. szOID_RSA_SMIMECapabilities = "1.2.840.113549.1.9.15"
  394. szOID_RSA_preferSignedData = "1.2.840.113549.1.9.15.1"
  395. szOID_RSA_SMIMEalg = "1.2.840.113549.1.9.16.3"
  396. szOID_RSA_SMIMEalgESDH = "1.2.840.113549.1.9.16.3.5"
  397. szOID_RSA_SMIMEalgCMS3DESwrap = "1.2.840.113549.1.9.16.3.6"
  398. szOID_RSA_SMIMEalgCMSRC2wrap = "1.2.840.113549.1.9.16.3.7"
  399. szOID_RSA_MD2 = "1.2.840.113549.2.2"
  400. szOID_RSA_MD4 = "1.2.840.113549.2.4"
  401. szOID_RSA_MD5 = "1.2.840.113549.2.5"
  402. szOID_RSA_RC2CBC = "1.2.840.113549.3.2"
  403. szOID_RSA_RC4 = "1.2.840.113549.3.4"
  404. szOID_RSA_DES_EDE3_CBC = "1.2.840.113549.3.7"
  405. szOID_RSA_RC5_CBCPad = "1.2.840.113549.3.9"
  406. szOID_ANSI_X942 = "1.2.840.10046"
  407. szOID_ANSI_X942_DH = "1.2.840.10046.2.1"
  408. szOID_X957 = "1.2.840.10040"
  409. szOID_X957_DSA = "1.2.840.10040.4.1"
  410. szOID_X957_SHA1DSA = "1.2.840.10040.4.3"
  411. szOID_DS = "2.5"
  412. szOID_DSALG = "2.5.8"
  413. szOID_DSALG_CRPT = "2.5.8.1"
  414. szOID_DSALG_HASH = "2.5.8.2"
  415. szOID_DSALG_SIGN = "2.5.8.3"
  416. szOID_DSALG_RSA = "2.5.8.1.1"
  417. szOID_OIW = "1.3.14"
  418. szOID_OIWSEC = "1.3.14.3.2"
  419. szOID_OIWSEC_md4RSA = "1.3.14.3.2.2"
  420. szOID_OIWSEC_md5RSA = "1.3.14.3.2.3"
  421. szOID_OIWSEC_md4RSA2 = "1.3.14.3.2.4"
  422. szOID_OIWSEC_desECB = "1.3.14.3.2.6"
  423. szOID_OIWSEC_desCBC = "1.3.14.3.2.7"
  424. szOID_OIWSEC_desOFB = "1.3.14.3.2.8"
  425. szOID_OIWSEC_desCFB = "1.3.14.3.2.9"
  426. szOID_OIWSEC_desMAC = "1.3.14.3.2.10"
  427. szOID_OIWSEC_rsaSign = "1.3.14.3.2.11"
  428. szOID_OIWSEC_dsa = "1.3.14.3.2.12"
  429. szOID_OIWSEC_shaDSA = "1.3.14.3.2.13"
  430. szOID_OIWSEC_mdc2RSA = "1.3.14.3.2.14"
  431. szOID_OIWSEC_shaRSA = "1.3.14.3.2.15"
  432. szOID_OIWSEC_dhCommMod = "1.3.14.3.2.16"
  433. szOID_OIWSEC_desEDE = "1.3.14.3.2.17"
  434. szOID_OIWSEC_sha = "1.3.14.3.2.18"
  435. szOID_OIWSEC_mdc2 = "1.3.14.3.2.19"
  436. szOID_OIWSEC_dsaComm = "1.3.14.3.2.20"
  437. szOID_OIWSEC_dsaCommSHA = "1.3.14.3.2.21"
  438. szOID_OIWSEC_rsaXchg = "1.3.14.3.2.22"
  439. szOID_OIWSEC_keyHashSeal = "1.3.14.3.2.23"
  440. szOID_OIWSEC_md2RSASign = "1.3.14.3.2.24"
  441. szOID_OIWSEC_md5RSASign = "1.3.14.3.2.25"
  442. szOID_OIWSEC_sha1 = "1.3.14.3.2.26"
  443. szOID_OIWSEC_dsaSHA1 = "1.3.14.3.2.27"
  444. szOID_OIWSEC_dsaCommSHA1 = "1.3.14.3.2.28"
  445. szOID_OIWSEC_sha1RSASign = "1.3.14.3.2.29"
  446. szOID_OIWDIR = "1.3.14.7.2"
  447. szOID_OIWDIR_CRPT = "1.3.14.7.2.1"
  448. szOID_OIWDIR_HASH = "1.3.14.7.2.2"
  449. szOID_OIWDIR_SIGN = "1.3.14.7.2.3"
  450. szOID_OIWDIR_md2 = "1.3.14.7.2.2.1"
  451. szOID_OIWDIR_md2RSA = "1.3.14.7.2.3.1"
  452. szOID_INFOSEC = "2.16.840.1.101.2.1"
  453. szOID_INFOSEC_sdnsSignature = "2.16.840.1.101.2.1.1.1"
  454. szOID_INFOSEC_mosaicSignature = "2.16.840.1.101.2.1.1.2"
  455. szOID_INFOSEC_sdnsConfidentiality = "2.16.840.1.101.2.1.1.3"
  456. szOID_INFOSEC_mosaicConfidentiality = "2.16.840.1.101.2.1.1.4"
  457. szOID_INFOSEC_sdnsIntegrity = "2.16.840.1.101.2.1.1.5"
  458. szOID_INFOSEC_mosaicIntegrity = "2.16.840.1.101.2.1.1.6"
  459. szOID_INFOSEC_sdnsTokenProtection = "2.16.840.1.101.2.1.1.7"
  460. szOID_INFOSEC_mosaicTokenProtection = "2.16.840.1.101.2.1.1.8"
  461. szOID_INFOSEC_sdnsKeyManagement = "2.16.840.1.101.2.1.1.9"
  462. szOID_INFOSEC_mosaicKeyManagement = "2.16.840.1.101.2.1.1.10"
  463. szOID_INFOSEC_sdnsKMandSig = "2.16.840.1.101.2.1.1.11"
  464. szOID_INFOSEC_mosaicKMandSig = "2.16.840.1.101.2.1.1.12"
  465. szOID_INFOSEC_SuiteASignature = "2.16.840.1.101.2.1.1.13"
  466. szOID_INFOSEC_SuiteAConfidentiality = "2.16.840.1.101.2.1.1.14"
  467. szOID_INFOSEC_SuiteAIntegrity = "2.16.840.1.101.2.1.1.15"
  468. szOID_INFOSEC_SuiteATokenProtection = "2.16.840.1.101.2.1.1.16"
  469. szOID_INFOSEC_SuiteAKeyManagement = "2.16.840.1.101.2.1.1.17"
  470. szOID_INFOSEC_SuiteAKMandSig = "2.16.840.1.101.2.1.1.18"
  471. szOID_INFOSEC_mosaicUpdatedSig = "2.16.840.1.101.2.1.1.19"
  472. szOID_INFOSEC_mosaicKMandUpdSig = "2.16.840.1.101.2.1.1.20"
  473. szOID_INFOSEC_mosaicUpdatedInteg = "2.16.840.1.101.2.1.1.21"
  474. szOID_COMMON_NAME = "2.5.4.3"
  475. szOID_SUR_NAME = "2.5.4.4"
  476. szOID_DEVICE_SERIAL_NUMBER = "2.5.4.5"
  477. szOID_COUNTRY_NAME = "2.5.4.6"
  478. szOID_LOCALITY_NAME = "2.5.4.7"
  479. szOID_STATE_OR_PROVINCE_NAME = "2.5.4.8"
  480. szOID_STREET_ADDRESS = "2.5.4.9"
  481. szOID_ORGANIZATION_NAME = "2.5.4.10"
  482. szOID_ORGANIZATIONAL_UNIT_NAME = "2.5.4.11"
  483. szOID_TITLE = "2.5.4.12"
  484. szOID_DESCRIPTION = "2.5.4.13"
  485. szOID_SEARCH_GUIDE = "2.5.4.14"
  486. szOID_BUSINESS_CATEGORY = "2.5.4.15"
  487. szOID_POSTAL_ADDRESS = "2.5.4.16"
  488. szOID_POSTAL_CODE = "2.5.4.17"
  489. szOID_POST_OFFICE_BOX = "2.5.4.18"
  490. szOID_PHYSICAL_DELIVERY_OFFICE_NAME = "2.5.4.19"
  491. szOID_TELEPHONE_NUMBER = "2.5.4.20"
  492. szOID_TELEX_NUMBER = "2.5.4.21"
  493. szOID_TELETEXT_TERMINAL_IDENTIFIER = "2.5.4.22"
  494. szOID_FACSIMILE_TELEPHONE_NUMBER = "2.5.4.23"
  495. szOID_X21_ADDRESS = "2.5.4.24"
  496. szOID_INTERNATIONAL_ISDN_NUMBER = "2.5.4.25"
  497. szOID_REGISTERED_ADDRESS = "2.5.4.26"
  498. szOID_DESTINATION_INDICATOR = "2.5.4.27"
  499. szOID_PREFERRED_DELIVERY_METHOD = "2.5.4.28"
  500. szOID_PRESENTATION_ADDRESS = "2.5.4.29"
  501. szOID_SUPPORTED_APPLICATION_CONTEXT = "2.5.4.30"
  502. szOID_MEMBER = "2.5.4.31"
  503. szOID_OWNER = "2.5.4.32"
  504. szOID_ROLE_OCCUPANT = "2.5.4.33"
  505. szOID_SEE_ALSO = "2.5.4.34"
  506. szOID_USER_PASSWORD = "2.5.4.35"
  507. szOID_USER_CERTIFICATE = "2.5.4.36"
  508. szOID_CA_CERTIFICATE = "2.5.4.37"
  509. szOID_AUTHORITY_REVOCATION_LIST = "2.5.4.38"
  510. szOID_CERTIFICATE_REVOCATION_LIST = "2.5.4.39"
  511. szOID_CROSS_CERTIFICATE_PAIR = "2.5.4.40"
  512. szOID_GIVEN_NAME = "2.5.4.42"
  513. szOID_INITIALS = "2.5.4.43"
  514. szOID_DN_QUALIFIER = "2.5.4.46"
  515. szOID_DOMAIN_COMPONENT = "0.9.2342.19200300.100.1.25"
  516. szOID_PKCS_12_FRIENDLY_NAME_ATTR = "1.2.840.113549.1.9.20"
  517. szOID_PKCS_12_LOCAL_KEY_ID = "1.2.840.113549.1.9.21"
  518. szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR = "1.3.6.1.4.1.311.17.1"
  519. szOID_LOCAL_MACHINE_KEYSET = "1.3.6.1.4.1.311.17.2"
  520. szOID_KEYID_RDN = "1.3.6.1.4.1.311.10.7.1"
  521. CERT_RDN_ANY_TYPE = 0
  522. CERT_RDN_ENCODED_BLOB = 1
  523. CERT_RDN_OCTET_STRING = 2
  524. CERT_RDN_NUMERIC_STRING = 3
  525. CERT_RDN_PRINTABLE_STRING = 4
  526. CERT_RDN_TELETEX_STRING = 5
  527. CERT_RDN_T61_STRING = 5
  528. CERT_RDN_VIDEOTEX_STRING = 6
  529. CERT_RDN_IA5_STRING = 7
  530. CERT_RDN_GRAPHIC_STRING = 8
  531. CERT_RDN_VISIBLE_STRING = 9
  532. CERT_RDN_ISO646_STRING = 9
  533. CERT_RDN_GENERAL_STRING = 10
  534. CERT_RDN_UNIVERSAL_STRING = 11
  535. CERT_RDN_INT4_STRING = 11
  536. CERT_RDN_BMP_STRING = 12
  537. CERT_RDN_UNICODE_STRING = 12
  538. CERT_RDN_UTF8_STRING = 13
  539. CERT_RDN_TYPE_MASK = 0x000000FF
  540. CERT_RDN_FLAGS_MASK = (-16777216)
  541. CERT_RDN_ENABLE_T61_UNICODE_FLAG = (-2147483648)
  542. CERT_RDN_ENABLE_UTF8_UNICODE_FLAG = 0x20000000
  543. CERT_RDN_DISABLE_CHECK_TYPE_FLAG = 0x40000000
  544. CERT_RDN_DISABLE_IE4_UTF8_FLAG = 0x01000000
  545. CERT_RSA_PUBLIC_KEY_OBJID = szOID_RSA_RSA
  546. CERT_DEFAULT_OID_PUBLIC_KEY_SIGN = szOID_RSA_RSA
  547. CERT_DEFAULT_OID_PUBLIC_KEY_XCHG = szOID_RSA_RSA
  548. CERT_V1 = 0
  549. CERT_V2 = 1
  550. CERT_V3 = 2
  551. CERT_INFO_VERSION_FLAG = 1
  552. CERT_INFO_SERIAL_NUMBER_FLAG = 2
  553. CERT_INFO_SIGNATURE_ALGORITHM_FLAG = 3
  554. CERT_INFO_ISSUER_FLAG = 4
  555. CERT_INFO_NOT_BEFORE_FLAG = 5
  556. CERT_INFO_NOT_AFTER_FLAG = 6
  557. CERT_INFO_SUBJECT_FLAG = 7
  558. CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG = 8
  559. CERT_INFO_ISSUER_UNIQUE_ID_FLAG = 9
  560. CERT_INFO_SUBJECT_UNIQUE_ID_FLAG = 10
  561. CERT_INFO_EXTENSION_FLAG = 11
  562. CRL_V1 = 0
  563. CRL_V2 = 1
  564. CERT_REQUEST_V1 = 0
  565. CERT_KEYGEN_REQUEST_V1 = 0
  566. CTL_V1 = 0
  567. CERT_ENCODING_TYPE_MASK = 0x0000FFFF
  568. CMSG_ENCODING_TYPE_MASK = (-65536)
  569. def GET_CERT_ENCODING_TYPE(X): return (X & CERT_ENCODING_TYPE_MASK)
  570. def GET_CMSG_ENCODING_TYPE(X): return (X & CMSG_ENCODING_TYPE_MASK)
  571. CRYPT_ASN_ENCODING = 0x00000001
  572. CRYPT_NDR_ENCODING = 0x00000002
  573. X509_ASN_ENCODING = 0x00000001
  574. X509_NDR_ENCODING = 0x00000002
  575. PKCS_7_ASN_ENCODING = 0x00010000
  576. PKCS_7_NDR_ENCODING = 0x00020000
  577. CRYPT_FORMAT_STR_MULTI_LINE = 0x0001
  578. CRYPT_FORMAT_STR_NO_HEX = 0x0010
  579. CRYPT_FORMAT_SIMPLE = 0x0001
  580. CRYPT_FORMAT_X509 = 0x0002
  581. CRYPT_FORMAT_OID = 0x0004
  582. CRYPT_FORMAT_RDN_SEMICOLON = 0x0100
  583. CRYPT_FORMAT_RDN_CRLF = 0x0200
  584. CRYPT_FORMAT_RDN_UNQUOTE = 0x0400
  585. CRYPT_FORMAT_RDN_REVERSE = 0x0800
  586. CRYPT_FORMAT_COMMA = 0x1000
  587. CRYPT_FORMAT_SEMICOLON = CRYPT_FORMAT_RDN_SEMICOLON
  588. CRYPT_FORMAT_CRLF = CRYPT_FORMAT_RDN_CRLF
  589. CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG = 0x8
  590. CRYPT_ENCODE_ALLOC_FLAG = 0x8000
  591. CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG = \
  592. CERT_RDN_ENABLE_T61_UNICODE_FLAG
  593. CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG = \
  594. CERT_RDN_ENABLE_UTF8_UNICODE_FLAG
  595. CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG = \
  596. CERT_RDN_DISABLE_CHECK_TYPE_FLAG
  597. CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG = 0x10000
  598. CRYPT_DECODE_NOCOPY_FLAG = 0x1
  599. CRYPT_DECODE_TO_BE_SIGNED_FLAG = 0x2
  600. CRYPT_DECODE_SHARE_OID_STRING_FLAG = 0x4
  601. CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG = 0x8
  602. CRYPT_DECODE_ALLOC_FLAG = 0x8000
  603. CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG = \
  604. CERT_RDN_DISABLE_IE4_UTF8_FLAG
  605. CRYPT_ENCODE_DECODE_NONE = 0
  606. X509_CERT = 1
  607. X509_CERT_TO_BE_SIGNED = 2
  608. X509_CERT_CRL_TO_BE_SIGNED = 3
  609. X509_CERT_REQUEST_TO_BE_SIGNED = 4
  610. X509_EXTENSIONS = 5
  611. X509_NAME_VALUE = 6
  612. X509_NAME = 7
  613. X509_PUBLIC_KEY_INFO = 8
  614. X509_AUTHORITY_KEY_ID = 9
  615. X509_KEY_ATTRIBUTES = 10
  616. X509_KEY_USAGE_RESTRICTION = 11
  617. X509_ALTERNATE_NAME = 12
  618. X509_BASIC_CONSTRAINTS = 13
  619. X509_KEY_USAGE = 14
  620. X509_BASIC_CONSTRAINTS2 = 15
  621. X509_CERT_POLICIES = 16
  622. PKCS_UTC_TIME = 17
  623. PKCS_TIME_REQUEST = 18
  624. RSA_CSP_PUBLICKEYBLOB = 19
  625. X509_UNICODE_NAME = 20
  626. X509_KEYGEN_REQUEST_TO_BE_SIGNED = 21
  627. PKCS_ATTRIBUTE = 22
  628. PKCS_CONTENT_INFO_SEQUENCE_OF_ANY = 23
  629. X509_UNICODE_NAME_VALUE = 24
  630. X509_ANY_STRING = X509_NAME_VALUE
  631. X509_UNICODE_ANY_STRING = X509_UNICODE_NAME_VALUE
  632. X509_OCTET_STRING = 25
  633. X509_BITS = 26
  634. X509_INTEGER = 27
  635. X509_MULTI_BYTE_INTEGER = 28
  636. X509_ENUMERATED = 29
  637. X509_CHOICE_OF_TIME = 30
  638. X509_AUTHORITY_KEY_ID2 = 31
  639. X509_AUTHORITY_INFO_ACCESS = 32
  640. X509_SUBJECT_INFO_ACCESS = X509_AUTHORITY_INFO_ACCESS
  641. X509_CRL_REASON_CODE = X509_ENUMERATED
  642. PKCS_CONTENT_INFO = 33
  643. X509_SEQUENCE_OF_ANY = 34
  644. X509_CRL_DIST_POINTS = 35
  645. X509_ENHANCED_KEY_USAGE = 36
  646. PKCS_CTL = 37
  647. X509_MULTI_BYTE_UINT = 38
  648. X509_DSS_PUBLICKEY = X509_MULTI_BYTE_UINT
  649. X509_DSS_PARAMETERS = 39
  650. X509_DSS_SIGNATURE = 40
  651. PKCS_RC2_CBC_PARAMETERS = 41
  652. PKCS_SMIME_CAPABILITIES = 42
  653. X509_QC_STATEMENTS_EXT = 42
  654. PKCS_RSA_PRIVATE_KEY = 43
  655. PKCS_PRIVATE_KEY_INFO = 44
  656. PKCS_ENCRYPTED_PRIVATE_KEY_INFO = 45
  657. X509_PKIX_POLICY_QUALIFIER_USERNOTICE = 46
  658. X509_DH_PUBLICKEY = X509_MULTI_BYTE_UINT
  659. X509_DH_PARAMETERS = 47
  660. PKCS_ATTRIBUTES = 48
  661. PKCS_SORTED_CTL = 49
  662. X509_ECC_SIGNATURE = 47
  663. X942_DH_PARAMETERS = 50
  664. X509_BITS_WITHOUT_TRAILING_ZEROES = 51
  665. X942_OTHER_INFO = 52
  666. X509_CERT_PAIR = 53
  667. X509_ISSUING_DIST_POINT = 54
  668. X509_NAME_CONSTRAINTS = 55
  669. X509_POLICY_MAPPINGS = 56
  670. X509_POLICY_CONSTRAINTS = 57
  671. X509_CROSS_CERT_DIST_POINTS = 58
  672. CMC_DATA = 59
  673. CMC_RESPONSE = 60
  674. CMC_STATUS = 61
  675. CMC_ADD_EXTENSIONS = 62
  676. CMC_ADD_ATTRIBUTES = 63
  677. X509_CERTIFICATE_TEMPLATE = 64
  678. OCSP_SIGNED_REQUEST = 65
  679. OCSP_REQUEST = 66
  680. OCSP_RESPONSE = 67
  681. OCSP_BASIC_SIGNED_RESPONSE = 68
  682. OCSP_BASIC_RESPONSE = 69
  683. X509_LOGOTYPE_EXT = 70
  684. X509_BIOMETRIC_EXT = 71
  685. CNG_RSA_PUBLIC_KEY_BLOB = 72
  686. X509_OBJECT_IDENTIFIER = 73
  687. X509_ALGORITHM_IDENTIFIER = 74
  688. PKCS_RSA_SSA_PSS_PARAMETERS = 75
  689. PKCS_RSAES_OAEP_PARAMETERS = 76
  690. ECC_CMS_SHARED_INFO = 77
  691. TIMESTAMP_REQUEST = 78
  692. TIMESTAMP_RESPONSE = 79
  693. TIMESTAMP_INFO = 80
  694. X509_CERT_BUNDLE = 81
  695. PKCS7_SIGNER_INFO = 500
  696. CMS_SIGNER_INFO = 501
  697. szOID_AUTHORITY_KEY_IDENTIFIER = "2.5.29.1"
  698. szOID_KEY_ATTRIBUTES = "2.5.29.2"
  699. szOID_CERT_POLICIES_95 = "2.5.29.3"
  700. szOID_KEY_USAGE_RESTRICTION = "2.5.29.4"
  701. szOID_SUBJECT_ALT_NAME = "2.5.29.7"
  702. szOID_ISSUER_ALT_NAME = "2.5.29.8"
  703. szOID_BASIC_CONSTRAINTS = "2.5.29.10"
  704. szOID_KEY_USAGE = "2.5.29.15"
  705. szOID_PRIVATEKEY_USAGE_PERIOD = "2.5.29.16"
  706. szOID_BASIC_CONSTRAINTS2 = "2.5.29.19"
  707. szOID_CERT_POLICIES = "2.5.29.32"
  708. szOID_ANY_CERT_POLICY = "2.5.29.32.0"
  709. szOID_AUTHORITY_KEY_IDENTIFIER2 = "2.5.29.35"
  710. szOID_SUBJECT_KEY_IDENTIFIER = "2.5.29.14"
  711. szOID_SUBJECT_ALT_NAME2 = "2.5.29.17"
  712. szOID_ISSUER_ALT_NAME2 = "2.5.29.18"
  713. szOID_CRL_REASON_CODE = "2.5.29.21"
  714. szOID_REASON_CODE_HOLD = "2.5.29.23"
  715. szOID_CRL_DIST_POINTS = "2.5.29.31"
  716. szOID_ENHANCED_KEY_USAGE = "2.5.29.37"
  717. szOID_CRL_NUMBER = "2.5.29.20"
  718. szOID_DELTA_CRL_INDICATOR = "2.5.29.27"
  719. szOID_ISSUING_DIST_POINT = "2.5.29.28"
  720. szOID_FRESHEST_CRL = "2.5.29.46"
  721. szOID_NAME_CONSTRAINTS = "2.5.29.30"
  722. szOID_POLICY_MAPPINGS = "2.5.29.33"
  723. szOID_LEGACY_POLICY_MAPPINGS = "2.5.29.5"
  724. szOID_POLICY_CONSTRAINTS = "2.5.29.36"
  725. szOID_RENEWAL_CERTIFICATE = "1.3.6.1.4.1.311.13.1"
  726. szOID_ENROLLMENT_NAME_VALUE_PAIR = "1.3.6.1.4.1.311.13.2.1"
  727. szOID_ENROLLMENT_CSP_PROVIDER = "1.3.6.1.4.1.311.13.2.2"
  728. szOID_OS_VERSION = "1.3.6.1.4.1.311.13.2.3"
  729. szOID_ENROLLMENT_AGENT = "1.3.6.1.4.1.311.20.2.1"
  730. szOID_PKIX = "1.3.6.1.5.5.7"
  731. szOID_PKIX_PE = "1.3.6.1.5.5.7.1"
  732. szOID_AUTHORITY_INFO_ACCESS = "1.3.6.1.5.5.7.1.1"
  733. szOID_CERT_EXTENSIONS = "1.3.6.1.4.1.311.2.1.14"
  734. szOID_NEXT_UPDATE_LOCATION = "1.3.6.1.4.1.311.10.2"
  735. szOID_REMOVE_CERTIFICATE = "1.3.6.1.4.1.311.10.8.1"
  736. szOID_CROSS_CERT_DIST_POINTS = "1.3.6.1.4.1.311.10.9.1"
  737. szOID_CTL = "1.3.6.1.4.1.311.10.1"
  738. szOID_SORTED_CTL = "1.3.6.1.4.1.311.10.1.1"
  739. szOID_SERIALIZED = "1.3.6.1.4.1.311.10.3.3.1"
  740. szOID_NT_PRINCIPAL_NAME = "1.3.6.1.4.1.311.20.2.3"
  741. szOID_PRODUCT_UPDATE = "1.3.6.1.4.1.311.31.1"
  742. szOID_ANY_APPLICATION_POLICY = "1.3.6.1.4.1.311.10.12.1"
  743. szOID_AUTO_ENROLL_CTL_USAGE = "1.3.6.1.4.1.311.20.1"
  744. szOID_ENROLL_CERTTYPE_EXTENSION = "1.3.6.1.4.1.311.20.2"
  745. szOID_CERT_MANIFOLD = "1.3.6.1.4.1.311.20.3"
  746. szOID_CERTSRV_CA_VERSION = "1.3.6.1.4.1.311.21.1"
  747. szOID_CERTSRV_PREVIOUS_CERT_HASH = "1.3.6.1.4.1.311.21.2"
  748. szOID_CRL_VIRTUAL_BASE = "1.3.6.1.4.1.311.21.3"
  749. szOID_CRL_NEXT_PUBLISH = "1.3.6.1.4.1.311.21.4"
  750. szOID_KP_CA_EXCHANGE = "1.3.6.1.4.1.311.21.5"
  751. szOID_KP_KEY_RECOVERY_AGENT = "1.3.6.1.4.1.311.21.6"
  752. szOID_CERTIFICATE_TEMPLATE = "1.3.6.1.4.1.311.21.7"
  753. szOID_ENTERPRISE_OID_ROOT = "1.3.6.1.4.1.311.21.8"
  754. szOID_RDN_DUMMY_SIGNER = "1.3.6.1.4.1.311.21.9"
  755. szOID_APPLICATION_CERT_POLICIES = "1.3.6.1.4.1.311.21.10"
  756. szOID_APPLICATION_POLICY_MAPPINGS = "1.3.6.1.4.1.311.21.11"
  757. szOID_APPLICATION_POLICY_CONSTRAINTS = "1.3.6.1.4.1.311.21.12"
  758. szOID_ARCHIVED_KEY_ATTR = "1.3.6.1.4.1.311.21.13"
  759. szOID_CRL_SELF_CDP = "1.3.6.1.4.1.311.21.14"
  760. szOID_REQUIRE_CERT_CHAIN_POLICY = "1.3.6.1.4.1.311.21.15"
  761. szOID_ARCHIVED_KEY_CERT_HASH = "1.3.6.1.4.1.311.21.16"
  762. szOID_ISSUED_CERT_HASH = "1.3.6.1.4.1.311.21.17"
  763. szOID_DS_EMAIL_REPLICATION = "1.3.6.1.4.1.311.21.19"
  764. szOID_REQUEST_CLIENT_INFO = "1.3.6.1.4.1.311.21.20"
  765. szOID_ENCRYPTED_KEY_HASH = "1.3.6.1.4.1.311.21.21"
  766. szOID_CERTSRV_CROSSCA_VERSION = "1.3.6.1.4.1.311.21.22"
  767. szOID_NTDS_REPLICATION = "1.3.6.1.4.1.311.25.1"
  768. szOID_SUBJECT_DIR_ATTRS = "2.5.29.9"
  769. szOID_PKIX_KP = "1.3.6.1.5.5.7.3"
  770. szOID_PKIX_KP_SERVER_AUTH = "1.3.6.1.5.5.7.3.1"
  771. szOID_PKIX_KP_CLIENT_AUTH = "1.3.6.1.5.5.7.3.2"
  772. szOID_PKIX_KP_CODE_SIGNING = "1.3.6.1.5.5.7.3.3"
  773. szOID_PKIX_KP_EMAIL_PROTECTION = "1.3.6.1.5.5.7.3.4"
  774. szOID_PKIX_KP_IPSEC_END_SYSTEM = "1.3.6.1.5.5.7.3.5"
  775. szOID_PKIX_KP_IPSEC_TUNNEL = "1.3.6.1.5.5.7.3.6"
  776. szOID_PKIX_KP_IPSEC_USER = "1.3.6.1.5.5.7.3.7"
  777. szOID_PKIX_KP_TIMESTAMP_SIGNING = "1.3.6.1.5.5.7.3.8"
  778. szOID_IPSEC_KP_IKE_INTERMEDIATE = "1.3.6.1.5.5.8.2.2"
  779. szOID_KP_CTL_USAGE_SIGNING = "1.3.6.1.4.1.311.10.3.1"
  780. szOID_KP_TIME_STAMP_SIGNING = "1.3.6.1.4.1.311.10.3.2"
  781. szOID_SERVER_GATED_CRYPTO = "1.3.6.1.4.1.311.10.3.3"
  782. szOID_SGC_NETSCAPE = "2.16.840.1.113730.4.1"
  783. szOID_KP_EFS = "1.3.6.1.4.1.311.10.3.4"
  784. szOID_EFS_RECOVERY = "1.3.6.1.4.1.311.10.3.4.1"
  785. szOID_WHQL_CRYPTO = "1.3.6.1.4.1.311.10.3.5"
  786. szOID_NT5_CRYPTO = "1.3.6.1.4.1.311.10.3.6"
  787. szOID_OEM_WHQL_CRYPTO = "1.3.6.1.4.1.311.10.3.7"
  788. szOID_EMBEDDED_NT_CRYPTO = "1.3.6.1.4.1.311.10.3.8"
  789. szOID_ROOT_LIST_SIGNER = "1.3.6.1.4.1.311.10.3.9"
  790. szOID_KP_QUALIFIED_SUBORDINATION = "1.3.6.1.4.1.311.10.3.10"
  791. szOID_KP_KEY_RECOVERY = "1.3.6.1.4.1.311.10.3.11"
  792. szOID_KP_DOCUMENT_SIGNING = "1.3.6.1.4.1.311.10.3.12"
  793. szOID_KP_LIFETIME_SIGNING = "1.3.6.1.4.1.311.10.3.13"
  794. szOID_KP_MOBILE_DEVICE_SOFTWARE = "1.3.6.1.4.1.311.10.3.14"
  795. szOID_DRM = "1.3.6.1.4.1.311.10.5.1"
  796. szOID_DRM_INDIVIDUALIZATION = "1.3.6.1.4.1.311.10.5.2"
  797. szOID_LICENSES = "1.3.6.1.4.1.311.10.6.1"
  798. szOID_LICENSE_SERVER = "1.3.6.1.4.1.311.10.6.2"
  799. szOID_KP_SMARTCARD_LOGON = "1.3.6.1.4.1.311.20.2.2"
  800. szOID_YESNO_TRUST_ATTR = "1.3.6.1.4.1.311.10.4.1"
  801. szOID_PKIX_POLICY_QUALIFIER_CPS = "1.3.6.1.5.5.7.2.1"
  802. szOID_PKIX_POLICY_QUALIFIER_USERNOTICE = "1.3.6.1.5.5.7.2.2"
  803. szOID_CERT_POLICIES_95_QUALIFIER1 = "2.16.840.1.113733.1.7.1.1"
  804. CERT_UNICODE_RDN_ERR_INDEX_MASK = 0x3FF
  805. CERT_UNICODE_RDN_ERR_INDEX_SHIFT = 22
  806. CERT_UNICODE_ATTR_ERR_INDEX_MASK = 0x003F
  807. CERT_UNICODE_ATTR_ERR_INDEX_SHIFT = 16
  808. CERT_UNICODE_VALUE_ERR_INDEX_MASK = 0x0000FFFF
  809. CERT_UNICODE_VALUE_ERR_INDEX_SHIFT = 0
  810. CERT_DIGITAL_SIGNATURE_KEY_USAGE = 0x80
  811. CERT_NON_REPUDIATION_KEY_USAGE = 0x40
  812. CERT_KEY_ENCIPHERMENT_KEY_USAGE = 0x20
  813. CERT_DATA_ENCIPHERMENT_KEY_USAGE = 0x10
  814. CERT_KEY_AGREEMENT_KEY_USAGE = 0x08
  815. CERT_KEY_CERT_SIGN_KEY_USAGE = 0x04
  816. CERT_OFFLINE_CRL_SIGN_KEY_USAGE = 0x02
  817. CERT_CRL_SIGN_KEY_USAGE = 0x02
  818. CERT_ENCIPHER_ONLY_KEY_USAGE = 0x01
  819. CERT_DECIPHER_ONLY_KEY_USAGE = 0x80
  820. CERT_ALT_NAME_OTHER_NAME = 1
  821. CERT_ALT_NAME_RFC822_NAME = 2
  822. CERT_ALT_NAME_DNS_NAME = 3
  823. CERT_ALT_NAME_X400_ADDRESS = 4
  824. CERT_ALT_NAME_DIRECTORY_NAME = 5
  825. CERT_ALT_NAME_EDI_PARTY_NAME = 6
  826. CERT_ALT_NAME_URL = 7
  827. CERT_ALT_NAME_IP_ADDRESS = 8
  828. CERT_ALT_NAME_REGISTERED_ID = 9
  829. CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK = 0xFF
  830. CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT = 16
  831. CERT_ALT_NAME_VALUE_ERR_INDEX_MASK = 0x0000FFFF
  832. CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT = 0
  833. CERT_CA_SUBJECT_FLAG = 0x80
  834. CERT_END_ENTITY_SUBJECT_FLAG = 0x40
  835. szOID_PKIX_ACC_DESCR = "1.3.6.1.5.5.7.48"
  836. szOID_PKIX_OCSP = "1.3.6.1.5.5.7.48.1"
  837. szOID_PKIX_CA_ISSUERS = "1.3.6.1.5.5.7.48.2"
  838. CRL_REASON_UNSPECIFIED = 0
  839. CRL_REASON_KEY_COMPROMISE = 1
  840. CRL_REASON_CA_COMPROMISE = 2
  841. CRL_REASON_AFFILIATION_CHANGED = 3
  842. CRL_REASON_SUPERSEDED = 4
  843. CRL_REASON_CESSATION_OF_OPERATION = 5
  844. CRL_REASON_CERTIFICATE_HOLD = 6
  845. CRL_REASON_REMOVE_FROM_CRL = 8
  846. CRL_DIST_POINT_NO_NAME = 0
  847. CRL_DIST_POINT_FULL_NAME = 1
  848. CRL_DIST_POINT_ISSUER_RDN_NAME = 2
  849. CRL_REASON_UNUSED_FLAG = 0x80
  850. CRL_REASON_KEY_COMPROMISE_FLAG = 0x40
  851. CRL_REASON_CA_COMPROMISE_FLAG = 0x20
  852. CRL_REASON_AFFILIATION_CHANGED_FLAG = 0x10
  853. CRL_REASON_SUPERSEDED_FLAG = 0x08
  854. CRL_REASON_CESSATION_OF_OPERATION_FLAG = 0x04
  855. CRL_REASON_CERTIFICATE_HOLD_FLAG = 0x02
  856. CRL_DIST_POINT_ERR_INDEX_MASK = 0x7F
  857. CRL_DIST_POINT_ERR_INDEX_SHIFT = 24
  858. CRL_DIST_POINT_ERR_CRL_ISSUER_BIT = (-2147483648)
  859. CROSS_CERT_DIST_POINT_ERR_INDEX_MASK = 0xFF
  860. CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT = 24
  861. CERT_EXCLUDED_SUBTREE_BIT = (-2147483648)
  862. SORTED_CTL_EXT_FLAGS_OFFSET = (0*4)
  863. SORTED_CTL_EXT_COUNT_OFFSET = (1*4)
  864. SORTED_CTL_EXT_MAX_COLLISION_OFFSET = (2*4)
  865. SORTED_CTL_EXT_HASH_BUCKET_OFFSET = (3*4)
  866. SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG = 0x1
  867. CERT_DSS_R_LEN = 20
  868. CERT_DSS_S_LEN = 20
  869. CERT_DSS_SIGNATURE_LEN = (CERT_DSS_R_LEN + CERT_DSS_S_LEN)
  870. CERT_MAX_ASN_ENCODED_DSS_SIGNATURE_LEN = (2 + 2*(2 + 20 +1))
  871. CRYPT_X942_COUNTER_BYTE_LENGTH = 4
  872. CRYPT_X942_KEY_LENGTH_BYTE_LENGTH = 4
  873. CRYPT_X942_PUB_INFO_BYTE_LENGTH = (512/8)
  874. CRYPT_RC2_40BIT_VERSION = 160
  875. CRYPT_RC2_56BIT_VERSION = 52
  876. CRYPT_RC2_64BIT_VERSION = 120
  877. CRYPT_RC2_128BIT_VERSION = 58
  878. szOID_VERISIGN_PRIVATE_6_9 = "2.16.840.1.113733.1.6.9"
  879. szOID_VERISIGN_ONSITE_JURISDICTION_HASH = "2.16.840.1.113733.1.6.11"
  880. szOID_VERISIGN_BITSTRING_6_13 = "2.16.840.1.113733.1.6.13"
  881. szOID_VERISIGN_ISS_STRONG_CRYPTO = "2.16.840.1.113733.1.8.1"
  882. szOID_NETSCAPE = "2.16.840.1.113730"
  883. szOID_NETSCAPE_CERT_EXTENSION = "2.16.840.1.113730.1"
  884. szOID_NETSCAPE_CERT_TYPE = "2.16.840.1.113730.1.1"
  885. szOID_NETSCAPE_BASE_URL = "2.16.840.1.113730.1.2"
  886. szOID_NETSCAPE_REVOCATION_URL = "2.16.840.1.113730.1.3"
  887. szOID_NETSCAPE_CA_REVOCATION_URL = "2.16.840.1.113730.1.4"
  888. szOID_NETSCAPE_CERT_RENEWAL_URL = "2.16.840.1.113730.1.7"
  889. szOID_NETSCAPE_CA_POLICY_URL = "2.16.840.1.113730.1.8"
  890. szOID_NETSCAPE_SSL_SERVER_NAME = "2.16.840.1.113730.1.12"
  891. szOID_NETSCAPE_COMMENT = "2.16.840.1.113730.1.13"
  892. szOID_NETSCAPE_DATA_TYPE = "2.16.840.1.113730.2"
  893. szOID_NETSCAPE_CERT_SEQUENCE = "2.16.840.1.113730.2.5"
  894. NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE = 0x80
  895. NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE = 0x40
  896. NETSCAPE_SMIME_CERT_TYPE = 0x20
  897. NETSCAPE_SIGN_CERT_TYPE = 0x10
  898. NETSCAPE_SSL_CA_CERT_TYPE = 0x04
  899. NETSCAPE_SMIME_CA_CERT_TYPE = 0x02
  900. NETSCAPE_SIGN_CA_CERT_TYPE = 0x01
  901. szOID_CT_PKI_DATA = "1.3.6.1.5.5.7.12.2"
  902. szOID_CT_PKI_RESPONSE = "1.3.6.1.5.5.7.12.3"
  903. szOID_PKIX_NO_SIGNATURE = "1.3.6.1.5.5.7.6.2"
  904. szOID_CMC = "1.3.6.1.5.5.7.7"
  905. szOID_CMC_STATUS_INFO = "1.3.6.1.5.5.7.7.1"
  906. szOID_CMC_IDENTIFICATION = "1.3.6.1.5.5.7.7.2"
  907. szOID_CMC_IDENTITY_PROOF = "1.3.6.1.5.5.7.7.3"
  908. szOID_CMC_DATA_RETURN = "1.3.6.1.5.5.7.7.4"
  909. szOID_CMC_TRANSACTION_ID = "1.3.6.1.5.5.7.7.5"
  910. szOID_CMC_SENDER_NONCE = "1.3.6.1.5.5.7.7.6"
  911. szOID_CMC_RECIPIENT_NONCE = "1.3.6.1.5.5.7.7.7"
  912. szOID_CMC_ADD_EXTENSIONS = "1.3.6.1.5.5.7.7.8"
  913. szOID_CMC_ENCRYPTED_POP = "1.3.6.1.5.5.7.7.9"
  914. szOID_CMC_DECRYPTED_POP = "1.3.6.1.5.5.7.7.10"
  915. szOID_CMC_LRA_POP_WITNESS = "1.3.6.1.5.5.7.7.11"
  916. szOID_CMC_GET_CERT = "1.3.6.1.5.5.7.7.15"
  917. szOID_CMC_GET_CRL = "1.3.6.1.5.5.7.7.16"
  918. szOID_CMC_REVOKE_REQUEST = "1.3.6.1.5.5.7.7.17"
  919. szOID_CMC_REG_INFO = "1.3.6.1.5.5.7.7.18"
  920. szOID_CMC_RESPONSE_INFO = "1.3.6.1.5.5.7.7.19"
  921. szOID_CMC_QUERY_PENDING = "1.3.6.1.5.5.7.7.21"
  922. szOID_CMC_ID_POP_LINK_RANDOM = "1.3.6.1.5.5.7.7.22"
  923. szOID_CMC_ID_POP_LINK_WITNESS = "1.3.6.1.5.5.7.7.23"
  924. szOID_CMC_ID_CONFIRM_CERT_ACCEPTANCE = "1.3.6.1.5.5.7.7.24"
  925. szOID_CMC_ADD_ATTRIBUTES = "1.3.6.1.4.1.311.10.10.1"
  926. CMC_TAGGED_CERT_REQUEST_CHOICE = 1
  927. CMC_OTHER_INFO_NO_CHOICE = 0
  928. CMC_OTHER_INFO_FAIL_CHOICE = 1
  929. CMC_OTHER_INFO_PEND_CHOICE = 2
  930. CMC_STATUS_SUCCESS = 0
  931. CMC_STATUS_FAILED = 2
  932. CMC_STATUS_PENDING = 3
  933. CMC_STATUS_NO_SUPPORT = 4
  934. CMC_STATUS_CONFIRM_REQUIRED = 5
  935. CMC_FAIL_BAD_ALG = 0
  936. CMC_FAIL_BAD_MESSAGE_CHECK = 1
  937. CMC_FAIL_BAD_REQUEST = 2
  938. CMC_FAIL_BAD_TIME = 3
  939. CMC_FAIL_BAD_CERT_ID = 4
  940. CMC_FAIL_UNSUPORTED_EXT = 5
  941. CMC_FAIL_MUST_ARCHIVE_KEYS = 6
  942. CMC_FAIL_BAD_IDENTITY = 7
  943. CMC_FAIL_POP_REQUIRED = 8
  944. CMC_FAIL_POP_FAILED = 9
  945. CMC_FAIL_NO_KEY_REUSE = 10
  946. CMC_FAIL_INTERNAL_CA_ERROR = 11
  947. CMC_FAIL_TRY_LATER = 12
  948. CRYPT_OID_ENCODE_OBJECT_FUNC = "CryptDllEncodeObject"
  949. CRYPT_OID_DECODE_OBJECT_FUNC = "CryptDllDecodeObject"
  950. CRYPT_OID_ENCODE_OBJECT_EX_FUNC = "CryptDllEncodeObjectEx"
  951. CRYPT_OID_DECODE_OBJECT_EX_FUNC = "CryptDllDecodeObjectEx"
  952. CRYPT_OID_CREATE_COM_OBJECT_FUNC = "CryptDllCreateCOMObject"
  953. CRYPT_OID_VERIFY_REVOCATION_FUNC = "CertDllVerifyRevocation"
  954. CRYPT_OID_VERIFY_CTL_USAGE_FUNC = "CertDllVerifyCTLUsage"
  955. CRYPT_OID_FORMAT_OBJECT_FUNC = "CryptDllFormatObject"
  956. CRYPT_OID_FIND_OID_INFO_FUNC = "CryptDllFindOIDInfo"
  957. CRYPT_OID_FIND_LOCALIZED_NAME_FUNC = "CryptDllFindLocalizedName"
  958. CRYPT_OID_REGPATH = "Software\\Microsoft\\Cryptography\\OID"
  959. CRYPT_OID_REG_ENCODING_TYPE_PREFIX = "EncodingType "
  960. CRYPT_OID_REG_DLL_VALUE_NAME = "Dll"
  961. CRYPT_OID_REG_FUNC_NAME_VALUE_NAME = "FuncName"
  962. CRYPT_OID_REG_FUNC_NAME_VALUE_NAME_A = "FuncName"
  963. CRYPT_OID_REG_FLAGS_VALUE_NAME = "CryptFlags"
  964. CRYPT_DEFAULT_OID = "DEFAULT"
  965. CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG = 1
  966. CRYPT_GET_INSTALLED_OID_FUNC_FLAG = 0x1
  967. CRYPT_REGISTER_FIRST_INDEX = 0
  968. CRYPT_REGISTER_LAST_INDEX = (-1)
  969. CRYPT_MATCH_ANY_ENCODING_TYPE = (-1)
  970. CRYPT_HASH_ALG_OID_GROUP_ID = 1
  971. CRYPT_ENCRYPT_ALG_OID_GROUP_ID = 2
  972. CRYPT_PUBKEY_ALG_OID_GROUP_ID = 3
  973. CRYPT_SIGN_ALG_OID_GROUP_ID = 4
  974. CRYPT_RDN_ATTR_OID_GROUP_ID = 5
  975. CRYPT_EXT_OR_ATTR_OID_GROUP_ID = 6
  976. CRYPT_ENHKEY_USAGE_OID_GROUP_ID = 7
  977. CRYPT_POLICY_OID_GROUP_ID = 8
  978. CRYPT_TEMPLATE_OID_GROUP_ID = 9
  979. CRYPT_LAST_OID_GROUP_ID = 9
  980. CRYPT_FIRST_ALG_OID_GROUP_ID = CRYPT_HASH_ALG_OID_GROUP_ID
  981. CRYPT_LAST_ALG_OID_GROUP_ID = CRYPT_SIGN_ALG_OID_GROUP_ID
  982. CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG = 0x1
  983. CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG = 0x2
  984. CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG = 0x4
  985. CRYPT_OID_INFO_OID_KEY = 1
  986. CRYPT_OID_INFO_NAME_KEY = 2
  987. CRYPT_OID_INFO_ALGID_KEY = 3
  988. CRYPT_OID_INFO_SIGN_KEY = 4
  989. CRYPT_INSTALL_OID_INFO_BEFORE_FLAG = 1
  990. CRYPT_LOCALIZED_NAME_ENCODING_TYPE = 0
  991. CRYPT_LOCALIZED_NAME_OID = "LocalizedNames"
  992. szOID_PKCS_7_DATA = "1.2.840.113549.1.7.1"
  993. szOID_PKCS_7_SIGNED = "1.2.840.113549.1.7.2"
  994. szOID_PKCS_7_ENVELOPED = "1.2.840.113549.1.7.3"
  995. szOID_PKCS_7_SIGNEDANDENVELOPED = "1.2.840.113549.1.7.4"
  996. szOID_PKCS_7_DIGESTED = "1.2.840.113549.1.7.5"
  997. szOID_PKCS_7_ENCRYPTED = "1.2.840.113549.1.7.6"
  998. szOID_PKCS_9_CONTENT_TYPE = "1.2.840.113549.1.9.3"
  999. szOID_PKCS_9_MESSAGE_DIGEST = "1.2.840.113549.1.9.4"
  1000. CMSG_DATA = 1
  1001. CMSG_SIGNED = 2
  1002. CMSG_ENVELOPED = 3
  1003. CMSG_SIGNED_AND_ENVELOPED = 4
  1004. CMSG_HASHED = 5
  1005. CMSG_ENCRYPTED = 6
  1006. CMSG_ALL_FLAGS = -1
  1007. CMSG_DATA_FLAG = (1 << CMSG_DATA)
  1008. CMSG_SIGNED_FLAG = (1 << CMSG_SIGNED)
  1009. CMSG_ENVELOPED_FLAG = (1 << CMSG_ENVELOPED)
  1010. CMSG_SIGNED_AND_ENVELOPED_FLAG = (1 << CMSG_SIGNED_AND_ENVELOPED)
  1011. CMSG_HASHED_FLAG = (1 << CMSG_HASHED)
  1012. CMSG_ENCRYPTED_FLAG = (1 << CMSG_ENCRYPTED)
  1013. CERT_ID_ISSUER_SERIAL_NUMBER = 1
  1014. CERT_ID_KEY_IDENTIFIER = 2
  1015. CERT_ID_SHA1_HASH = 3
  1016. CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE = 1
  1017. CMSG_KEY_AGREE_STATIC_KEY_CHOICE = 2
  1018. CMSG_MAIL_LIST_HANDLE_KEY_CHOICE = 1
  1019. CMSG_KEY_TRANS_RECIPIENT = 1
  1020. CMSG_KEY_AGREE_RECIPIENT = 2
  1021. CMSG_MAIL_LIST_RECIPIENT = 3
  1022. CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG = (-2147483648)
  1023. CMSG_RC4_NO_SALT_FLAG = 0x40000000
  1024. CMSG_INDEFINITE_LENGTH = ((-1))
  1025. CMSG_BARE_CONTENT_FLAG = 0x00000001
  1026. CMSG_LENGTH_ONLY_FLAG = 0x00000002
  1027. CMSG_DETACHED_FLAG = 0x00000004
  1028. CMSG_AUTHENTICATED_ATTRIBUTES_FLAG = 0x00000008
  1029. CMSG_CONTENTS_OCTETS_FLAG = 0x00000010
  1030. CMSG_MAX_LENGTH_FLAG = 0x00000020
  1031. CMSG_CMS_ENCAPSULATED_CONTENT_FLAG = 0x00000040
  1032. CMSG_CRYPT_RELEASE_CONTEXT_FLAG = 0x00008000
  1033. CMSG_TYPE_PARAM = 1
  1034. CMSG_CONTENT_PARAM = 2
  1035. CMSG_BARE_CONTENT_PARAM = 3
  1036. CMSG_INNER_CONTENT_TYPE_PARAM = 4
  1037. CMSG_SIGNER_COUNT_PARAM = 5
  1038. CMSG_SIGNER_INFO_PARAM = 6
  1039. CMSG_SIGNER_CERT_INFO_PARAM = 7
  1040. CMSG_SIGNER_HASH_ALGORITHM_PARAM = 8
  1041. CMSG_SIGNER_AUTH_ATTR_PARAM = 9
  1042. CMSG_SIGNER_UNAUTH_ATTR_PARAM = 10
  1043. CMSG_CERT_COUNT_PARAM = 11
  1044. CMSG_CERT_PARAM = 12
  1045. CMSG_CRL_COUNT_PARAM = 13
  1046. CMSG_CRL_PARAM = 14
  1047. CMSG_ENVELOPE_ALGORITHM_PARAM = 15
  1048. CMSG_RECIPIENT_COUNT_PARAM = 17
  1049. CMSG_RECIPIENT_INDEX_PARAM = 18
  1050. CMSG_RECIPIENT_INFO_PARAM = 19
  1051. CMSG_HASH_ALGORITHM_PARAM = 20
  1052. CMSG_HASH_DATA_PARAM = 21
  1053. CMSG_COMPUTED_HASH_PARAM = 22
  1054. CMSG_ENCRYPT_PARAM = 26
  1055. CMSG_ENCRYPTED_DIGEST = 27
  1056. CMSG_ENCODED_SIGNER = 28
  1057. CMSG_ENCODED_MESSAGE = 29
  1058. CMSG_VERSION_PARAM = 30
  1059. CMSG_ATTR_CERT_COUNT_PARAM = 31
  1060. CMSG_ATTR_CERT_PARAM = 32
  1061. CMSG_CMS_RECIPIENT_COUNT_PARAM = 33
  1062. CMSG_CMS_RECIPIENT_INDEX_PARAM = 34
  1063. CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM = 35
  1064. CMSG_CMS_RECIPIENT_INFO_PARAM = 36
  1065. CMSG_UNPROTECTED_ATTR_PARAM = 37
  1066. CMSG_SIGNER_CERT_ID_PARAM = 38
  1067. CMSG_CMS_SIGNER_INFO_PARAM = 39
  1068. CMSG_SIGNED_DATA_V1 = 1
  1069. CMSG_SIGNED_DATA_V3 = 3
  1070. CMSG_SIGNED_DATA_PKCS_1_5_VERSION = CMSG_SIGNED_DATA_V1
  1071. CMSG_SIGNED_DATA_CMS_VERSION = CMSG_SIGNED_DATA_V3
  1072. CMSG_SIGNER_INFO_V1 = 1
  1073. CMSG_SIGNER_INFO_V3 = 3
  1074. CMSG_SIGNER_INFO_PKCS_1_5_VERSION = CMSG_SIGNER_INFO_V1
  1075. CMSG_SIGNER_INFO_CMS_VERSION = CMSG_SIGNER_INFO_V3
  1076. CMSG_HASHED_DATA_V0 = 0
  1077. CMSG_HASHED_DATA_V2 = 2
  1078. CMSG_HASHED_DATA_PKCS_1_5_VERSION = CMSG_HASHED_DATA_V0
  1079. CMSG_HASHED_DATA_CMS_VERSION = CMSG_HASHED_DATA_V2
  1080. CMSG_ENVELOPED_DATA_V0 = 0
  1081. CMSG_ENVELOPED_DATA_V2 = 2
  1082. CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION = CMSG_ENVELOPED_DATA_V0
  1083. CMSG_ENVELOPED_DATA_CMS_VERSION = CMSG_ENVELOPED_DATA_V2
  1084. CMSG_KEY_AGREE_ORIGINATOR_CERT = 1
  1085. CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY = 2
  1086. CMSG_ENVELOPED_RECIPIENT_V0 = 0
  1087. CMSG_ENVELOPED_RECIPIENT_V2 = 2
  1088. CMSG_ENVELOPED_RECIPIENT_V3 = 3
  1089. CMSG_ENVELOPED_RECIPIENT_V4 = 4
  1090. CMSG_KEY_TRANS_PKCS_1_5_VERSION = CMSG_ENVELOPED_RECIPIENT_V0
  1091. CMSG_KEY_TRANS_CMS_VERSION = CMSG_ENVELOPED_RECIPIENT_V2
  1092. CMSG_KEY_AGREE_VERSION = CMSG_ENVELOPED_RECIPIENT_V3
  1093. CMSG_MAIL_LIST_VERSION = CMSG_ENVELOPED_RECIPIENT_V4
  1094. CMSG_CTRL_VERIFY_SIGNATURE = 1
  1095. CMSG_CTRL_DECRYPT = 2
  1096. CMSG_CTRL_VERIFY_HASH = 5
  1097. CMSG_CTRL_ADD_SIGNER = 6
  1098. CMSG_CTRL_DEL_SIGNER = 7
  1099. CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR = 8
  1100. CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR = 9
  1101. CMSG_CTRL_ADD_CERT = 10
  1102. CMSG_CTRL_DEL_CERT = 11
  1103. CMSG_CTRL_ADD_CRL = 12
  1104. CMSG_CTRL_DEL_CRL = 13
  1105. CMSG_CTRL_ADD_ATTR_CERT = 14
  1106. CMSG_CTRL_DEL_ATTR_CERT = 15
  1107. CMSG_CTRL_KEY_TRANS_DECRYPT = 16
  1108. CMSG_CTRL_KEY_AGREE_DECRYPT = 17
  1109. CMSG_CTRL_MAIL_LIST_DECRYPT = 18
  1110. CMSG_CTRL_VERIFY_SIGNATURE_EX = 19
  1111. CMSG_CTRL_ADD_CMS_SIGNER_INFO = 20
  1112. CMSG_VERIFY_SIGNER_PUBKEY = 1
  1113. CMSG_VERIFY_SIGNER_CERT = 2
  1114. CMSG_VERIFY_SIGNER_CHAIN = 3
  1115. CMSG_VERIFY_SIGNER_NULL = 4
  1116. CMSG_OID_GEN_ENCRYPT_KEY_FUNC = "CryptMsgDllGenEncryptKey"
  1117. CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC = "CryptMsgDllExportEncryptKey"
  1118. CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC = "CryptMsgDllImportEncryptKey"
  1119. CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG = 0x00000001
  1120. CMSG_DEFAULT_INSTALLABLE_FUNC_OID = 1
  1121. CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG = 0x00000001
  1122. CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG = 0x00008000
  1123. CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC = "CryptMsgDllGenContentEncryptKey"
  1124. CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG = 0x00000001
  1125. CMSG_OID_EXPORT_KEY_TRANS_FUNC = "CryptMsgDllExportKeyTrans"
  1126. CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG = 0x00000001
  1127. CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG = 0x00000002
  1128. CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG = 0x00000004
  1129. CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG = 0x00000008
  1130. CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG = 0x00000010
  1131. CMSG_OID_EXPORT_KEY_AGREE_FUNC = "CryptMsgDllExportKeyAgree"
  1132. CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG = 0x00000001
  1133. CMSG_OID_EXPORT_MAIL_LIST_FUNC = "CryptMsgDllExportMailList"
  1134. CMSG_OID_IMPORT_KEY_TRANS_FUNC = "CryptMsgDllImportKeyTrans"
  1135. CMSG_OID_IMPORT_KEY_AGREE_FUNC = "CryptMsgDllImportKeyAgree"
  1136. CMSG_OID_IMPORT_MAIL_LIST_FUNC = "CryptMsgDllImportMailList"
  1137. # Certificate property id's used with CertGetCertificateContextProperty
  1138. CERT_KEY_PROV_HANDLE_PROP_ID = 1
  1139. CERT_KEY_PROV_INFO_PROP_ID = 2
  1140. CERT_SHA1_HASH_PROP_ID = 3
  1141. CERT_MD5_HASH_PROP_ID = 4
  1142. CERT_HASH_PROP_ID = CERT_SHA1_HASH_PROP_ID
  1143. CERT_KEY_CONTEXT_PROP_ID = 5
  1144. CERT_KEY_SPEC_PROP_ID = 6
  1145. CERT_IE30_RESERVED_PROP_ID = 7
  1146. CERT_PUBKEY_HASH_RESERVED_PROP_ID = 8
  1147. CERT_ENHKEY_USAGE_PROP_ID = 9
  1148. CERT_CTL_USAGE_PROP_ID = CERT_ENHKEY_USAGE_PROP_ID
  1149. CERT_NEXT_UPDATE_LOCATION_PROP_ID = 10
  1150. CERT_FRIENDLY_NAME_PROP_ID = 11
  1151. CERT_PVK_FILE_PROP_ID = 12
  1152. CERT_DESCRIPTION_PROP_ID = 13
  1153. CERT_ACCESS_STATE_PROP_ID = 14
  1154. CERT_SIGNATURE_HASH_PROP_ID = 15
  1155. CERT_SMART_CARD_DATA_PROP_ID = 16
  1156. CERT_EFS_PROP_ID = 17
  1157. CERT_FORTEZZA_DATA_PROP_ID = 18
  1158. CERT_ARCHIVED_PROP_ID = 19
  1159. CERT_KEY_IDENTIFIER_PROP_ID = 20
  1160. CERT_AUTO_ENROLL_PROP_ID = 21
  1161. CERT_PUBKEY_ALG_PARA_PROP_ID = 22
  1162. CERT_CROSS_CERT_DIST_POINTS_PROP_ID = 23
  1163. CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID = 24
  1164. CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID = 25
  1165. CERT_ENROLLMENT_PROP_ID = 26
  1166. CERT_DATE_STAMP_PROP_ID = 27
  1167. CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID = 28
  1168. CERT_SUBJECT_NAME_MD5_HASH_PROP_ID = 29
  1169. CERT_EXTENDED_ERROR_INFO_PROP_ID = 30
  1170. CERT_RENEWAL_PROP_ID = 64
  1171. CERT_ARCHIVED_KEY_HASH_PROP_ID = 65
  1172. CERT_AUTO_ENROLL_RETRY_PROP_ID = 66
  1173. CERT_AIA_URL_RETRIEVED_PROP_ID = 67
  1174. CERT_AUTHORITY_INFO_ACCESS_PROP_ID = 68
  1175. CERT_BACKED_UP_PROP_ID = 69
  1176. CERT_OCSP_RESPONSE_PROP_ID = 70
  1177. CERT_REQUEST_ORIGINATOR_PROP_ID = 71
  1178. CERT_SOURCE_LOCATION_PROP_ID = 72
  1179. CERT_SOURCE_URL_PROP_ID = 73
  1180. CERT_NEW_KEY_PROP_ID = 74
  1181. CERT_OCSP_CACHE_PREFIX_PROP_ID = 75
  1182. CERT_SMART_CARD_ROOT_INFO_PROP_ID = 76
  1183. CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID = 77
  1184. CERT_NCRYPT_KEY_HANDLE_PROP_ID = 78
  1185. CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID = 79
  1186. CERT_SUBJECT_INFO_ACCESS_PROP_ID = 80
  1187. CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID = 81
  1188. CERT_CA_DISABLE_CRL_PROP_ID = 82
  1189. CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID = 83
  1190. CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID = 84
  1191. CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID = 85
  1192. CERT_SUBJECT_DISABLE_CRL_PROP_ID = 86
  1193. CERT_CEP_PROP_ID = 87
  1194. CERT_SIGN_HASH_CNG_ALG_PROP_ID = 89
  1195. CERT_SCARD_PIN_ID_PROP_ID = 90
  1196. CERT_SCARD_PIN_INFO_PROP_ID = 91
  1197. CERT_FIRST_RESERVED_PROP_ID = 92
  1198. CERT_LAST_RESERVED_PROP_ID = 0x00007FFF
  1199. CERT_FIRST_USER_PROP_ID = 0x00008000
  1200. CERT_LAST_USER_PROP_ID = 0x0000FFFF
  1201. szOID_CERT_PROP_ID_PREFIX = "1.3.6.1.4.1.311.10.11."
  1202. szOID_CERT_KEY_IDENTIFIER_PROP_ID = "1.3.6.1.4.1.311.10.11.20"
  1203. szOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID = \
  1204. "1.3.6.1.4.1.311.10.11.28"
  1205. szOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID = \
  1206. "1.3.6.1.4.1.311.10.11.29"
  1207. CERT_ACCESS_STATE_WRITE_PERSIST_FLAG = 0x1
  1208. CERT_ACCESS_STATE_SYSTEM_STORE_FLAG = 0x2
  1209. CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG = 0x4
  1210. CERT_SET_KEY_PROV_HANDLE_PROP_ID = 0x00000001
  1211. CERT_SET_KEY_CONTEXT_PROP_ID = 0x00000001
  1212. sz_CERT_STORE_PROV_MEMORY = "Memory"
  1213. sz_CERT_STORE_PROV_FILENAME_W = "File"
  1214. sz_CERT_STORE_PROV_FILENAME = sz_CERT_STORE_PROV_FILENAME_W
  1215. sz_CERT_STORE_PROV_SYSTEM_W = "System"
  1216. sz_CERT_STORE_PROV_SYSTEM = sz_CERT_STORE_PROV_SYSTEM_W
  1217. sz_CERT_STORE_PROV_PKCS7 = "PKCS7"
  1218. sz_CERT_STORE_PROV_SERIALIZED = "Serialized"
  1219. sz_CERT_STORE_PROV_COLLECTION = "Collection"
  1220. sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W = "SystemRegistry"
  1221. sz_CERT_STORE_PROV_SYSTEM_REGISTRY = sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W
  1222. sz_CERT_STORE_PROV_PHYSICAL_W = "Physical"
  1223. sz_CERT_STORE_PROV_PHYSICAL = sz_CERT_STORE_PROV_PHYSICAL_W
  1224. sz_CERT_STORE_PROV_SMART_CARD_W = "SmartCard"
  1225. sz_CERT_STORE_PROV_SMART_CARD = sz_CERT_STORE_PROV_SMART_CARD_W
  1226. sz_CERT_STORE_PROV_LDAP_W = "Ldap"
  1227. sz_CERT_STORE_PROV_LDAP = sz_CERT_STORE_PROV_LDAP_W
  1228. CERT_STORE_SIGNATURE_FLAG = 0x00000001
  1229. CERT_STORE_TIME_VALIDITY_FLAG = 0x00000002
  1230. CERT_STORE_REVOCATION_FLAG = 0x00000004
  1231. CERT_STORE_NO_CRL_FLAG = 0x00010000
  1232. CERT_STORE_NO_ISSUER_FLAG = 0x00020000
  1233. CERT_STORE_BASE_CRL_FLAG = 0x00000100
  1234. CERT_STORE_DELTA_CRL_FLAG = 0x00000200
  1235. CERT_STORE_NO_CRYPT_RELEASE_FLAG = 0x00000001
  1236. CERT_STORE_SET_LOCALIZED_NAME_FLAG = 0x00000002
  1237. CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004
  1238. CERT_STORE_DELETE_FLAG = 0x00000010
  1239. CERT_STORE_UNSAFE_PHYSICAL_FLAG = 0x00000020
  1240. CERT_STORE_SHARE_STORE_FLAG = 0x00000040
  1241. CERT_STORE_SHARE_CONTEXT_FLAG = 0x00000080
  1242. CERT_STORE_MANIFOLD_FLAG = 0x00000100
  1243. CERT_STORE_ENUM_ARCHIVED_FLAG = 0x00000200
  1244. CERT_STORE_UPDATE_KEYID_FLAG = 0x00000400
  1245. CERT_STORE_BACKUP_RESTORE_FLAG = 0x00000800
  1246. CERT_STORE_READONLY_FLAG = 0x00008000
  1247. CERT_STORE_OPEN_EXISTING_FLAG = 0x00004000
  1248. CERT_STORE_CREATE_NEW_FLAG = 0x00002000
  1249. CERT_STORE_MAXIMUM_ALLOWED_FLAG = 0x00001000
  1250. CERT_SYSTEM_STORE_MASK = (-65536)
  1251. CERT_SYSTEM_STORE_RELOCATE_FLAG = (-2147483648)
  1252. CERT_SYSTEM_STORE_UNPROTECTED_FLAG = 0x40000000
  1253. CERT_SYSTEM_STORE_LOCATION_MASK = 0x00FF0000
  1254. CERT_SYSTEM_STORE_LOCATION_SHIFT = 16
  1255. CERT_SYSTEM_STORE_CURRENT_USER_ID = 1
  1256. CERT_SYSTEM_STORE_LOCAL_MACHINE_ID = 2
  1257. CERT_SYSTEM_STORE_CURRENT_SERVICE_ID = 4
  1258. CERT_SYSTEM_STORE_SERVICES_ID = 5
  1259. CERT_SYSTEM_STORE_USERS_ID = 6
  1260. CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID = 7
  1261. CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID = 8
  1262. CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID = 9
  1263. CERT_SYSTEM_STORE_CURRENT_USER = \
  1264. (CERT_SYSTEM_STORE_CURRENT_USER_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1265. CERT_SYSTEM_STORE_LOCAL_MACHINE = \
  1266. (CERT_SYSTEM_STORE_LOCAL_MACHINE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1267. CERT_SYSTEM_STORE_CURRENT_SERVICE = \
  1268. (CERT_SYSTEM_STORE_CURRENT_SERVICE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1269. CERT_SYSTEM_STORE_SERVICES = \
  1270. (CERT_SYSTEM_STORE_SERVICES_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1271. CERT_SYSTEM_STORE_USERS = \
  1272. (CERT_SYSTEM_STORE_USERS_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1273. CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY = \
  1274. (CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << \
  1275. CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1276. CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY = \
  1277. (CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << \
  1278. CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1279. CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE = \
  1280. (CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << \
  1281. CERT_SYSTEM_STORE_LOCATION_SHIFT)
  1282. CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG = 0x1
  1283. CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG = 0x2
  1284. CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG = 0x4
  1285. CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG = 0x8
  1286. CERT_PROT_ROOT_ONLY_LM_GPT_FLAG = 0x8
  1287. CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG = 0x10
  1288. CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG = 0x20
  1289. CERT_TRUST_PUB_ALLOW_TRUST_MASK = 0x00000003
  1290. CERT_TRUST_PUB_ALLOW_END_USER_TRUST = 0x00000000
  1291. CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST = 0x00000001
  1292. CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST = 0x00000002
  1293. CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG = 0x00000100
  1294. CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG = 0x00000200
  1295. CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH = r"Software\Microsoft\SystemCertificates\AuthRoot\AutoUpdate"
  1296. CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG = 0x1
  1297. CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG = 0x2
  1298. CERT_AUTH_ROOT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME = "RootDirUrl"
  1299. CERT_AUTH_ROOT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME = "SyncDeltaTime"
  1300. CERT_AUTH_ROOT_AUTO_UPDATE_FLAGS_VALUE_NAME = "Flags"
  1301. CERT_AUTH_ROOT_CTL_FILENAME = "authroot.stl"
  1302. CERT_AUTH_ROOT_CTL_FILENAME_A = "authroot.stl"
  1303. CERT_AUTH_ROOT_CAB_FILENAME = "authrootstl.cab"
  1304. CERT_AUTH_ROOT_SEQ_FILENAME = "authrootseq.txt"
  1305. CERT_AUTH_ROOT_CERT_EXT = ".crt"
  1306. CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH = r"Software\Policies\Microsoft\SystemCertificates"
  1307. CERT_EFSBLOB_REGPATH = CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH + r"\EFS"
  1308. CERT_EFSBLOB_VALUE_NAME = "EFSBlob"
  1309. CERT_PROT_ROOT_FLAGS_REGPATH = CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH +r"\Root\ProtectedRoots"
  1310. CERT_PROT_ROOT_FLAGS_VALUE_NAME = "Flags"
  1311. CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH = CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH + r"\TrustedPublisher\Safer"
  1312. CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH = r"Software\Microsoft\SystemCertificates"
  1313. CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH = CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH + r"\TrustedPublisher\Safer"
  1314. CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME = "AuthenticodeFlags"
  1315. CERT_OCM_SUBCOMPONENTS_LOCAL_MACHINE_REGPATH = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OC Manager\Subcomponents"
  1316. CERT_OCM_SUBCOMPONENTS_ROOT_AUTO_UPDATE_VALUE_NAME = r"RootAutoUpdate"
  1317. CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH = CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH + r"\AuthRoot"
  1318. CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME = "DisableRootAutoUpdate"
  1319. CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH = CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH + r"\AuthRoot\AutoUpdate"
  1320. CERT_REGISTRY_STORE_REMOTE_FLAG = 0x10000
  1321. CERT_REGISTRY_STORE_SERIALIZED_FLAG = 0x20000
  1322. CERT_REGISTRY_STORE_CLIENT_GPT_FLAG = (-2147483648)
  1323. CERT_REGISTRY_STORE_LM_GPT_FLAG = 0x01000000
  1324. CERT_REGISTRY_STORE_ROAMING_FLAG = 0x40000
  1325. CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG = 0x80000
  1326. CERT_IE_DIRTY_FLAGS_REGPATH = r"Software\Microsoft\Cryptography\IEDirtyFlags"
  1327. CERT_FILE_STORE_COMMIT_ENABLE_FLAG = 0x10000
  1328. CERT_LDAP_STORE_SIGN_FLAG = 0x10000
  1329. CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG = 0x20000
  1330. CERT_LDAP_STORE_OPENED_FLAG = 0x40000
  1331. CERT_LDAP_STORE_UNBIND_FLAG = 0x80000
  1332. CRYPT_OID_OPEN_STORE_PROV_FUNC = "CertDllOpenStoreProv"
  1333. CERT_STORE_PROV_EXTERNAL_FLAG = 0x1
  1334. CERT_STORE_PROV_DELETED_FLAG = 0x2
  1335. CERT_STORE_PROV_NO_PERSIST_FLAG = 0x4
  1336. CERT_STORE_PROV_SYSTEM_STORE_FLAG = 0x8
  1337. CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG = 0x10
  1338. CERT_STORE_PROV_CLOSE_FUNC = 0
  1339. CERT_STORE_PROV_READ_CERT_FUNC = 1
  1340. CERT_STORE_PROV_WRITE_CERT_FUNC = 2
  1341. CERT_STORE_PROV_DELETE_CERT_FUNC = 3
  1342. CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC = 4
  1343. CERT_STORE_PROV_READ_CRL_FUNC = 5
  1344. CERT_STORE_PROV_WRITE_CRL_FUNC = 6
  1345. CERT_STORE_PROV_DELETE_CRL_FUNC = 7
  1346. CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC = 8
  1347. CERT_STORE_PROV_READ_CTL_FUNC = 9
  1348. CERT_STORE_PROV_WRITE_CTL_FUNC = 10
  1349. CERT_STORE_PROV_DELETE_CTL_FUNC = 11
  1350. CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC = 12
  1351. CERT_STORE_PROV_CONTROL_FUNC = 13
  1352. CERT_STORE_PROV_FIND_CERT_FUNC = 14
  1353. CERT_STORE_PROV_FREE_FIND_CERT_FUNC = 15
  1354. CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC = 16
  1355. CERT_STORE_PROV_FIND_CRL_FUNC = 17
  1356. CERT_STORE_PROV_FREE_FIND_CRL_FUNC = 18
  1357. CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC = 19
  1358. CERT_STORE_PROV_FIND_CTL_FUNC = 20
  1359. CERT_STORE_PROV_FREE_FIND_CTL_FUNC = 21
  1360. CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC = 22
  1361. CERT_STORE_PROV_WRITE_ADD_FLAG = 0x1
  1362. CERT_STORE_SAVE_AS_STORE = 1
  1363. CERT_STORE_SAVE_AS_PKCS7 = 2
  1364. CERT_STORE_SAVE_TO_FILE = 1
  1365. CERT_STORE_SAVE_TO_MEMORY = 2
  1366. CERT_STORE_SAVE_TO_FILENAME_A = 3
  1367. CERT_STORE_SAVE_TO_FILENAME_W = 4
  1368. CERT_STORE_SAVE_TO_FILENAME = CERT_STORE_SAVE_TO_FILENAME_W
  1369. CERT_CLOSE_STORE_FORCE_FLAG = 0x00000001
  1370. CERT_CLOSE_STORE_CHECK_FLAG = 0x00000002
  1371. CERT_COMPARE_MASK = 0xFFFF
  1372. CERT_COMPARE_SHIFT = 16
  1373. CERT_COMPARE_ANY = 0
  1374. CERT_COMPARE_SHA1_HASH = 1
  1375. CERT_COMPARE_NAME = 2
  1376. CERT_COMPARE_ATTR = 3
  1377. CERT_COMPARE_MD5_HASH = 4
  1378. CERT_COMPARE_PROPERTY = 5
  1379. CERT_COMPARE_PUBLIC_KEY = 6
  1380. CERT_COMPARE_HASH = CERT_COMPARE_SHA1_HASH
  1381. CERT_COMPARE_NAME_STR_A = 7
  1382. CERT_COMPARE_NAME_STR_W = 8
  1383. CERT_COMPARE_KEY_SPEC = 9
  1384. CERT_COMPARE_ENHKEY_USAGE = 10
  1385. CERT_COMPARE_CTL_USAGE = CERT_COMPARE_ENHKEY_USAGE
  1386. CERT_COMPARE_SUBJECT_CERT = 11
  1387. CERT_COMPARE_ISSUER_OF = 12
  1388. CERT_COMPARE_EXISTING = 13
  1389. CERT_COMPARE_SIGNATURE_HASH = 14
  1390. CERT_COMPARE_KEY_IDENTIFIER = 15
  1391. CERT_COMPARE_CERT_ID = 16
  1392. CERT_COMPARE_CROSS_CERT_DIST_POINTS = 17
  1393. CERT_COMPARE_PUBKEY_MD5_HASH = 18
  1394. CERT_FIND_ANY = (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT)
  1395. CERT_FIND_SHA1_HASH = (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT)
  1396. CERT_FIND_MD5_HASH = (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT)
  1397. CERT_FIND_SIGNATURE_HASH = (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT)
  1398. CERT_FIND_KEY_IDENTIFIER = (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT)
  1399. CERT_FIND_HASH = CERT_FIND_SHA1_HASH
  1400. CERT_FIND_PROPERTY = (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT)
  1401. CERT_FIND_PUBLIC_KEY = (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT)
  1402. CERT_FIND_SUBJECT_NAME = (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | \
  1403. CERT_INFO_SUBJECT_FLAG)
  1404. CERT_FIND_SUBJECT_ATTR = (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | \
  1405. CERT_INFO_SUBJECT_FLAG)
  1406. CERT_FIND_ISSUER_NAME = (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT | \
  1407. CERT_INFO_ISSUER_FLAG)
  1408. CERT_FIND_ISSUER_ATTR = (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT | \
  1409. CERT_INFO_ISSUER_FLAG)
  1410. CERT_FIND_SUBJECT_STR_A = (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | \
  1411. CERT_INFO_SUBJECT_FLAG)
  1412. CERT_FIND_SUBJECT_STR_W = (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | \
  1413. CERT_INFO_SUBJECT_FLAG)
  1414. CERT_FIND_SUBJECT_STR = CERT_FIND_SUBJECT_STR_W
  1415. CERT_FIND_ISSUER_STR_A = (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT | \
  1416. CERT_INFO_ISSUER_FLAG)
  1417. CERT_FIND_ISSUER_STR_W = (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT | \
  1418. CERT_INFO_ISSUER_FLAG)
  1419. CERT_FIND_ISSUER_STR = CERT_FIND_ISSUER_STR_W
  1420. CERT_FIND_KEY_SPEC = (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT)
  1421. CERT_FIND_ENHKEY_USAGE = (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT)
  1422. CERT_FIND_CTL_USAGE = CERT_FIND_ENHKEY_USAGE
  1423. CERT_FIND_SUBJECT_CERT = (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT)
  1424. CERT_FIND_ISSUER_OF = (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT)
  1425. CERT_FIND_EXISTING = (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT)
  1426. CERT_FIND_CERT_ID = (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT)
  1427. CERT_FIND_CROSS_CERT_DIST_POINTS = \
  1428. (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT)
  1429. CERT_FIND_PUBKEY_MD5_HASH = \
  1430. (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT)
  1431. CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG = 0x1
  1432. CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG = 0x2
  1433. CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG = 0x4
  1434. CERT_FIND_NO_ENHKEY_USAGE_FLAG = 0x8
  1435. CERT_FIND_OR_ENHKEY_USAGE_FLAG = 0x10
  1436. CERT_FIND_VALID_ENHKEY_USAGE_FLAG = 0x20
  1437. CERT_FIND_OPTIONAL_CTL_USAGE_FLAG = CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG
  1438. CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG = \
  1439. CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG
  1440. CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG = \
  1441. CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG
  1442. CERT_FIND_NO_CTL_USAGE_FLAG = CERT_FIND_NO_ENHKEY_USAGE_FLAG
  1443. CERT_FIND_OR_CTL_USAGE_FLAG = CERT_FIND_OR_ENHKEY_USAGE_FLAG
  1444. CERT_FIND_VALID_CTL_USAGE_FLAG = CERT_FIND_VALID_ENHKEY_USAGE_FLAG
  1445. CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG = (-2147483648)
  1446. CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG = 0x40000000
  1447. CTL_ENTRY_FROM_PROP_CHAIN_FLAG = 0x1
  1448. CRL_FIND_ANY = 0
  1449. CRL_FIND_ISSUED_BY = 1
  1450. CRL_FIND_EXISTING = 2
  1451. CRL_FIND_ISSUED_FOR = 3
  1452. CRL_FIND_ISSUED_BY_AKI_FLAG = 0x1
  1453. CRL_FIND_ISSUED_BY_SIGNATURE_FLAG = 0x2
  1454. CRL_FIND_ISSUED_BY_DELTA_FLAG = 0x4
  1455. CRL_FIND_ISSUED_BY_BASE_FLAG = 0x8
  1456. CERT_STORE_ADD_NEW = 1
  1457. CERT_STORE_ADD_USE_EXISTING = 2
  1458. CERT_STORE_ADD_REPLACE_EXISTING = 3
  1459. CERT_STORE_ADD_ALWAYS = 4
  1460. CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES = 5
  1461. CERT_STORE_ADD_NEWER = 6
  1462. CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES = 7
  1463. CERT_STORE_CERTIFICATE_CONTEXT = 1
  1464. CERT_STORE_CRL_CONTEXT = 2
  1465. CERT_STORE_CTL_CONTEXT = 3
  1466. CERT_STORE_ALL_CONTEXT_FLAG = -1
  1467. CERT_STORE_CERTIFICATE_CONTEXT_FLAG = \
  1468. (1 << CERT_STORE_CERTIFICATE_CONTEXT)
  1469. CERT_STORE_CRL_CONTEXT_FLAG = \
  1470. (1 << CERT_STORE_CRL_CONTEXT)
  1471. CERT_STORE_CTL_CONTEXT_FLAG = \
  1472. (1 << CERT_STORE_CTL_CONTEXT)
  1473. CTL_ANY_SUBJECT_TYPE = 1
  1474. CTL_CERT_SUBJECT_TYPE = 2
  1475. CTL_FIND_ANY = 0
  1476. CTL_FIND_SHA1_HASH = 1
  1477. CTL_FIND_MD5_HASH = 2
  1478. CTL_FIND_USAGE = 3
  1479. CTL_FIND_SUBJECT = 4
  1480. CTL_FIND_EXISTING = 5
  1481. CTL_FIND_NO_LIST_ID_CBDATA = (-1)
  1482. CTL_FIND_SAME_USAGE_FLAG = 0x1
  1483. CERT_STORE_CTRL_RESYNC = 1
  1484. CERT_STORE_CTRL_NOTIFY_CHANGE = 2
  1485. CERT_STORE_CTRL_COMMIT = 3
  1486. CERT_STORE_CTRL_AUTO_RESYNC = 4
  1487. CERT_STORE_CTRL_CANCEL_NOTIFY = 5
  1488. CERT_STORE_CTRL_INHIBIT_DUPLICATE_HANDLE_FLAG = 0x1
  1489. CERT_STORE_CTRL_COMMIT_FORCE_FLAG = 0x1
  1490. CERT_STORE_CTRL_COMMIT_CLEAR_FLAG = 0x2
  1491. CERT_STORE_LOCALIZED_NAME_PROP_ID = 0x1000
  1492. CERT_CREATE_CONTEXT_NOCOPY_FLAG = 0x1
  1493. CERT_CREATE_CONTEXT_SORTED_FLAG = 0x2
  1494. CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG = 0x4
  1495. CERT_CREATE_CONTEXT_NO_ENTRY_FLAG = 0x8
  1496. CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG = 0x1
  1497. CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG = 0x2
  1498. CERT_PHYSICAL_STORE_REMOTE_OPEN_DISABLE_FLAG = 0x4
  1499. CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG = 0x8
  1500. CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG = 0x1
  1501. # Names of physical cert stores
  1502. CERT_PHYSICAL_STORE_DEFAULT_NAME = ".Default"
  1503. CERT_PHYSICAL_STORE_GROUP_POLICY_NAME = ".GroupPolicy"
  1504. CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME = ".LocalMachine"
  1505. CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME = ".UserCertificate"
  1506. CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME = ".LocalMachineGroupPolicy"
  1507. CERT_PHYSICAL_STORE_ENTERPRISE_NAME = ".Enterprise"
  1508. CERT_PHYSICAL_STORE_AUTH_ROOT_NAME = ".AuthRoot"
  1509. CERT_PHYSICAL_STORE_SMART_CARD_NAME = ".SmartCard"
  1510. CRYPT_OID_OPEN_SYSTEM_STORE_PROV_FUNC = "CertDllOpenSystemStoreProv"
  1511. CRYPT_OID_REGISTER_SYSTEM_STORE_FUNC = "CertDllRegisterSystemStore"
  1512. CRYPT_OID_UNREGISTER_SYSTEM_STORE_FUNC = "CertDllUnregisterSystemStore"
  1513. CRYPT_OID_ENUM_SYSTEM_STORE_FUNC = "CertDllEnumSystemStore"
  1514. CRYPT_OID_REGISTER_PHYSICAL_STORE_FUNC = "CertDllRegisterPhysicalStore"
  1515. CRYPT_OID_UNREGISTER_PHYSICAL_STORE_FUNC = "CertDllUnregisterPhysicalStore"
  1516. CRYPT_OID_ENUM_PHYSICAL_STORE_FUNC = "CertDllEnumPhysicalStore"
  1517. CRYPT_OID_SYSTEM_STORE_LOCATION_VALUE_NAME = "SystemStoreLocation"
  1518. CMSG_TRUSTED_SIGNER_FLAG = 0x1
  1519. CMSG_SIGNER_ONLY_FLAG = 0x2
  1520. CMSG_USE_SIGNER_INDEX_FLAG = 0x4
  1521. CMSG_CMS_ENCAPSULATED_CTL_FLAG = 0x00008000
  1522. CMSG_ENCODE_SORTED_CTL_FLAG = 0x1
  1523. CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG = 0x2
  1524. CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG = 0x1
  1525. CERT_VERIFY_TRUSTED_SIGNERS_FLAG = 0x2
  1526. CERT_VERIFY_NO_TIME_CHECK_FLAG = 0x4
  1527. CERT_VERIFY_ALLOW_MORE_USAGE_FLAG = 0x8
  1528. CERT_VERIFY_UPDATED_CTL_FLAG = 0x1
  1529. CERT_CONTEXT_REVOCATION_TYPE = 1
  1530. CERT_VERIFY_REV_CHAIN_FLAG = 0x00000001
  1531. CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION = 0x00000002
  1532. CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG = 0x00000004
  1533. CERT_UNICODE_IS_RDN_ATTRS_FLAG = 0x1
  1534. CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG = 0x2
  1535. CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB = 1
  1536. CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT = 2
  1537. CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL = 3
  1538. CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY = 1
  1539. CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT = 2
  1540. CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN = 3
  1541. CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL = 4
  1542. CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG = 0x00000001
  1543. CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG = 0x00000002
  1544. CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID = 1
  1545. CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID = 2
  1546. CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC = "CryptDllExportPublicKeyInfoEx"
  1547. CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC = "CryptDllImportPublicKeyInfoEx"
  1548. CRYPT_ACQUIRE_CACHE_FLAG = 0x00000001
  1549. CRYPT_ACQUIRE_USE_PROV_INFO_FLAG = 0x00000002
  1550. CRYPT_ACQUIRE_COMPARE_KEY_FLAG = 0x00000004
  1551. CRYPT_ACQUIRE_SILENT_FLAG = 0x00000040
  1552. CRYPT_FIND_USER_KEYSET_FLAG = 0x00000001
  1553. CRYPT_FIND_MACHINE_KEYSET_FLAG = 0x00000002
  1554. CRYPT_FIND_SILENT_KEYSET_FLAG = 0x00000040
  1555. CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC = "CryptDllImportPrivateKeyInfoEx"
  1556. CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC = "CryptDllExportPrivateKeyInfoEx"
  1557. CRYPT_DELETE_KEYSET = CRYPT_DELETEKEYSET
  1558. CERT_SIMPLE_NAME_STR = 1
  1559. CERT_OID_NAME_STR = 2
  1560. CERT_X500_NAME_STR = 3
  1561. CERT_NAME_STR_SEMICOLON_FLAG = 0x40000000
  1562. CERT_NAME_STR_NO_PLUS_FLAG = 0x20000000
  1563. CERT_NAME_STR_NO_QUOTING_FLAG = 0x10000000
  1564. CERT_NAME_STR_CRLF_FLAG = 0x08000000
  1565. CERT_NAME_STR_COMMA_FLAG = 0x04000000
  1566. CERT_NAME_STR_REVERSE_FLAG = 0x02000000
  1567. CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG = 0x00010000
  1568. CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG = 0x00020000
  1569. CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG = 0x00040000
  1570. CERT_NAME_EMAIL_TYPE = 1
  1571. CERT_NAME_RDN_TYPE = 2
  1572. CERT_NAME_ATTR_TYPE = 3
  1573. CERT_NAME_SIMPLE_DISPLAY_TYPE = 4
  1574. CERT_NAME_FRIENDLY_DISPLAY_TYPE = 5
  1575. CERT_NAME_DNS_TYPE = 6
  1576. CERT_NAME_URL_TYPE = 7
  1577. CERT_NAME_UPN_TYPE = 8
  1578. CERT_NAME_ISSUER_FLAG = 0x1
  1579. CERT_NAME_DISABLE_IE4_UTF8_FLAG = 0x00010000
  1580. CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG = 0x00000001
  1581. CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG = 0x00000002
  1582. CRYPT_MESSAGE_KEYID_SIGNER_FLAG = 0x00000004
  1583. CRYPT_MESSAGE_SILENT_KEYSET_FLAG = 0x00000040
  1584. CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG = 0x4
  1585. CERT_QUERY_OBJECT_FILE = 0x00000001
  1586. CERT_QUERY_OBJECT_BLOB = 0x00000002
  1587. CERT_QUERY_CONTENT_CERT = 1
  1588. CERT_QUERY_CONTENT_CTL = 2
  1589. CERT_QUERY_CONTENT_CRL = 3
  1590. CERT_QUERY_CONTENT_SERIALIZED_STORE = 4
  1591. CERT_QUERY_CONTENT_SERIALIZED_CERT = 5
  1592. CERT_QUERY_CONTENT_SERIALIZED_CTL = 6
  1593. CERT_QUERY_CONTENT_SERIALIZED_CRL = 7
  1594. CERT_QUERY_CONTENT_PKCS7_SIGNED = 8
  1595. CERT_QUERY_CONTENT_PKCS7_UNSIGNED = 9
  1596. CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED = 10
  1597. CERT_QUERY_CONTENT_PKCS10 = 11
  1598. CERT_QUERY_CONTENT_PFX = 12
  1599. CERT_QUERY_CONTENT_CERT_PAIR = 13
  1600. CERT_QUERY_CONTENT_FLAG_CERT = \
  1601. ( 1 << CERT_QUERY_CONTENT_CERT)
  1602. CERT_QUERY_CONTENT_FLAG_CTL = \
  1603. ( 1 << CERT_QUERY_CONTENT_CTL)
  1604. CERT_QUERY_CONTENT_FLAG_CRL = \
  1605. ( 1 << CERT_QUERY_CONTENT_CRL)
  1606. CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE = \
  1607. ( 1 << CERT_QUERY_CONTENT_SERIALIZED_STORE)
  1608. CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT = \
  1609. ( 1 << CERT_QUERY_CONTENT_SERIALIZED_CERT)
  1610. CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL = \
  1611. ( 1 << CERT_QUERY_CONTENT_SERIALIZED_CTL)
  1612. CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL = \
  1613. ( 1 << CERT_QUERY_CONTENT_SERIALIZED_CRL)
  1614. CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED = \
  1615. ( 1 << CERT_QUERY_CONTENT_PKCS7_SIGNED)
  1616. CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED = \
  1617. ( 1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED)
  1618. CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED = \
  1619. ( 1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED)
  1620. CERT_QUERY_CONTENT_FLAG_PKCS10 = \
  1621. ( 1 << CERT_QUERY_CONTENT_PKCS10)
  1622. CERT_QUERY_CONTENT_FLAG_PFX = \
  1623. ( 1 << CERT_QUERY_CONTENT_PFX)
  1624. CERT_QUERY_CONTENT_FLAG_CERT_PAIR = \
  1625. ( 1 << CERT_QUERY_CONTENT_CERT_PAIR)
  1626. CERT_QUERY_CONTENT_FLAG_ALL = \
  1627. CERT_QUERY_CONTENT_FLAG_CERT | \
  1628. CERT_QUERY_CONTENT_FLAG_CTL | \
  1629. CERT_QUERY_CONTENT_FLAG_CRL | \
  1630. CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | \
  1631. CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | \
  1632. CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | \
  1633. CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | \
  1634. CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | \
  1635. CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | \
  1636. CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | \
  1637. CERT_QUERY_CONTENT_FLAG_PKCS10 | \
  1638. CERT_QUERY_CONTENT_FLAG_PFX | \
  1639. CERT_QUERY_CONTENT_FLAG_CERT_PAIR
  1640. CERT_QUERY_FORMAT_BINARY = 1
  1641. CERT_QUERY_FORMAT_BASE64_ENCODED = 2
  1642. CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED = 3
  1643. CERT_QUERY_FORMAT_FLAG_BINARY = \
  1644. ( 1 << CERT_QUERY_FORMAT_BINARY)
  1645. CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED = \
  1646. ( 1 << CERT_QUERY_FORMAT_BASE64_ENCODED)
  1647. CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED = \
  1648. ( 1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
  1649. CERT_QUERY_FORMAT_FLAG_ALL = \
  1650. CERT_QUERY_FORMAT_FLAG_BINARY | \
  1651. CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | \
  1652. CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED
  1653. CREDENTIAL_OID_PASSWORD_CREDENTIALS_A = 1
  1654. CREDENTIAL_OID_PASSWORD_CREDENTIALS_W = 2
  1655. CREDENTIAL_OID_PASSWORD_CREDENTIALS = CREDENTIAL_OID_PASSWORD_CREDENTIALS_W
  1656. SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC = "SchemeDllRetrieveEncodedObject"
  1657. SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC = "SchemeDllRetrieveEncodedObjectW"
  1658. CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC = "ContextDllCreateObjectContext"
  1659. CONTEXT_OID_CERTIFICATE = 1
  1660. CONTEXT_OID_CRL = 2
  1661. CONTEXT_OID_CTL = 3
  1662. CONTEXT_OID_PKCS7 = 4
  1663. CONTEXT_OID_CAPI2_ANY = 5
  1664. CONTEXT_OID_OCSP_RESP = 6
  1665. CRYPT_RETRIEVE_MULTIPLE_OBJECTS = 0x00000001
  1666. CRYPT_CACHE_ONLY_RETRIEVAL = 0x00000002
  1667. CRYPT_WIRE_ONLY_RETRIEVAL = 0x00000004
  1668. CRYPT_DONT_CACHE_RESULT = 0x00000008
  1669. CRYPT_ASYNC_RETRIEVAL = 0x00000010
  1670. CRYPT_STICKY_CACHE_RETRIEVAL = 0x00001000
  1671. CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL = 0x00002000
  1672. CRYPT_OFFLINE_CHECK_RETRIEVAL = 0x00004000
  1673. CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE = 0x00008000
  1674. CRYPT_LDAP_SIGN_RETRIEVAL = 0x00010000
  1675. CRYPT_NO_AUTH_RETRIEVAL = 0x00020000
  1676. CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL = 0x00040000
  1677. CRYPT_AIA_RETRIEVAL = 0x00080000
  1678. CRYPT_VERIFY_CONTEXT_SIGNATURE = 0x00000020
  1679. CRYPT_VERIFY_DATA_HASH = 0x00000040
  1680. CRYPT_KEEP_TIME_VALID = 0x00000080
  1681. CRYPT_DONT_VERIFY_SIGNATURE = 0x00000100
  1682. CRYPT_DONT_CHECK_TIME_VALIDITY = 0x00000200
  1683. CRYPT_CHECK_FRESHNESS_TIME_VALIDITY = 0x00000400
  1684. CRYPT_ACCUMULATIVE_TIMEOUT = 0x00000800
  1685. CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION = 1
  1686. CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL = 2
  1687. CRYPT_GET_URL_FROM_PROPERTY = 0x00000001
  1688. CRYPT_GET_URL_FROM_EXTENSION = 0x00000002
  1689. CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE = 0x00000004
  1690. CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE = 0x00000008
  1691. URL_OID_GET_OBJECT_URL_FUNC = "UrlDllGetObjectUrl"
  1692. TIME_VALID_OID_GET_OBJECT_FUNC = "TimeValidDllGetObject"
  1693. TIME_VALID_OID_FLUSH_OBJECT_FUNC = "TimeValidDllFlushObject"
  1694. TIME_VALID_OID_GET_CTL = 1
  1695. TIME_VALID_OID_GET_CRL = 2
  1696. TIME_VALID_OID_GET_CRL_FROM_CERT = 3
  1697. TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT = 4
  1698. TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL = 5
  1699. TIME_VALID_OID_FLUSH_CTL = 1
  1700. TIME_VALID_OID_FLUSH_CRL = 2
  1701. TIME_VALID_OID_FLUSH_CRL_FROM_CERT = 3
  1702. TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT = 4
  1703. TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL = 5
  1704. CRYPTPROTECT_PROMPT_ON_UNPROTECT = 0x1
  1705. CRYPTPROTECT_PROMPT_ON_PROTECT = 0x2
  1706. CRYPTPROTECT_PROMPT_RESERVED = 0x04
  1707. CRYPTPROTECT_PROMPT_STRONG = 0x08
  1708. CRYPTPROTECT_PROMPT_REQUIRE_STRONG = 0x10
  1709. CRYPTPROTECT_UI_FORBIDDEN = 0x1
  1710. CRYPTPROTECT_LOCAL_MACHINE = 0x4
  1711. CRYPTPROTECT_CRED_SYNC = 0x8
  1712. CRYPTPROTECT_AUDIT = 0x10
  1713. CRYPTPROTECT_NO_RECOVERY = 0x20
  1714. CRYPTPROTECT_VERIFY_PROTECTION = 0x40
  1715. CRYPTPROTECT_CRED_REGENERATE = 0x80
  1716. CRYPTPROTECT_FIRST_RESERVED_FLAGVAL = 0x0FFFFFFF
  1717. CRYPTPROTECT_LAST_RESERVED_FLAGVAL = (-1)
  1718. CRYPTPROTECTMEMORY_BLOCK_SIZE = 16
  1719. CRYPTPROTECTMEMORY_SAME_PROCESS = 0x00
  1720. CRYPTPROTECTMEMORY_CROSS_PROCESS = 0x01
  1721. CRYPTPROTECTMEMORY_SAME_LOGON = 0x02
  1722. CERT_CREATE_SELFSIGN_NO_SIGN = 1
  1723. CERT_CREATE_SELFSIGN_NO_KEY_INFO = 2
  1724. CRYPT_KEYID_MACHINE_FLAG = 0x00000020
  1725. CRYPT_KEYID_ALLOC_FLAG = 0x00008000
  1726. CRYPT_KEYID_DELETE_FLAG = 0x00000010
  1727. CRYPT_KEYID_SET_NEW_FLAG = 0x00002000
  1728. CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT = 5
  1729. CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT = 10
  1730. CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT = 100000
  1731. CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT = 10
  1732. CERT_CHAIN_CACHE_END_CERT = 0x00000001
  1733. CERT_CHAIN_THREAD_STORE_SYNC = 0x00000002
  1734. CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL = 0x00000004
  1735. CERT_CHAIN_USE_LOCAL_MACHINE_STORE = 0x00000008
  1736. CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE = 0x00000010
  1737. CERT_CHAIN_ENABLE_SHARE_STORE = 0x00000020
  1738. CERT_TRUST_NO_ERROR = 0x00000000
  1739. CERT_TRUST_IS_NOT_TIME_VALID = 0x00000001
  1740. CERT_TRUST_IS_NOT_TIME_NESTED = 0x00000002
  1741. CERT_TRUST_IS_REVOKED = 0x00000004
  1742. CERT_TRUST_IS_NOT_SIGNATURE_VALID = 0x00000008
  1743. CERT_TRUST_IS_NOT_VALID_FOR_USAGE = 0x00000010
  1744. CERT_TRUST_IS_UNTRUSTED_ROOT = 0x00000020
  1745. CERT_TRUST_REVOCATION_STATUS_UNKNOWN = 0x00000040
  1746. CERT_TRUST_IS_CYCLIC = 0x00000080
  1747. CERT_TRUST_INVALID_EXTENSION = 0x00000100
  1748. CERT_TRUST_INVALID_POLICY_CONSTRAINTS = 0x00000200
  1749. CERT_TRUST_INVALID_BASIC_CONSTRAINTS = 0x00000400
  1750. CERT_TRUST_INVALID_NAME_CONSTRAINTS = 0x00000800
  1751. CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000
  1752. CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT = 0x00002000
  1753. CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000
  1754. CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT = 0x00008000
  1755. CERT_TRUST_IS_OFFLINE_REVOCATION = 0x01000000
  1756. CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY = 0x02000000
  1757. CERT_TRUST_IS_PARTIAL_CHAIN = 0x00010000
  1758. CERT_TRUST_CTL_IS_NOT_TIME_VALID = 0x00020000
  1759. CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID = 0x00040000
  1760. CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 0x00080000
  1761. CERT_TRUST_HAS_EXACT_MATCH_ISSUER = 0x00000001
  1762. CERT_TRUST_HAS_KEY_MATCH_ISSUER = 0x00000002
  1763. CERT_TRUST_HAS_NAME_MATCH_ISSUER = 0x00000004
  1764. CERT_TRUST_IS_SELF_SIGNED = 0x00000008
  1765. CERT_TRUST_HAS_PREFERRED_ISSUER = 0x00000100
  1766. CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY = 0x00000200
  1767. CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS = 0x00000400
  1768. CERT_TRUST_IS_COMPLEX_CHAIN = 0x00010000
  1769. USAGE_MATCH_TYPE_AND = 0x00000000
  1770. USAGE_MATCH_TYPE_OR = 0x00000001
  1771. CERT_CHAIN_REVOCATION_CHECK_END_CERT = 0x10000000
  1772. CERT_CHAIN_REVOCATION_CHECK_CHAIN = 0x20000000
  1773. CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x40000000
  1774. CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY = (-2147483648)
  1775. CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT = 0x08000000
  1776. CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING = 0x00000040
  1777. CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS = 0x00000080
  1778. CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE = 0x00000100
  1779. CERT_CHAIN_TIMESTAMP_TIME = 0x00000200
  1780. REVOCATION_OID_CRL_REVOCATION = 1
  1781. CERT_CHAIN_FIND_BY_ISSUER = 1
  1782. CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG = 0x0001
  1783. CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG = 0x0002
  1784. CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG = 0x0004
  1785. CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG = 0x0008
  1786. CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG = 0x4000
  1787. CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG = 0x8000
  1788. CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG = 0x00000001
  1789. CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG = 0x00000002
  1790. CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG = 0x00000004
  1791. CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG = 0x00000008
  1792. CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS = ( \
  1793. CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG | \
  1794. CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG | \
  1795. CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG \
  1796. )
  1797. CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG = 0x00000010
  1798. CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG = 0x00000020
  1799. CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG = 0x00000040
  1800. CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG = 0x00000080
  1801. CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG = 0x00000100
  1802. CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG = 0x00000200
  1803. CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG = 0x00000400
  1804. CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG = 0x00000800
  1805. CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS = ( \
  1806. CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG | \
  1807. CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG | \
  1808. CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG | \
  1809. CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG \
  1810. )
  1811. CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG = 0x00008000
  1812. CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG = 0x00004000
  1813. CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC = \
  1814. "CertDllVerifyCertificateChainPolicy"
  1815. AUTHTYPE_CLIENT = 1
  1816. AUTHTYPE_SERVER = 2
  1817. BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG = (-2147483648)
  1818. BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG = 0x40000000
  1819. MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG = 0x00010000
  1820. CRYPT_STRING_BASE64HEADER = 0x00000000
  1821. CRYPT_STRING_BASE64 = 0x00000001
  1822. CRYPT_STRING_BINARY = 0x00000002
  1823. CRYPT_STRING_BASE64REQUESTHEADER = 0x00000003
  1824. CRYPT_STRING_HEX = 0x00000004
  1825. CRYPT_STRING_HEXASCII = 0x00000005
  1826. CRYPT_STRING_BASE64_ANY = 0x00000006
  1827. CRYPT_STRING_ANY = 0x00000007
  1828. CRYPT_STRING_HEX_ANY = 0x00000008
  1829. CRYPT_STRING_BASE64X509CRLHEADER = 0x00000009
  1830. CRYPT_STRING_HEXADDR = 0x0000000a
  1831. CRYPT_STRING_HEXASCIIADDR = 0x0000000b
  1832. CRYPT_STRING_NOCR = (-2147483648)
  1833. CRYPT_USER_KEYSET = 0x00001000
  1834. PKCS12_IMPORT_RESERVED_MASK = (-65536)
  1835. REPORT_NO_PRIVATE_KEY = 0x0001
  1836. REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY = 0x0002
  1837. EXPORT_PRIVATE_KEYS = 0x0004
  1838. PKCS12_EXPORT_RESERVED_MASK = (-65536)
  1839. # Certificate store provider types used with CertOpenStore
  1840. CERT_STORE_PROV_MSG = 1
  1841. CERT_STORE_PROV_MEMORY = 2
  1842. CERT_STORE_PROV_FILE = 3
  1843. CERT_STORE_PROV_REG = 4
  1844. CERT_STORE_PROV_PKCS7 = 5
  1845. CERT_STORE_PROV_SERIALIZED = 6
  1846. CERT_STORE_PROV_FILENAME = 8
  1847. CERT_STORE_PROV_SYSTEM = 10
  1848. CERT_STORE_PROV_COLLECTION = 11
  1849. CERT_STORE_PROV_SYSTEM_REGISTRY = 13
  1850. CERT_STORE_PROV_PHYSICAL = 14
  1851. CERT_STORE_PROV_SMART_CARD = 15
  1852. CERT_STORE_PROV_LDAP = 16
  1853. URL_OID_CERTIFICATE_ISSUER = 1
  1854. URL_OID_CERTIFICATE_CRL_DIST_POINT = 2
  1855. URL_OID_CTL_ISSUER = 3
  1856. URL_OID_CTL_NEXT_UPDATE = 4
  1857. URL_OID_CRL_ISSUER = 5
  1858. URL_OID_CERTIFICATE_FRESHEST_CRL = 6
  1859. URL_OID_CRL_FRESHEST_CRL = 7
  1860. URL_OID_CROSS_CERT_DIST_POINT = 8
  1861. URL_OID_CERTIFICATE_OCSP = 9
  1862. URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT = 10
  1863. URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP = 11
  1864. URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS = 12
  1865. URL_OID_CERTIFICATE_ONLY_OCSP = 13