Funktionierender Prototyp des Serious Games zur Vermittlung von Wissen zu Software-Engineering-Arbeitsmodellen.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

win32cryptcon.py 71KB

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