This repository has been archived by the owner on Jan 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
crypt32.go
1867 lines (1632 loc) · 79.4 KB
/
crypt32.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This file was automatically generated by https://github.com/kbinani/win/blob/generator/internal/cmd/gen/gen.go
// go run internal/cmd/gen/gen.go
// +build windows
package win
import (
"unsafe"
)
var (
// Library
libcrypt32 uintptr
// Functions
certAddCRLContextToStore uintptr
certAddCRLLinkToStore uintptr
certAddCTLContextToStore uintptr
certAddCTLLinkToStore uintptr
certAddCertificateContextToStore uintptr
certAddCertificateLinkToStore uintptr
certAddEncodedCRLToStore uintptr
certAddEncodedCTLToStore uintptr
certAddEncodedCertificateToStore uintptr
certAddEncodedCertificateToSystemStore uintptr
certAddEnhancedKeyUsageIdentifier uintptr
certAddSerializedElementToStore uintptr
certAddStoreToCollection uintptr
certAlgIdToOID uintptr
certCloseStore uintptr
certCompareCertificate uintptr
certCompareCertificateName uintptr
certCompareIntegerBlob uintptr
certControlStore uintptr
certCreateCRLContext uintptr
certCreateCTLContext uintptr
certCreateCTLEntryFromCertificateContextProperties uintptr
certCreateCertificateContext uintptr
certDeleteCRLFromStore uintptr
certDeleteCTLFromStore uintptr
certDeleteCertificateFromStore uintptr
certDuplicateCRLContext uintptr
certDuplicateCTLContext uintptr
certDuplicateCertificateContext uintptr
certDuplicateStore uintptr
certEnumCRLContextProperties uintptr
certEnumCRLsInStore uintptr
certEnumCTLContextProperties uintptr
certEnumCTLsInStore uintptr
certEnumCertificateContextProperties uintptr
certEnumCertificatesInStore uintptr
certEnumSubjectInSortedCTL uintptr
certFindAttribute uintptr
certFindCRLInStore uintptr
certFindCTLInStore uintptr
certFindCertificateInCRL uintptr
certFindCertificateInStore uintptr
certFindExtension uintptr
certFindSubjectInCTL uintptr
certFindSubjectInSortedCTL uintptr
certFreeCRLContext uintptr
certFreeCTLContext uintptr
certFreeCertificateContext uintptr
certGetCRLContextProperty uintptr
certGetCRLFromStore uintptr
certGetCTLContextProperty uintptr
certGetCertificateContextProperty uintptr
certGetIntendedKeyUsage uintptr
certGetIssuerCertificateFromStore uintptr
certGetNameString uintptr
certGetStoreProperty uintptr
certGetSubjectCertificateFromStore uintptr
certGetValidUsages uintptr
certIsValidCRLForCertificate uintptr
certNameToStr uintptr
certOIDToAlgId uintptr
certRDNValueToStr uintptr
certRemoveEnhancedKeyUsageIdentifier uintptr
certRemoveStoreFromCollection uintptr
certSaveStore uintptr
certSerializeCRLStoreElement uintptr
certSerializeCTLStoreElement uintptr
certSerializeCertificateStoreElement uintptr
certSetCRLContextProperty uintptr
certSetCTLContextProperty uintptr
certSetCertificateContextPropertiesFromCTLEntry uintptr
certSetCertificateContextProperty uintptr
certSetStoreProperty uintptr
certStrToName uintptr
certUnregisterPhysicalStore uintptr
certUnregisterSystemStore uintptr
certVerifyCRLRevocation uintptr
certVerifyCRLTimeValidity uintptr
certVerifySubjectCertificateContext uintptr
certVerifyTimeValidity uintptr
certVerifyValidityNesting uintptr
cryptBinaryToString uintptr
cryptDecodeObject uintptr
cryptEncodeObject uintptr
cryptExportPKCS8 uintptr
cryptFindCertificateKeyProvInfo uintptr
cryptFindLocalizedName uintptr
cryptFormatObject uintptr
cryptGetKeyIdentifierProperty uintptr
cryptGetMessageSignerCount uintptr
cryptGetOIDFunctionValue uintptr
cryptMemAlloc uintptr
cryptMemFree uintptr
cryptMemRealloc uintptr
cryptMsgCalculateEncodedLength uintptr
cryptMsgClose uintptr
cryptMsgControl uintptr
cryptMsgDuplicate uintptr
cryptMsgGetAndVerifySigner uintptr
cryptMsgGetParam uintptr
cryptMsgUpdate uintptr
cryptProtectMemory uintptr
cryptQueryObject uintptr
cryptRegisterDefaultOIDFunction uintptr
cryptRegisterOIDFunction uintptr
cryptSIPRemoveProvider uintptr
cryptSIPRetrieveSubjectGuid uintptr
cryptSIPRetrieveSubjectGuidForCatalogFile uintptr
cryptSetKeyIdentifierProperty uintptr
cryptSetOIDFunctionValue uintptr
cryptStringToBinary uintptr
cryptUnprotectMemory uintptr
cryptUnregisterDefaultOIDFunction uintptr
cryptUnregisterOIDFunction uintptr
pFXExportCertStore uintptr
pFXExportCertStoreEx uintptr
pFXImportCertStore uintptr
pFXIsPFXBlob uintptr
pFXVerifyPassword uintptr
i_CertUpdateStore uintptr
i_CryptAllocTls uintptr
i_CryptDetachTls uintptr
i_CryptFindLruEntry uintptr
i_CryptFindLruEntryData uintptr
i_CryptFreeTls uintptr
i_CryptGetDefaultCryptProv uintptr
i_CryptGetOssGlobal uintptr
i_CryptGetTls uintptr
i_CryptInstallOssGlobal uintptr
i_CryptReadTrustedPublisherDWORDValueFromRegistry uintptr
i_CryptSetTls uintptr
)
func init() {
// Library
libcrypt32 = doLoadLibrary("crypt32.dll")
// Functions
certAddCRLContextToStore = doGetProcAddress(libcrypt32, "CertAddCRLContextToStore")
certAddCRLLinkToStore = doGetProcAddress(libcrypt32, "CertAddCRLLinkToStore")
certAddCTLContextToStore = doGetProcAddress(libcrypt32, "CertAddCTLContextToStore")
certAddCTLLinkToStore = doGetProcAddress(libcrypt32, "CertAddCTLLinkToStore")
certAddCertificateContextToStore = doGetProcAddress(libcrypt32, "CertAddCertificateContextToStore")
certAddCertificateLinkToStore = doGetProcAddress(libcrypt32, "CertAddCertificateLinkToStore")
certAddEncodedCRLToStore = doGetProcAddress(libcrypt32, "CertAddEncodedCRLToStore")
certAddEncodedCTLToStore = doGetProcAddress(libcrypt32, "CertAddEncodedCTLToStore")
certAddEncodedCertificateToStore = doGetProcAddress(libcrypt32, "CertAddEncodedCertificateToStore")
certAddEncodedCertificateToSystemStore = doGetProcAddress(libcrypt32, "CertAddEncodedCertificateToSystemStoreW")
certAddEnhancedKeyUsageIdentifier = doGetProcAddress(libcrypt32, "CertAddEnhancedKeyUsageIdentifier")
certAddSerializedElementToStore = doGetProcAddress(libcrypt32, "CertAddSerializedElementToStore")
certAddStoreToCollection = doGetProcAddress(libcrypt32, "CertAddStoreToCollection")
certAlgIdToOID = doGetProcAddress(libcrypt32, "CertAlgIdToOID")
certCloseStore = doGetProcAddress(libcrypt32, "CertCloseStore")
certCompareCertificate = doGetProcAddress(libcrypt32, "CertCompareCertificate")
certCompareCertificateName = doGetProcAddress(libcrypt32, "CertCompareCertificateName")
certCompareIntegerBlob = doGetProcAddress(libcrypt32, "CertCompareIntegerBlob")
certControlStore = doGetProcAddress(libcrypt32, "CertControlStore")
certCreateCRLContext = doGetProcAddress(libcrypt32, "CertCreateCRLContext")
certCreateCTLContext = doGetProcAddress(libcrypt32, "CertCreateCTLContext")
certCreateCTLEntryFromCertificateContextProperties = doGetProcAddress(libcrypt32, "CertCreateCTLEntryFromCertificateContextProperties")
certCreateCertificateContext = doGetProcAddress(libcrypt32, "CertCreateCertificateContext")
certDeleteCRLFromStore = doGetProcAddress(libcrypt32, "CertDeleteCRLFromStore")
certDeleteCTLFromStore = doGetProcAddress(libcrypt32, "CertDeleteCTLFromStore")
certDeleteCertificateFromStore = doGetProcAddress(libcrypt32, "CertDeleteCertificateFromStore")
certDuplicateCRLContext = doGetProcAddress(libcrypt32, "CertDuplicateCRLContext")
certDuplicateCTLContext = doGetProcAddress(libcrypt32, "CertDuplicateCTLContext")
certDuplicateCertificateContext = doGetProcAddress(libcrypt32, "CertDuplicateCertificateContext")
certDuplicateStore = doGetProcAddress(libcrypt32, "CertDuplicateStore")
certEnumCRLContextProperties = doGetProcAddress(libcrypt32, "CertEnumCRLContextProperties")
certEnumCRLsInStore = doGetProcAddress(libcrypt32, "CertEnumCRLsInStore")
certEnumCTLContextProperties = doGetProcAddress(libcrypt32, "CertEnumCTLContextProperties")
certEnumCTLsInStore = doGetProcAddress(libcrypt32, "CertEnumCTLsInStore")
certEnumCertificateContextProperties = doGetProcAddress(libcrypt32, "CertEnumCertificateContextProperties")
certEnumCertificatesInStore = doGetProcAddress(libcrypt32, "CertEnumCertificatesInStore")
certEnumSubjectInSortedCTL = doGetProcAddress(libcrypt32, "CertEnumSubjectInSortedCTL")
certFindAttribute = doGetProcAddress(libcrypt32, "CertFindAttribute")
certFindCRLInStore = doGetProcAddress(libcrypt32, "CertFindCRLInStore")
certFindCTLInStore = doGetProcAddress(libcrypt32, "CertFindCTLInStore")
certFindCertificateInCRL = doGetProcAddress(libcrypt32, "CertFindCertificateInCRL")
certFindCertificateInStore = doGetProcAddress(libcrypt32, "CertFindCertificateInStore")
certFindExtension = doGetProcAddress(libcrypt32, "CertFindExtension")
certFindSubjectInCTL = doGetProcAddress(libcrypt32, "CertFindSubjectInCTL")
certFindSubjectInSortedCTL = doGetProcAddress(libcrypt32, "CertFindSubjectInSortedCTL")
certFreeCRLContext = doGetProcAddress(libcrypt32, "CertFreeCRLContext")
certFreeCTLContext = doGetProcAddress(libcrypt32, "CertFreeCTLContext")
certFreeCertificateContext = doGetProcAddress(libcrypt32, "CertFreeCertificateContext")
certGetCRLContextProperty = doGetProcAddress(libcrypt32, "CertGetCRLContextProperty")
certGetCRLFromStore = doGetProcAddress(libcrypt32, "CertGetCRLFromStore")
certGetCTLContextProperty = doGetProcAddress(libcrypt32, "CertGetCTLContextProperty")
certGetCertificateContextProperty = doGetProcAddress(libcrypt32, "CertGetCertificateContextProperty")
certGetIntendedKeyUsage = doGetProcAddress(libcrypt32, "CertGetIntendedKeyUsage")
certGetIssuerCertificateFromStore = doGetProcAddress(libcrypt32, "CertGetIssuerCertificateFromStore")
certGetNameString = doGetProcAddress(libcrypt32, "CertGetNameStringW")
certGetStoreProperty = doGetProcAddress(libcrypt32, "CertGetStoreProperty")
certGetSubjectCertificateFromStore = doGetProcAddress(libcrypt32, "CertGetSubjectCertificateFromStore")
certGetValidUsages = doGetProcAddress(libcrypt32, "CertGetValidUsages")
certIsValidCRLForCertificate = doGetProcAddress(libcrypt32, "CertIsValidCRLForCertificate")
certNameToStr = doGetProcAddress(libcrypt32, "CertNameToStrW")
certOIDToAlgId = doGetProcAddress(libcrypt32, "CertOIDToAlgId")
certRDNValueToStr = doGetProcAddress(libcrypt32, "CertRDNValueToStrW")
certRemoveEnhancedKeyUsageIdentifier = doGetProcAddress(libcrypt32, "CertRemoveEnhancedKeyUsageIdentifier")
certRemoveStoreFromCollection = doGetProcAddress(libcrypt32, "CertRemoveStoreFromCollection")
certSaveStore = doGetProcAddress(libcrypt32, "CertSaveStore")
certSerializeCRLStoreElement = doGetProcAddress(libcrypt32, "CertSerializeCRLStoreElement")
certSerializeCTLStoreElement = doGetProcAddress(libcrypt32, "CertSerializeCTLStoreElement")
certSerializeCertificateStoreElement = doGetProcAddress(libcrypt32, "CertSerializeCertificateStoreElement")
certSetCRLContextProperty = doGetProcAddress(libcrypt32, "CertSetCRLContextProperty")
certSetCTLContextProperty = doGetProcAddress(libcrypt32, "CertSetCTLContextProperty")
certSetCertificateContextPropertiesFromCTLEntry = doGetProcAddress(libcrypt32, "CertSetCertificateContextPropertiesFromCTLEntry")
certSetCertificateContextProperty = doGetProcAddress(libcrypt32, "CertSetCertificateContextProperty")
certSetStoreProperty = doGetProcAddress(libcrypt32, "CertSetStoreProperty")
certStrToName = doGetProcAddress(libcrypt32, "CertStrToNameW")
certUnregisterPhysicalStore = doGetProcAddress(libcrypt32, "CertUnregisterPhysicalStore")
certUnregisterSystemStore = doGetProcAddress(libcrypt32, "CertUnregisterSystemStore")
certVerifyCRLRevocation = doGetProcAddress(libcrypt32, "CertVerifyCRLRevocation")
certVerifyCRLTimeValidity = doGetProcAddress(libcrypt32, "CertVerifyCRLTimeValidity")
certVerifySubjectCertificateContext = doGetProcAddress(libcrypt32, "CertVerifySubjectCertificateContext")
certVerifyTimeValidity = doGetProcAddress(libcrypt32, "CertVerifyTimeValidity")
certVerifyValidityNesting = doGetProcAddress(libcrypt32, "CertVerifyValidityNesting")
cryptBinaryToString = doGetProcAddress(libcrypt32, "CryptBinaryToStringW")
cryptDecodeObject = doGetProcAddress(libcrypt32, "CryptDecodeObject")
cryptEncodeObject = doGetProcAddress(libcrypt32, "CryptEncodeObject")
cryptExportPKCS8 = doGetProcAddress(libcrypt32, "CryptExportPKCS8")
cryptFindCertificateKeyProvInfo = doGetProcAddress(libcrypt32, "CryptFindCertificateKeyProvInfo")
cryptFindLocalizedName = doGetProcAddress(libcrypt32, "CryptFindLocalizedName")
cryptFormatObject = doGetProcAddress(libcrypt32, "CryptFormatObject")
cryptGetKeyIdentifierProperty = doGetProcAddress(libcrypt32, "CryptGetKeyIdentifierProperty")
cryptGetMessageSignerCount = doGetProcAddress(libcrypt32, "CryptGetMessageSignerCount")
cryptGetOIDFunctionValue = doGetProcAddress(libcrypt32, "CryptGetOIDFunctionValue")
cryptMemAlloc = doGetProcAddress(libcrypt32, "CryptMemAlloc")
cryptMemFree = doGetProcAddress(libcrypt32, "CryptMemFree")
cryptMemRealloc = doGetProcAddress(libcrypt32, "CryptMemRealloc")
cryptMsgCalculateEncodedLength = doGetProcAddress(libcrypt32, "CryptMsgCalculateEncodedLength")
cryptMsgClose = doGetProcAddress(libcrypt32, "CryptMsgClose")
cryptMsgControl = doGetProcAddress(libcrypt32, "CryptMsgControl")
cryptMsgDuplicate = doGetProcAddress(libcrypt32, "CryptMsgDuplicate")
cryptMsgGetAndVerifySigner = doGetProcAddress(libcrypt32, "CryptMsgGetAndVerifySigner")
cryptMsgGetParam = doGetProcAddress(libcrypt32, "CryptMsgGetParam")
cryptMsgUpdate = doGetProcAddress(libcrypt32, "CryptMsgUpdate")
cryptProtectMemory = doGetProcAddress(libcrypt32, "CryptProtectMemory")
cryptQueryObject = doGetProcAddress(libcrypt32, "CryptQueryObject")
cryptRegisterDefaultOIDFunction = doGetProcAddress(libcrypt32, "CryptRegisterDefaultOIDFunction")
cryptRegisterOIDFunction = doGetProcAddress(libcrypt32, "CryptRegisterOIDFunction")
cryptSIPRemoveProvider = doGetProcAddress(libcrypt32, "CryptSIPRemoveProvider")
cryptSIPRetrieveSubjectGuid = doGetProcAddress(libcrypt32, "CryptSIPRetrieveSubjectGuid")
cryptSIPRetrieveSubjectGuidForCatalogFile = doGetProcAddress(libcrypt32, "CryptSIPRetrieveSubjectGuidForCatalogFile")
cryptSetKeyIdentifierProperty = doGetProcAddress(libcrypt32, "CryptSetKeyIdentifierProperty")
cryptSetOIDFunctionValue = doGetProcAddress(libcrypt32, "CryptSetOIDFunctionValue")
cryptStringToBinary = doGetProcAddress(libcrypt32, "CryptStringToBinaryW")
cryptUnprotectMemory = doGetProcAddress(libcrypt32, "CryptUnprotectMemory")
cryptUnregisterDefaultOIDFunction = doGetProcAddress(libcrypt32, "CryptUnregisterDefaultOIDFunction")
cryptUnregisterOIDFunction = doGetProcAddress(libcrypt32, "CryptUnregisterOIDFunction")
pFXExportCertStore = doGetProcAddress(libcrypt32, "PFXExportCertStore")
pFXExportCertStoreEx = doGetProcAddress(libcrypt32, "PFXExportCertStoreEx")
pFXImportCertStore = doGetProcAddress(libcrypt32, "PFXImportCertStore")
pFXIsPFXBlob = doGetProcAddress(libcrypt32, "PFXIsPFXBlob")
pFXVerifyPassword = doGetProcAddress(libcrypt32, "PFXVerifyPassword")
i_CertUpdateStore = doGetProcAddress(libcrypt32, "I_CertUpdateStore")
i_CryptAllocTls = doGetProcAddress(libcrypt32, "I_CryptAllocTls")
i_CryptDetachTls = doGetProcAddress(libcrypt32, "I_CryptDetachTls")
i_CryptFindLruEntry = doGetProcAddress(libcrypt32, "I_CryptFindLruEntry")
i_CryptFindLruEntryData = doGetProcAddress(libcrypt32, "I_CryptFindLruEntryData")
i_CryptFreeTls = doGetProcAddress(libcrypt32, "I_CryptFreeTls")
i_CryptGetDefaultCryptProv = doGetProcAddress(libcrypt32, "I_CryptGetDefaultCryptProv")
i_CryptGetOssGlobal = doGetProcAddress(libcrypt32, "I_CryptGetOssGlobal")
i_CryptGetTls = doGetProcAddress(libcrypt32, "I_CryptGetTls")
i_CryptInstallOssGlobal = doGetProcAddress(libcrypt32, "I_CryptInstallOssGlobal")
i_CryptReadTrustedPublisherDWORDValueFromRegistry = doGetProcAddress(libcrypt32, "I_CryptReadTrustedPublisherDWORDValueFromRegistry")
i_CryptSetTls = doGetProcAddress(libcrypt32, "I_CryptSetTls")
}
func CertAddCRLContextToStore(hCertStore HCERTSTORE, pCrlContext PCCRL_CONTEXT, dwAddDisposition DWORD, ppStoreContext *PCCRL_CONTEXT) bool {
ret1 := syscall6(certAddCRLContextToStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pCrlContext)),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppStoreContext)),
0,
0)
return ret1 != 0
}
func CertAddCRLLinkToStore(hCertStore HCERTSTORE, pCrlContext PCCRL_CONTEXT, dwAddDisposition DWORD, ppStoreContext *PCCRL_CONTEXT) bool {
ret1 := syscall6(certAddCRLLinkToStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pCrlContext)),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppStoreContext)),
0,
0)
return ret1 != 0
}
func CertAddCTLContextToStore(hCertStore HCERTSTORE, pCtlContext /*const*/ PCCTL_CONTEXT, dwAddDisposition DWORD, ppStoreContext *PCCTL_CONTEXT) bool {
ret1 := syscall6(certAddCTLContextToStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppStoreContext)),
0,
0)
return ret1 != 0
}
func CertAddCTLLinkToStore(hCertStore HCERTSTORE, pCtlContext /*const*/ PCCTL_CONTEXT, dwAddDisposition DWORD, ppStoreContext *PCCTL_CONTEXT) bool {
ret1 := syscall6(certAddCTLLinkToStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppStoreContext)),
0,
0)
return ret1 != 0
}
func CertAddCertificateContextToStore(hCertStore HCERTSTORE, pCertContext /*const*/ PCCERT_CONTEXT, dwAddDisposition DWORD, ppStoreContext *PCCERT_CONTEXT) bool {
ret1 := syscall6(certAddCertificateContextToStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pCertContext)),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppStoreContext)),
0,
0)
return ret1 != 0
}
func CertAddCertificateLinkToStore(hCertStore HCERTSTORE, pCertContext /*const*/ PCCERT_CONTEXT, dwAddDisposition DWORD, ppStoreContext *PCCERT_CONTEXT) bool {
ret1 := syscall6(certAddCertificateLinkToStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pCertContext)),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppStoreContext)),
0,
0)
return ret1 != 0
}
func CertAddEncodedCRLToStore(hCertStore HCERTSTORE, dwCertEncodingType DWORD, pbCrlEncoded /*const*/ *byte, cbCrlEncoded DWORD, dwAddDisposition DWORD, ppCrlContext *PCCRL_CONTEXT) bool {
ret1 := syscall6(certAddEncodedCRLToStore, 6,
uintptr(hCertStore),
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pbCrlEncoded)),
uintptr(cbCrlEncoded),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppCrlContext)))
return ret1 != 0
}
func CertAddEncodedCTLToStore(hCertStore HCERTSTORE, dwMsgAndCertEncodingType DWORD, pbCtlEncoded /*const*/ *byte, cbCtlEncoded DWORD, dwAddDisposition DWORD, ppCtlContext *PCCTL_CONTEXT) bool {
ret1 := syscall6(certAddEncodedCTLToStore, 6,
uintptr(hCertStore),
uintptr(dwMsgAndCertEncodingType),
uintptr(unsafe.Pointer(pbCtlEncoded)),
uintptr(cbCtlEncoded),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppCtlContext)))
return ret1 != 0
}
func CertAddEncodedCertificateToStore(hCertStore HCERTSTORE, dwCertEncodingType DWORD, pbCertEncoded /*const*/ *byte, cbCertEncoded DWORD, dwAddDisposition DWORD, ppCertContext *PCCERT_CONTEXT) bool {
ret1 := syscall6(certAddEncodedCertificateToStore, 6,
uintptr(hCertStore),
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pbCertEncoded)),
uintptr(cbCertEncoded),
uintptr(dwAddDisposition),
uintptr(unsafe.Pointer(ppCertContext)))
return ret1 != 0
}
func CertAddEncodedCertificateToSystemStore(szCertStoreName string, pbCertEncoded /*const*/ *byte, cbCertEncoded DWORD) bool {
szCertStoreNameStr := unicode16FromString(szCertStoreName)
ret1 := syscall3(certAddEncodedCertificateToSystemStore, 3,
uintptr(unsafe.Pointer(&szCertStoreNameStr[0])),
uintptr(unsafe.Pointer(pbCertEncoded)),
uintptr(cbCertEncoded))
return ret1 != 0
}
func CertAddEnhancedKeyUsageIdentifier(pCertContext /*const*/ PCCERT_CONTEXT, pszUsageIdentifier /*const*/ LPCSTR) bool {
ret1 := syscall3(certAddEnhancedKeyUsageIdentifier, 2,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(unsafe.Pointer(pszUsageIdentifier)),
0)
return ret1 != 0
}
func CertAddSerializedElementToStore(hCertStore HCERTSTORE, pbElement /*const*/ *byte, cbElement DWORD, dwAddDisposition DWORD, dwFlags DWORD, dwContextTypeFlags DWORD, pdwContextType *uint32, ppvContext /*const*/ uintptr) bool {
ret1 := syscall9(certAddSerializedElementToStore, 8,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pbElement)),
uintptr(cbElement),
uintptr(dwAddDisposition),
uintptr(dwFlags),
uintptr(dwContextTypeFlags),
uintptr(unsafe.Pointer(pdwContextType)),
ppvContext,
0)
return ret1 != 0
}
func CertAddStoreToCollection(hCollectionStore HCERTSTORE, hSiblingStore HCERTSTORE, dwUpdateFlags DWORD, dwPriority DWORD) bool {
ret1 := syscall6(certAddStoreToCollection, 4,
uintptr(hCollectionStore),
uintptr(hSiblingStore),
uintptr(dwUpdateFlags),
uintptr(dwPriority),
0,
0)
return ret1 != 0
}
func CertAlgIdToOID(dwAlgId DWORD) LPCSTR {
ret1 := syscall3(certAlgIdToOID, 1,
uintptr(dwAlgId),
0,
0)
return (LPCSTR)(unsafe.Pointer(ret1))
}
func CertCloseStore(hCertStore HCERTSTORE, dwFlags DWORD) bool {
ret1 := syscall3(certCloseStore, 2,
uintptr(hCertStore),
uintptr(dwFlags),
0)
return ret1 != 0
}
func CertCompareCertificate(dwCertEncodingType DWORD, pCertId1 PCERT_INFO, pCertId2 PCERT_INFO) bool {
ret1 := syscall3(certCompareCertificate, 3,
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pCertId1)),
uintptr(unsafe.Pointer(pCertId2)))
return ret1 != 0
}
func CertCompareCertificateName(dwCertEncodingType DWORD, pCertName1 PCERT_NAME_BLOB, pCertName2 PCERT_NAME_BLOB) bool {
ret1 := syscall3(certCompareCertificateName, 3,
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pCertName1)),
uintptr(unsafe.Pointer(pCertName2)))
return ret1 != 0
}
func CertCompareIntegerBlob(pInt1 PCRYPT_INTEGER_BLOB, pInt2 PCRYPT_INTEGER_BLOB) bool {
ret1 := syscall3(certCompareIntegerBlob, 2,
uintptr(unsafe.Pointer(pInt1)),
uintptr(unsafe.Pointer(pInt2)),
0)
return ret1 != 0
}
// TODO: Unknown type(s): PCERT_PUBLIC_KEY_INFO
// func CertComparePublicKeyInfo(dwCertEncodingType DWORD, pPublicKey1 PCERT_PUBLIC_KEY_INFO, pPublicKey2 PCERT_PUBLIC_KEY_INFO) bool
func CertControlStore(hCertStore HCERTSTORE, dwFlags DWORD, dwCtrlType DWORD, pvCtrlPara /*const*/ uintptr) bool {
ret1 := syscall6(certControlStore, 4,
uintptr(hCertStore),
uintptr(dwFlags),
uintptr(dwCtrlType),
pvCtrlPara,
0,
0)
return ret1 != 0
}
func CertCreateCRLContext(dwCertEncodingType DWORD, pbCrlEncoded /*const*/ *byte, cbCrlEncoded DWORD) PCCRL_CONTEXT {
ret1 := syscall3(certCreateCRLContext, 3,
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pbCrlEncoded)),
uintptr(cbCrlEncoded))
return (PCCRL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertCreateCTLContext(dwMsgAndCertEncodingType DWORD, pbCtlEncoded /*const*/ *byte, cbCtlEncoded DWORD) PCCTL_CONTEXT {
ret1 := syscall3(certCreateCTLContext, 3,
uintptr(dwMsgAndCertEncodingType),
uintptr(unsafe.Pointer(pbCtlEncoded)),
uintptr(cbCtlEncoded))
return (PCCTL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertCreateCTLEntryFromCertificateContextProperties(pCertContext /*const*/ PCCERT_CONTEXT, cOptAttr DWORD, rgOptAttr PCRYPT_ATTRIBUTE, dwFlags DWORD, pvReserved uintptr, pCtlEntry PCTL_ENTRY, pcbCtlEntry *uint32) bool {
ret1 := syscall9(certCreateCTLEntryFromCertificateContextProperties, 7,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(cOptAttr),
uintptr(unsafe.Pointer(rgOptAttr)),
uintptr(dwFlags),
pvReserved,
uintptr(unsafe.Pointer(pCtlEntry)),
uintptr(unsafe.Pointer(pcbCtlEntry)),
0,
0)
return ret1 != 0
}
// TODO: Unknown type(s): HCERTCHAINENGINE *, PCERT_CHAIN_ENGINE_CONFIG
// func CertCreateCertificateChainEngine(pConfig PCERT_CHAIN_ENGINE_CONFIG, phChainEngine HCERTCHAINENGINE *) bool
func CertCreateCertificateContext(dwCertEncodingType DWORD, pbCertEncoded /*const*/ *byte, cbCertEncoded DWORD) PCCERT_CONTEXT {
ret1 := syscall3(certCreateCertificateContext, 3,
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pbCertEncoded)),
uintptr(cbCertEncoded))
return (PCCERT_CONTEXT)(unsafe.Pointer(ret1))
}
// TODO: Unknown type(s): HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, PCERT_EXTENSIONS, PCRYPT_ALGORITHM_IDENTIFIER, PCRYPT_KEY_PROV_INFO, PSYSTEMTIME
// func CertCreateSelfSignCertificate(hCryptProvOrNCryptKey HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, pSubjectIssuerBlob PCERT_NAME_BLOB, dwFlags DWORD, pKeyProvInfo PCRYPT_KEY_PROV_INFO, pSignatureAlgorithm PCRYPT_ALGORITHM_IDENTIFIER, pStartTime PSYSTEMTIME, pEndTime PSYSTEMTIME, pExtensions PCERT_EXTENSIONS) PCCERT_CONTEXT
func CertDeleteCRLFromStore(pCrlContext PCCRL_CONTEXT) bool {
ret1 := syscall3(certDeleteCRLFromStore, 1,
uintptr(unsafe.Pointer(pCrlContext)),
0,
0)
return ret1 != 0
}
func CertDeleteCTLFromStore(pCtlContext /*const*/ PCCTL_CONTEXT) bool {
ret1 := syscall3(certDeleteCTLFromStore, 1,
uintptr(unsafe.Pointer(pCtlContext)),
0,
0)
return ret1 != 0
}
func CertDeleteCertificateFromStore(pCertContext /*const*/ PCCERT_CONTEXT) bool {
ret1 := syscall3(certDeleteCertificateFromStore, 1,
uintptr(unsafe.Pointer(pCertContext)),
0,
0)
return ret1 != 0
}
func CertDuplicateCRLContext(pCrlContext PCCRL_CONTEXT) PCCRL_CONTEXT {
ret1 := syscall3(certDuplicateCRLContext, 1,
uintptr(unsafe.Pointer(pCrlContext)),
0,
0)
return (PCCRL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertDuplicateCTLContext(pCtlContext /*const*/ PCCTL_CONTEXT) PCCTL_CONTEXT {
ret1 := syscall3(certDuplicateCTLContext, 1,
uintptr(unsafe.Pointer(pCtlContext)),
0,
0)
return (PCCTL_CONTEXT)(unsafe.Pointer(ret1))
}
// TODO: Unknown type(s): PCCERT_CHAIN_CONTEXT
// func CertDuplicateCertificateChain(pChainContext PCCERT_CHAIN_CONTEXT) PCCERT_CHAIN_CONTEXT
func CertDuplicateCertificateContext(pCertContext /*const*/ PCCERT_CONTEXT) PCCERT_CONTEXT {
ret1 := syscall3(certDuplicateCertificateContext, 1,
uintptr(unsafe.Pointer(pCertContext)),
0,
0)
return (PCCERT_CONTEXT)(unsafe.Pointer(ret1))
}
func CertDuplicateStore(hCertStore HCERTSTORE) HCERTSTORE {
ret1 := syscall3(certDuplicateStore, 1,
uintptr(hCertStore),
0,
0)
return HCERTSTORE(ret1)
}
func CertEnumCRLContextProperties(pCrlContext PCCRL_CONTEXT, dwPropId DWORD) DWORD {
ret1 := syscall3(certEnumCRLContextProperties, 2,
uintptr(unsafe.Pointer(pCrlContext)),
uintptr(dwPropId),
0)
return DWORD(ret1)
}
func CertEnumCRLsInStore(hCertStore HCERTSTORE, pPrevCrlContext PCCRL_CONTEXT) PCCRL_CONTEXT {
ret1 := syscall3(certEnumCRLsInStore, 2,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pPrevCrlContext)),
0)
return (PCCRL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertEnumCTLContextProperties(pCtlContext /*const*/ PCCTL_CONTEXT, dwPropId DWORD) DWORD {
ret1 := syscall3(certEnumCTLContextProperties, 2,
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwPropId),
0)
return DWORD(ret1)
}
func CertEnumCTLsInStore(hCertStore HCERTSTORE, pPrevCtlContext /*const*/ PCCTL_CONTEXT) PCCTL_CONTEXT {
ret1 := syscall3(certEnumCTLsInStore, 2,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pPrevCtlContext)),
0)
return (PCCTL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertEnumCertificateContextProperties(pCertContext /*const*/ PCCERT_CONTEXT, dwPropId DWORD) DWORD {
ret1 := syscall3(certEnumCertificateContextProperties, 2,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(dwPropId),
0)
return DWORD(ret1)
}
func CertEnumCertificatesInStore(hCertStore HCERTSTORE, pPrevCertContext /*const*/ PCCERT_CONTEXT) PCCERT_CONTEXT {
ret1 := syscall3(certEnumCertificatesInStore, 2,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pPrevCertContext)),
0)
return (PCCERT_CONTEXT)(unsafe.Pointer(ret1))
}
// TODO: Unknown type(s): PFN_CERT_ENUM_PHYSICAL_STORE
// func CertEnumPhysicalStore(pvSystemStore /*const*/ uintptr, dwFlags DWORD, pvArg uintptr, pfnEnum PFN_CERT_ENUM_PHYSICAL_STORE) bool
func CertEnumSubjectInSortedCTL(pCtlContext /*const*/ PCCTL_CONTEXT, ppvNextSubject uintptr, pSubjectIdentifier PCRYPT_DER_BLOB, pEncodedAttributes PCRYPT_DER_BLOB) bool {
ret1 := syscall6(certEnumSubjectInSortedCTL, 4,
uintptr(unsafe.Pointer(pCtlContext)),
ppvNextSubject,
uintptr(unsafe.Pointer(pSubjectIdentifier)),
uintptr(unsafe.Pointer(pEncodedAttributes)),
0,
0)
return ret1 != 0
}
// TODO: Unknown type(s): PFN_CERT_ENUM_SYSTEM_STORE
// func CertEnumSystemStore(dwFlags DWORD, pvSystemStoreLocationPara uintptr, pvArg uintptr, pfnEnum PFN_CERT_ENUM_SYSTEM_STORE) bool
// TODO: Unknown type(s): PFN_CERT_ENUM_SYSTEM_STORE_LOCATION
// func CertEnumSystemStoreLocation(dwFlags DWORD, pvArg uintptr, pfnEnum PFN_CERT_ENUM_SYSTEM_STORE_LOCATION) bool
func CertFindAttribute(pszObjId /*const*/ LPCSTR, cAttr DWORD, rgAttr *CRYPT_ATTRIBUTE) PCRYPT_ATTRIBUTE {
ret1 := syscall3(certFindAttribute, 3,
uintptr(unsafe.Pointer(pszObjId)),
uintptr(cAttr),
uintptr(unsafe.Pointer(rgAttr)))
return (PCRYPT_ATTRIBUTE)(unsafe.Pointer(ret1))
}
func CertFindCRLInStore(hCertStore HCERTSTORE, dwCertEncodingType DWORD, dwFindFlags DWORD, dwFindType DWORD, pvFindPara /*const*/ uintptr, pPrevCrlContext PCCRL_CONTEXT) PCCRL_CONTEXT {
ret1 := syscall6(certFindCRLInStore, 6,
uintptr(hCertStore),
uintptr(dwCertEncodingType),
uintptr(dwFindFlags),
uintptr(dwFindType),
pvFindPara,
uintptr(unsafe.Pointer(pPrevCrlContext)))
return (PCCRL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertFindCTLInStore(hCertStore HCERTSTORE, dwMsgAndCertEncodingType DWORD, dwFindFlags DWORD, dwFindType DWORD, pvFindPara /*const*/ uintptr, pPrevCtlContext /*const*/ PCCTL_CONTEXT) PCCTL_CONTEXT {
ret1 := syscall6(certFindCTLInStore, 6,
uintptr(hCertStore),
uintptr(dwMsgAndCertEncodingType),
uintptr(dwFindFlags),
uintptr(dwFindType),
pvFindPara,
uintptr(unsafe.Pointer(pPrevCtlContext)))
return (PCCTL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertFindCertificateInCRL(pCert /*const*/ PCCERT_CONTEXT, pCrlContext PCCRL_CONTEXT, dwFlags DWORD, pvReserved uintptr, ppCrlEntry *PCRL_ENTRY) bool {
ret1 := syscall6(certFindCertificateInCRL, 5,
uintptr(unsafe.Pointer(pCert)),
uintptr(unsafe.Pointer(pCrlContext)),
uintptr(dwFlags),
pvReserved,
uintptr(unsafe.Pointer(ppCrlEntry)),
0)
return ret1 != 0
}
func CertFindCertificateInStore(hCertStore HCERTSTORE, dwCertEncodingType DWORD, dwFindFlags DWORD, dwFindType DWORD, pvFindPara /*const*/ uintptr, pPrevCertContext /*const*/ PCCERT_CONTEXT) PCCERT_CONTEXT {
ret1 := syscall6(certFindCertificateInStore, 6,
uintptr(hCertStore),
uintptr(dwCertEncodingType),
uintptr(dwFindFlags),
uintptr(dwFindType),
pvFindPara,
uintptr(unsafe.Pointer(pPrevCertContext)))
return (PCCERT_CONTEXT)(unsafe.Pointer(ret1))
}
// TODO: Unknown type(s): PCCERT_CHAIN_CONTEXT
// func CertFindChainInStore(hCertStore HCERTSTORE, dwCertEncodingType DWORD, dwFindFlags DWORD, dwFindType DWORD, pvFindPara /*const*/ uintptr, pPrevChainContext PCCERT_CHAIN_CONTEXT) PCCERT_CHAIN_CONTEXT
func CertFindExtension(pszObjId /*const*/ LPCSTR, cExtensions DWORD, rgExtensions *CERT_EXTENSION) PCERT_EXTENSION {
ret1 := syscall3(certFindExtension, 3,
uintptr(unsafe.Pointer(pszObjId)),
uintptr(cExtensions),
uintptr(unsafe.Pointer(rgExtensions)))
return (PCERT_EXTENSION)(unsafe.Pointer(ret1))
}
// TODO: Unknown type(s): PCERT_NAME_INFO, PCERT_RDN_ATTR
// func CertFindRDNAttr(pszObjId /*const*/ LPCSTR, pName PCERT_NAME_INFO) PCERT_RDN_ATTR
func CertFindSubjectInCTL(dwEncodingType DWORD, dwSubjectType DWORD, pvSubject uintptr, pCtlContext /*const*/ PCCTL_CONTEXT, dwFlags DWORD) PCTL_ENTRY {
ret1 := syscall6(certFindSubjectInCTL, 5,
uintptr(dwEncodingType),
uintptr(dwSubjectType),
pvSubject,
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwFlags),
0)
return (PCTL_ENTRY)(unsafe.Pointer(ret1))
}
func CertFindSubjectInSortedCTL(pSubjectIdentifier PCRYPT_DATA_BLOB, pCtlContext /*const*/ PCCTL_CONTEXT, dwFlags DWORD, pvReserved uintptr, pEncodedAttributes PCRYPT_DER_BLOB) bool {
ret1 := syscall6(certFindSubjectInSortedCTL, 5,
uintptr(unsafe.Pointer(pSubjectIdentifier)),
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwFlags),
pvReserved,
uintptr(unsafe.Pointer(pEncodedAttributes)),
0)
return ret1 != 0
}
func CertFreeCRLContext(pCrlContext PCCRL_CONTEXT) bool {
ret1 := syscall3(certFreeCRLContext, 1,
uintptr(unsafe.Pointer(pCrlContext)),
0,
0)
return ret1 != 0
}
func CertFreeCTLContext(pCtlContext /*const*/ PCCTL_CONTEXT) bool {
ret1 := syscall3(certFreeCTLContext, 1,
uintptr(unsafe.Pointer(pCtlContext)),
0,
0)
return ret1 != 0
}
// TODO: Unknown type(s): PCCERT_CHAIN_CONTEXT
// func CertFreeCertificateChain(pChainContext PCCERT_CHAIN_CONTEXT)
// TODO: Unknown type(s): HCERTCHAINENGINE
// func CertFreeCertificateChainEngine(hChainEngine HCERTCHAINENGINE)
func CertFreeCertificateContext(pCertContext /*const*/ PCCERT_CONTEXT) bool {
ret1 := syscall3(certFreeCertificateContext, 1,
uintptr(unsafe.Pointer(pCertContext)),
0,
0)
return ret1 != 0
}
func CertGetCRLContextProperty(pCrlContext PCCRL_CONTEXT, dwPropId DWORD, pvData uintptr, pcbData *uint32) bool {
ret1 := syscall6(certGetCRLContextProperty, 4,
uintptr(unsafe.Pointer(pCrlContext)),
uintptr(dwPropId),
pvData,
uintptr(unsafe.Pointer(pcbData)),
0,
0)
return ret1 != 0
}
func CertGetCRLFromStore(hCertStore HCERTSTORE, pIssuerContext /*const*/ PCCERT_CONTEXT, pPrevCrlContext PCCRL_CONTEXT, pdwFlags *uint32) PCCRL_CONTEXT {
ret1 := syscall6(certGetCRLFromStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pIssuerContext)),
uintptr(unsafe.Pointer(pPrevCrlContext)),
uintptr(unsafe.Pointer(pdwFlags)),
0,
0)
return (PCCRL_CONTEXT)(unsafe.Pointer(ret1))
}
func CertGetCTLContextProperty(pCtlContext /*const*/ PCCTL_CONTEXT, dwPropId DWORD, pvData uintptr, pcbData *uint32) bool {
ret1 := syscall6(certGetCTLContextProperty, 4,
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwPropId),
pvData,
uintptr(unsafe.Pointer(pcbData)),
0,
0)
return ret1 != 0
}
// TODO: Unknown type(s): HCERTCHAINENGINE, PCCERT_CHAIN_CONTEXT *, PCERT_CHAIN_PARA
// func CertGetCertificateChain(hChainEngine HCERTCHAINENGINE, pCertContext /*const*/ PCCERT_CONTEXT, pTime *FILETIME, hAdditionalStore HCERTSTORE, pChainPara PCERT_CHAIN_PARA, dwFlags DWORD, pvReserved LPVOID, ppChainContext PCCERT_CHAIN_CONTEXT *) bool
func CertGetCertificateContextProperty(pCertContext /*const*/ PCCERT_CONTEXT, dwPropId DWORD, pvData uintptr, pcbData *uint32) bool {
ret1 := syscall6(certGetCertificateContextProperty, 4,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(dwPropId),
pvData,
uintptr(unsafe.Pointer(pcbData)),
0,
0)
return ret1 != 0
}
// TODO: Unknown type(s): PCERT_ENHKEY_USAGE
// func CertGetEnhancedKeyUsage(pCertContext /*const*/ PCCERT_CONTEXT, dwFlags DWORD, pUsage PCERT_ENHKEY_USAGE, pcbUsage *uint32) bool
func CertGetIntendedKeyUsage(dwCertEncodingType DWORD, pCertInfo PCERT_INFO, pbKeyUsage *byte, cbKeyUsage DWORD) bool {
ret1 := syscall6(certGetIntendedKeyUsage, 4,
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pCertInfo)),
uintptr(unsafe.Pointer(pbKeyUsage)),
uintptr(cbKeyUsage),
0,
0)
return ret1 != 0
}
func CertGetIssuerCertificateFromStore(hCertStore HCERTSTORE, pSubjectContext /*const*/ PCCERT_CONTEXT, pPrevIssuerContext /*const*/ PCCERT_CONTEXT, pdwFlags *uint32) PCCERT_CONTEXT {
ret1 := syscall6(certGetIssuerCertificateFromStore, 4,
uintptr(hCertStore),
uintptr(unsafe.Pointer(pSubjectContext)),
uintptr(unsafe.Pointer(pPrevIssuerContext)),
uintptr(unsafe.Pointer(pdwFlags)),
0,
0)
return (PCCERT_CONTEXT)(unsafe.Pointer(ret1))
}
func CertGetNameString(pCertContext /*const*/ PCCERT_CONTEXT, dwType DWORD, dwFlags DWORD, pvTypePara uintptr, pszNameString LPWSTR, cchNameString DWORD) DWORD {
ret1 := syscall6(certGetNameString, 6,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(dwType),
uintptr(dwFlags),
pvTypePara,
uintptr(unsafe.Pointer(pszNameString)),
uintptr(cchNameString))
return DWORD(ret1)
}
// TODO: Unknown type(s): PCERT_PUBLIC_KEY_INFO
// func CertGetPublicKeyLength(dwCertEncodingType DWORD, pPublicKey PCERT_PUBLIC_KEY_INFO) DWORD
func CertGetStoreProperty(hCertStore HCERTSTORE, dwPropId DWORD, pvData uintptr, pcbData *uint32) bool {
ret1 := syscall6(certGetStoreProperty, 4,
uintptr(hCertStore),
uintptr(dwPropId),
pvData,
uintptr(unsafe.Pointer(pcbData)),
0,
0)
return ret1 != 0
}
func CertGetSubjectCertificateFromStore(hCertStore HCERTSTORE, dwCertEncodingType DWORD, pCertId PCERT_INFO) PCCERT_CONTEXT {
ret1 := syscall3(certGetSubjectCertificateFromStore, 3,
uintptr(hCertStore),
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pCertId)))
return (PCCERT_CONTEXT)(unsafe.Pointer(ret1))
}
func CertGetValidUsages(cCerts DWORD, rghCerts *PCCERT_CONTEXT, cNumOIDs *int, rghOIDs *LPSTR, pcbOIDs *uint32) bool {
ret1 := syscall6(certGetValidUsages, 5,
uintptr(cCerts),
uintptr(unsafe.Pointer(rghCerts)),
uintptr(unsafe.Pointer(cNumOIDs)),
uintptr(unsafe.Pointer(rghOIDs)),
uintptr(unsafe.Pointer(pcbOIDs)),
0)
return ret1 != 0
}
// TODO: Unknown type(s): PCERT_RDN
// func CertIsRDNAttrsInCertificateName(dwCertEncodingType DWORD, dwFlags DWORD, pCertName PCERT_NAME_BLOB, pRDN PCERT_RDN) bool
func CertIsValidCRLForCertificate(pCert /*const*/ PCCERT_CONTEXT, pCrl PCCRL_CONTEXT, dwFlags DWORD, pvReserved uintptr) bool {
ret1 := syscall6(certIsValidCRLForCertificate, 4,
uintptr(unsafe.Pointer(pCert)),
uintptr(unsafe.Pointer(pCrl)),
uintptr(dwFlags),
pvReserved,
0,
0)
return ret1 != 0
}
func CertNameToStr(dwCertEncodingType DWORD, pName PCERT_NAME_BLOB, dwStrType DWORD, psz LPWSTR, csz DWORD) DWORD {
ret1 := syscall6(certNameToStr, 5,
uintptr(dwCertEncodingType),
uintptr(unsafe.Pointer(pName)),
uintptr(dwStrType),
uintptr(unsafe.Pointer(psz)),
uintptr(csz),
0)
return DWORD(ret1)
}
func CertOIDToAlgId(pszObjId /*const*/ LPCSTR) DWORD {
ret1 := syscall3(certOIDToAlgId, 1,
uintptr(unsafe.Pointer(pszObjId)),
0,
0)
return DWORD(ret1)
}
// TODO: Unknown type(s): HCRYPTPROV_LEGACY
// func CertOpenStore(lpszStoreProvider /*const*/ LPCSTR, dwEncodingType DWORD, hCryptProv HCRYPTPROV_LEGACY, dwFlags DWORD, pvPara /*const*/ uintptr) HCERTSTORE
// TODO: Unknown type(s): HCRYPTPROV_LEGACY
// func CertOpenSystemStore(hProv HCRYPTPROV_LEGACY, szSubsystemProtocol string) HCERTSTORE
func CertRDNValueToStr(dwValueType DWORD, pValue PCERT_RDN_VALUE_BLOB, psz LPWSTR, csz DWORD) DWORD {
ret1 := syscall6(certRDNValueToStr, 4,
uintptr(dwValueType),
uintptr(unsafe.Pointer(pValue)),
uintptr(unsafe.Pointer(psz)),
uintptr(csz),
0,
0)
return DWORD(ret1)
}
// TODO: Unknown type(s): PCERT_PHYSICAL_STORE_INFO
// func CertRegisterPhysicalStore(pvSystemStore /*const*/ uintptr, dwFlags DWORD, pwszStoreName string, pStoreInfo PCERT_PHYSICAL_STORE_INFO, pvReserved uintptr) bool
// TODO: Unknown type(s): PCERT_SYSTEM_STORE_INFO
// func CertRegisterSystemStore(pvSystemStore /*const*/ uintptr, dwFlags DWORD, pStoreInfo PCERT_SYSTEM_STORE_INFO, pvReserved uintptr) bool
func CertRemoveEnhancedKeyUsageIdentifier(pCertContext /*const*/ PCCERT_CONTEXT, pszUsageIdentifier /*const*/ LPCSTR) bool {
ret1 := syscall3(certRemoveEnhancedKeyUsageIdentifier, 2,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(unsafe.Pointer(pszUsageIdentifier)),
0)
return ret1 != 0
}
func CertRemoveStoreFromCollection(hCollectionStore HCERTSTORE, hSiblingStore HCERTSTORE) {
syscall3(certRemoveStoreFromCollection, 2,
uintptr(hCollectionStore),
uintptr(hSiblingStore),
0)
}
// TODO: Unknown type(s): HCERTCHAINENGINE
// func CertResyncCertificateChainEngine(hChainEngine HCERTCHAINENGINE) bool
func CertSaveStore(hCertStore HCERTSTORE, dwEncodingType DWORD, dwSaveAs DWORD, dwSaveTo DWORD, pvSaveToPara uintptr, dwFlags DWORD) bool {
ret1 := syscall6(certSaveStore, 6,
uintptr(hCertStore),
uintptr(dwEncodingType),
uintptr(dwSaveAs),
uintptr(dwSaveTo),
pvSaveToPara,
uintptr(dwFlags))
return ret1 != 0
}
func CertSerializeCRLStoreElement(pCrlContext PCCRL_CONTEXT, dwFlags DWORD, pbElement *byte, pcbElement *uint32) bool {
ret1 := syscall6(certSerializeCRLStoreElement, 4,
uintptr(unsafe.Pointer(pCrlContext)),
uintptr(dwFlags),
uintptr(unsafe.Pointer(pbElement)),
uintptr(unsafe.Pointer(pcbElement)),
0,
0)
return ret1 != 0
}
func CertSerializeCTLStoreElement(pCtlContext /*const*/ PCCTL_CONTEXT, dwFlags DWORD, pbElement *byte, pcbElement *uint32) bool {
ret1 := syscall6(certSerializeCTLStoreElement, 4,
uintptr(unsafe.Pointer(pCtlContext)),
uintptr(dwFlags),
uintptr(unsafe.Pointer(pbElement)),
uintptr(unsafe.Pointer(pcbElement)),
0,
0)
return ret1 != 0
}
func CertSerializeCertificateStoreElement(pCertContext /*const*/ PCCERT_CONTEXT, dwFlags DWORD, pbElement *byte, pcbElement *uint32) bool {
ret1 := syscall6(certSerializeCertificateStoreElement, 4,
uintptr(unsafe.Pointer(pCertContext)),
uintptr(dwFlags),
uintptr(unsafe.Pointer(pbElement)),
uintptr(unsafe.Pointer(pcbElement)),