CAPIUtils.h
Go to the documentation of this file.00001
00009 #ifndef __CAPIUTILS_H__
00010 #define __CAPIUTILS_H__
00011
00012 #include "PKIFdll.h"
00013
00014 #include <wincrypt.h>
00015 #include "PKIFCryptoConstants.h"
00016
00017 void CAC_API ReverseBytes(unsigned char* buf, int bufLen);
00018
00019 BOOL CreatePrivateExponentOneKey(LPTSTR szProvider,
00020 DWORD dwProvType,
00021 LPTSTR szContainer,
00022 DWORD dwKeySpec,
00023 HCRYPTPROV *hProv,
00024 HCRYPTKEY *hPrivateKey);
00025
00026 BOOL ImportPlainSessionBlob(HCRYPTPROV hProv,
00027 HCRYPTKEY hPrivateKey,
00028 ALG_ID dwAlgId,
00029 LPBYTE pbKeyMaterial ,
00030 DWORD dwKeyMaterial ,
00031 HCRYPTKEY *hSessionKey);
00032
00033
00034 bool CertHasKey(PCCERT_CONTEXT pPrevCertContent);
00035 ALG_ID GetHashAlg(PKIFCRYPTO::HASH_ALG alg);
00036 wchar_t* GetCNGHashAlg(PKIFCRYPTO::HASH_ALG alg);
00037 void StrToName(const char* dn, unsigned char** enc, DWORD* len);
00038
00039 #endif