cprocsp-sys 0.0.5

CryptoPRO bindings
Documentation
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
/* automatically generated by rust-bindgen 0.65.1 */

extern crate libloading;
pub struct SSP {
    __library: ::libloading::Library,
    pub GetLastError: unsafe extern "C" fn() -> DWORD,
    pub CertOpenStore: unsafe extern "C" fn(
        lpszStoreProvider: LPCSTR,
        dwEncodingType: DWORD,
        hCryptProv: HCRYPTPROV,
        dwFlags: DWORD,
        pvPara: *const ::std::os::raw::c_void,
    ) -> HCERTSTORE,
    pub CertCloseStore: unsafe extern "C" fn(hCertStore: HCERTSTORE, dwFlags: DWORD) -> BOOL,
    pub CertEnumCertificatesInStore: unsafe extern "C" fn(
        hCertStore: HCERTSTORE,
        pPrevCertContext: PCCERT_CONTEXT,
    ) -> PCCERT_CONTEXT,
    pub CertFindCertificateInStore: unsafe extern "C" fn(
        hCertStore: HCERTSTORE,
        dwCertEncodingType: DWORD,
        dwFindFlags: DWORD,
        dwFindType: DWORD,
        pvFindPara: *const ::std::os::raw::c_void,
        pPrevCertContext: PCCERT_CONTEXT,
    ) -> PCCERT_CONTEXT,
    pub CertFreeCertificateContext: unsafe extern "C" fn(pCertContext: PCCERT_CONTEXT) -> BOOL,
    pub CertGetCertificateContextProperty: unsafe extern "C" fn(
        pCertContext: PCCERT_CONTEXT,
        dwPropId: DWORD,
        pvData: *mut ::std::os::raw::c_void,
        pcbData: *mut DWORD,
    ) -> BOOL,
    pub CertEnumCertificateContextProperties:
        unsafe extern "C" fn(pCertContext: PCCERT_CONTEXT, dwPropId: DWORD) -> DWORD,
    pub CryptAcquireContextW: unsafe extern "C" fn(
        phProv: *mut HCRYPTPROV,
        pszContainer: LPCWSTR,
        pszProvider: LPCWSTR,
        dwProvType: DWORD,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptReleaseContext: unsafe extern "C" fn(hProv: HCRYPTPROV, dwFlags: DWORD) -> BOOL,
    pub CryptGenKey: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        Algid: ALG_ID,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL,
    pub CryptDeriveKey: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        Algid: ALG_ID,
        hBaseData: HCRYPTHASH,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL,
    pub CryptDestroyKey: unsafe extern "C" fn(hKey: HCRYPTKEY) -> BOOL,
    pub CryptSetKeyParam: unsafe extern "C" fn(
        hKey: HCRYPTKEY,
        dwParam: DWORD,
        pbData: *const BYTE,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptGetKeyParam: unsafe extern "C" fn(
        hKey: HCRYPTKEY,
        dwParam: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptSetHashParam: unsafe extern "C" fn(
        hHash: HCRYPTHASH,
        dwParam: DWORD,
        pbData: *const BYTE,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptGetHashParam: unsafe extern "C" fn(
        hHash: HCRYPTHASH,
        dwParam: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptSetProvParam: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        dwParam: DWORD,
        pbData: *const BYTE,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptGetProvParam: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        dwParam: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptGenRandom:
        unsafe extern "C" fn(hProv: HCRYPTPROV, dwLen: DWORD, pbBuffer: *mut BYTE) -> BOOL,
    pub CryptGetUserKey: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        dwKeySpec: DWORD,
        phUserKey: *mut HCRYPTKEY,
    ) -> BOOL,
    pub CryptExportKey: unsafe extern "C" fn(
        hKey: HCRYPTKEY,
        hExpKey: HCRYPTKEY,
        dwBlobType: DWORD,
        dwFlags: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
    ) -> BOOL,
    pub CryptImportKey: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        pbData: *const BYTE,
        dwDataLen: DWORD,
        hPubKey: HCRYPTKEY,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL,
    pub CryptEncrypt: unsafe extern "C" fn(
        hKey: HCRYPTKEY,
        hHash: HCRYPTHASH,
        Final: BOOL,
        dwFlags: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwBufLen: DWORD,
    ) -> BOOL,
    pub CryptDecrypt: unsafe extern "C" fn(
        hKey: HCRYPTKEY,
        hHash: HCRYPTHASH,
        Final: BOOL,
        dwFlags: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
    ) -> BOOL,
    pub CryptCreateHash: unsafe extern "C" fn(
        hProv: HCRYPTPROV,
        Algid: ALG_ID,
        hKey: HCRYPTKEY,
        dwFlags: DWORD,
        phHash: *mut HCRYPTHASH,
    ) -> BOOL,
    pub CryptHashData: unsafe extern "C" fn(
        hHash: HCRYPTHASH,
        pbData: *const BYTE,
        dwDataLen: DWORD,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptHashSessionKey:
        unsafe extern "C" fn(hHash: HCRYPTHASH, hKey: HCRYPTKEY, dwFlags: DWORD) -> BOOL,
    pub CryptDestroyHash: unsafe extern "C" fn(hHash: HCRYPTHASH) -> BOOL,
    pub CryptSignHashA: unsafe extern "C" fn(
        hHash: HCRYPTHASH,
        dwKeySpec: DWORD,
        szDescription: LPCSTR,
        dwFlags: DWORD,
        pbSignature: *mut BYTE,
        pdwSigLen: *mut DWORD,
    ) -> BOOL,
    pub CryptVerifySignatureA: unsafe extern "C" fn(
        hHash: HCRYPTHASH,
        pbSignature: *const BYTE,
        dwSigLen: DWORD,
        hPubKey: HCRYPTKEY,
        szDescription: LPCSTR,
        dwFlags: DWORD,
    ) -> BOOL,
    pub CryptDuplicateKey: unsafe extern "C" fn(
        hKey: HCRYPTKEY,
        pdwReserved: *mut DWORD,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL,
    pub CryptDuplicateHash: unsafe extern "C" fn(
        hHash: HCRYPTHASH,
        pdwReserved: *mut DWORD,
        dwFlags: DWORD,
        phHash: *mut HCRYPTHASH,
    ) -> BOOL,
    pub CryptEnumProvidersA: unsafe extern "C" fn(
        dwIndex: DWORD,
        pdwReserved: *mut DWORD,
        dwFlags: DWORD,
        pdwProvType: *mut DWORD,
        szProvName: LPSTR,
        pcbProvName: *mut DWORD,
    ) -> BOOL,
}
impl SSP {
    pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
    where
        P: AsRef<::std::ffi::OsStr>,
    {
        let library = ::libloading::Library::new(path)?;
        Self::from_library(library)
    }
    pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
    where
        L: Into<::libloading::Library>,
    {
        let __library = library.into();
        let GetLastError = __library.get(b"GetLastError\0").map(|sym| *sym)?;
        let CertOpenStore = __library.get(b"CertOpenStore\0").map(|sym| *sym)?;
        let CertCloseStore = __library.get(b"CertCloseStore\0").map(|sym| *sym)?;
        let CertEnumCertificatesInStore = __library
            .get(b"CertEnumCertificatesInStore\0")
            .map(|sym| *sym)?;
        let CertFindCertificateInStore = __library
            .get(b"CertFindCertificateInStore\0")
            .map(|sym| *sym)?;
        let CertFreeCertificateContext = __library
            .get(b"CertFreeCertificateContext\0")
            .map(|sym| *sym)?;
        let CertGetCertificateContextProperty = __library
            .get(b"CertGetCertificateContextProperty\0")
            .map(|sym| *sym)?;
        let CertEnumCertificateContextProperties = __library
            .get(b"CertEnumCertificateContextProperties\0")
            .map(|sym| *sym)?;
        let CryptAcquireContextW = __library.get(b"CryptAcquireContextW\0").map(|sym| *sym)?;
        let CryptReleaseContext = __library.get(b"CryptReleaseContext\0").map(|sym| *sym)?;
        let CryptGenKey = __library.get(b"CryptGenKey\0").map(|sym| *sym)?;
        let CryptDeriveKey = __library.get(b"CryptDeriveKey\0").map(|sym| *sym)?;
        let CryptDestroyKey = __library.get(b"CryptDestroyKey\0").map(|sym| *sym)?;
        let CryptSetKeyParam = __library.get(b"CryptSetKeyParam\0").map(|sym| *sym)?;
        let CryptGetKeyParam = __library.get(b"CryptGetKeyParam\0").map(|sym| *sym)?;
        let CryptSetHashParam = __library.get(b"CryptSetHashParam\0").map(|sym| *sym)?;
        let CryptGetHashParam = __library.get(b"CryptGetHashParam\0").map(|sym| *sym)?;
        let CryptSetProvParam = __library.get(b"CryptSetProvParam\0").map(|sym| *sym)?;
        let CryptGetProvParam = __library.get(b"CryptGetProvParam\0").map(|sym| *sym)?;
        let CryptGenRandom = __library.get(b"CryptGenRandom\0").map(|sym| *sym)?;
        let CryptGetUserKey = __library.get(b"CryptGetUserKey\0").map(|sym| *sym)?;
        let CryptExportKey = __library.get(b"CryptExportKey\0").map(|sym| *sym)?;
        let CryptImportKey = __library.get(b"CryptImportKey\0").map(|sym| *sym)?;
        let CryptEncrypt = __library.get(b"CryptEncrypt\0").map(|sym| *sym)?;
        let CryptDecrypt = __library.get(b"CryptDecrypt\0").map(|sym| *sym)?;
        let CryptCreateHash = __library.get(b"CryptCreateHash\0").map(|sym| *sym)?;
        let CryptHashData = __library.get(b"CryptHashData\0").map(|sym| *sym)?;
        let CryptHashSessionKey = __library.get(b"CryptHashSessionKey\0").map(|sym| *sym)?;
        let CryptDestroyHash = __library.get(b"CryptDestroyHash\0").map(|sym| *sym)?;
        let CryptSignHashA = __library.get(b"CryptSignHashA\0").map(|sym| *sym)?;
        let CryptVerifySignatureA = __library.get(b"CryptVerifySignatureA\0").map(|sym| *sym)?;
        let CryptDuplicateKey = __library.get(b"CryptDuplicateKey\0").map(|sym| *sym)?;
        let CryptDuplicateHash = __library.get(b"CryptDuplicateHash\0").map(|sym| *sym)?;
        let CryptEnumProvidersA = __library.get(b"CryptEnumProvidersA\0").map(|sym| *sym)?;
        Ok(SSP {
            __library,
            GetLastError,
            CertOpenStore,
            CertCloseStore,
            CertEnumCertificatesInStore,
            CertFindCertificateInStore,
            CertFreeCertificateContext,
            CertGetCertificateContextProperty,
            CertEnumCertificateContextProperties,
            CryptAcquireContextW,
            CryptReleaseContext,
            CryptGenKey,
            CryptDeriveKey,
            CryptDestroyKey,
            CryptSetKeyParam,
            CryptGetKeyParam,
            CryptSetHashParam,
            CryptGetHashParam,
            CryptSetProvParam,
            CryptGetProvParam,
            CryptGenRandom,
            CryptGetUserKey,
            CryptExportKey,
            CryptImportKey,
            CryptEncrypt,
            CryptDecrypt,
            CryptCreateHash,
            CryptHashData,
            CryptHashSessionKey,
            CryptDestroyHash,
            CryptSignHashA,
            CryptVerifySignatureA,
            CryptDuplicateKey,
            CryptDuplicateHash,
            CryptEnumProvidersA,
        })
    }
    pub unsafe fn GetLastError(&self) -> DWORD {
        (self.GetLastError)()
    }
    pub unsafe fn CertOpenStore(
        &self,
        lpszStoreProvider: LPCSTR,
        dwEncodingType: DWORD,
        hCryptProv: HCRYPTPROV,
        dwFlags: DWORD,
        pvPara: *const ::std::os::raw::c_void,
    ) -> HCERTSTORE {
        (self.CertOpenStore)(
            lpszStoreProvider,
            dwEncodingType,
            hCryptProv,
            dwFlags,
            pvPara,
        )
    }
    pub unsafe fn CertCloseStore(&self, hCertStore: HCERTSTORE, dwFlags: DWORD) -> BOOL {
        (self.CertCloseStore)(hCertStore, dwFlags)
    }
    pub unsafe fn CertEnumCertificatesInStore(
        &self,
        hCertStore: HCERTSTORE,
        pPrevCertContext: PCCERT_CONTEXT,
    ) -> PCCERT_CONTEXT {
        (self.CertEnumCertificatesInStore)(hCertStore, pPrevCertContext)
    }
    pub unsafe fn CertFindCertificateInStore(
        &self,
        hCertStore: HCERTSTORE,
        dwCertEncodingType: DWORD,
        dwFindFlags: DWORD,
        dwFindType: DWORD,
        pvFindPara: *const ::std::os::raw::c_void,
        pPrevCertContext: PCCERT_CONTEXT,
    ) -> PCCERT_CONTEXT {
        (self.CertFindCertificateInStore)(
            hCertStore,
            dwCertEncodingType,
            dwFindFlags,
            dwFindType,
            pvFindPara,
            pPrevCertContext,
        )
    }
    pub unsafe fn CertFreeCertificateContext(&self, pCertContext: PCCERT_CONTEXT) -> BOOL {
        (self.CertFreeCertificateContext)(pCertContext)
    }
    pub unsafe fn CertGetCertificateContextProperty(
        &self,
        pCertContext: PCCERT_CONTEXT,
        dwPropId: DWORD,
        pvData: *mut ::std::os::raw::c_void,
        pcbData: *mut DWORD,
    ) -> BOOL {
        (self.CertGetCertificateContextProperty)(pCertContext, dwPropId, pvData, pcbData)
    }
    pub unsafe fn CertEnumCertificateContextProperties(
        &self,
        pCertContext: PCCERT_CONTEXT,
        dwPropId: DWORD,
    ) -> DWORD {
        (self.CertEnumCertificateContextProperties)(pCertContext, dwPropId)
    }
    pub unsafe fn CryptAcquireContextW(
        &self,
        phProv: *mut HCRYPTPROV,
        pszContainer: LPCWSTR,
        pszProvider: LPCWSTR,
        dwProvType: DWORD,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptAcquireContextW)(phProv, pszContainer, pszProvider, dwProvType, dwFlags)
    }
    pub unsafe fn CryptReleaseContext(&self, hProv: HCRYPTPROV, dwFlags: DWORD) -> BOOL {
        (self.CryptReleaseContext)(hProv, dwFlags)
    }
    pub unsafe fn CryptGenKey(
        &self,
        hProv: HCRYPTPROV,
        Algid: ALG_ID,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL {
        (self.CryptGenKey)(hProv, Algid, dwFlags, phKey)
    }
    pub unsafe fn CryptDeriveKey(
        &self,
        hProv: HCRYPTPROV,
        Algid: ALG_ID,
        hBaseData: HCRYPTHASH,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL {
        (self.CryptDeriveKey)(hProv, Algid, hBaseData, dwFlags, phKey)
    }
    pub unsafe fn CryptDestroyKey(&self, hKey: HCRYPTKEY) -> BOOL {
        (self.CryptDestroyKey)(hKey)
    }
    pub unsafe fn CryptSetKeyParam(
        &self,
        hKey: HCRYPTKEY,
        dwParam: DWORD,
        pbData: *const BYTE,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptSetKeyParam)(hKey, dwParam, pbData, dwFlags)
    }
    pub unsafe fn CryptGetKeyParam(
        &self,
        hKey: HCRYPTKEY,
        dwParam: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptGetKeyParam)(hKey, dwParam, pbData, pdwDataLen, dwFlags)
    }
    pub unsafe fn CryptSetHashParam(
        &self,
        hHash: HCRYPTHASH,
        dwParam: DWORD,
        pbData: *const BYTE,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptSetHashParam)(hHash, dwParam, pbData, dwFlags)
    }
    pub unsafe fn CryptGetHashParam(
        &self,
        hHash: HCRYPTHASH,
        dwParam: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptGetHashParam)(hHash, dwParam, pbData, pdwDataLen, dwFlags)
    }
    pub unsafe fn CryptSetProvParam(
        &self,
        hProv: HCRYPTPROV,
        dwParam: DWORD,
        pbData: *const BYTE,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptSetProvParam)(hProv, dwParam, pbData, dwFlags)
    }
    pub unsafe fn CryptGetProvParam(
        &self,
        hProv: HCRYPTPROV,
        dwParam: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptGetProvParam)(hProv, dwParam, pbData, pdwDataLen, dwFlags)
    }
    pub unsafe fn CryptGenRandom(
        &self,
        hProv: HCRYPTPROV,
        dwLen: DWORD,
        pbBuffer: *mut BYTE,
    ) -> BOOL {
        (self.CryptGenRandom)(hProv, dwLen, pbBuffer)
    }
    pub unsafe fn CryptGetUserKey(
        &self,
        hProv: HCRYPTPROV,
        dwKeySpec: DWORD,
        phUserKey: *mut HCRYPTKEY,
    ) -> BOOL {
        (self.CryptGetUserKey)(hProv, dwKeySpec, phUserKey)
    }
    pub unsafe fn CryptExportKey(
        &self,
        hKey: HCRYPTKEY,
        hExpKey: HCRYPTKEY,
        dwBlobType: DWORD,
        dwFlags: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
    ) -> BOOL {
        (self.CryptExportKey)(hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen)
    }
    pub unsafe fn CryptImportKey(
        &self,
        hProv: HCRYPTPROV,
        pbData: *const BYTE,
        dwDataLen: DWORD,
        hPubKey: HCRYPTKEY,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL {
        (self.CryptImportKey)(hProv, pbData, dwDataLen, hPubKey, dwFlags, phKey)
    }
    pub unsafe fn CryptEncrypt(
        &self,
        hKey: HCRYPTKEY,
        hHash: HCRYPTHASH,
        Final: BOOL,
        dwFlags: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
        dwBufLen: DWORD,
    ) -> BOOL {
        (self.CryptEncrypt)(hKey, hHash, Final, dwFlags, pbData, pdwDataLen, dwBufLen)
    }
    pub unsafe fn CryptDecrypt(
        &self,
        hKey: HCRYPTKEY,
        hHash: HCRYPTHASH,
        Final: BOOL,
        dwFlags: DWORD,
        pbData: *mut BYTE,
        pdwDataLen: *mut DWORD,
    ) -> BOOL {
        (self.CryptDecrypt)(hKey, hHash, Final, dwFlags, pbData, pdwDataLen)
    }
    pub unsafe fn CryptCreateHash(
        &self,
        hProv: HCRYPTPROV,
        Algid: ALG_ID,
        hKey: HCRYPTKEY,
        dwFlags: DWORD,
        phHash: *mut HCRYPTHASH,
    ) -> BOOL {
        (self.CryptCreateHash)(hProv, Algid, hKey, dwFlags, phHash)
    }
    pub unsafe fn CryptHashData(
        &self,
        hHash: HCRYPTHASH,
        pbData: *const BYTE,
        dwDataLen: DWORD,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptHashData)(hHash, pbData, dwDataLen, dwFlags)
    }
    pub unsafe fn CryptHashSessionKey(
        &self,
        hHash: HCRYPTHASH,
        hKey: HCRYPTKEY,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptHashSessionKey)(hHash, hKey, dwFlags)
    }
    pub unsafe fn CryptDestroyHash(&self, hHash: HCRYPTHASH) -> BOOL {
        (self.CryptDestroyHash)(hHash)
    }
    pub unsafe fn CryptSignHashA(
        &self,
        hHash: HCRYPTHASH,
        dwKeySpec: DWORD,
        szDescription: LPCSTR,
        dwFlags: DWORD,
        pbSignature: *mut BYTE,
        pdwSigLen: *mut DWORD,
    ) -> BOOL {
        (self.CryptSignHashA)(
            hHash,
            dwKeySpec,
            szDescription,
            dwFlags,
            pbSignature,
            pdwSigLen,
        )
    }
    pub unsafe fn CryptVerifySignatureA(
        &self,
        hHash: HCRYPTHASH,
        pbSignature: *const BYTE,
        dwSigLen: DWORD,
        hPubKey: HCRYPTKEY,
        szDescription: LPCSTR,
        dwFlags: DWORD,
    ) -> BOOL {
        (self.CryptVerifySignatureA)(
            hHash,
            pbSignature,
            dwSigLen,
            hPubKey,
            szDescription,
            dwFlags,
        )
    }
    pub unsafe fn CryptDuplicateKey(
        &self,
        hKey: HCRYPTKEY,
        pdwReserved: *mut DWORD,
        dwFlags: DWORD,
        phKey: *mut HCRYPTKEY,
    ) -> BOOL {
        (self.CryptDuplicateKey)(hKey, pdwReserved, dwFlags, phKey)
    }
    pub unsafe fn CryptDuplicateHash(
        &self,
        hHash: HCRYPTHASH,
        pdwReserved: *mut DWORD,
        dwFlags: DWORD,
        phHash: *mut HCRYPTHASH,
    ) -> BOOL {
        (self.CryptDuplicateHash)(hHash, pdwReserved, dwFlags, phHash)
    }
    pub unsafe fn CryptEnumProvidersA(
        &self,
        dwIndex: DWORD,
        pdwReserved: *mut DWORD,
        dwFlags: DWORD,
        pdwProvType: *mut DWORD,
        szProvName: LPSTR,
        pcbProvName: *mut DWORD,
    ) -> BOOL {
        (self.CryptEnumProvidersA)(
            dwIndex,
            pdwReserved,
            dwFlags,
            pdwProvType,
            szProvName,
            pcbProvName,
        )
    }
}