12 #include "../GrayLibBase.h"
29 static bool GRAYCALL ReadIV(
const char* s, BYTE* pIV,
size_t nIVSize);
30 static void GRAYCALL DecryptPrep(BYTE* pKey,
size_t nKeySize, BYTE* pIV,
const BYTE* pPassword,
size_t nPassSize);
32 static void GRAYCALL DecryptDES(BYTE pIV[8], BYTE* pBuffer,
size_t nSizeBuf,
const BYTE* pPassword,
size_t nPassSize);
33 static void GRAYCALL DecryptDES3(BYTE pIV[8], BYTE* pBuffer,
size_t nSizeBuf,
const BYTE* pPassword,
size_t nPassSize);
34 static void GRAYCALL DecryptAES(BYTE pIV[16], UINT nKeySize, BYTE* pBuffer,
size_t nSizeBuf,
const BYTE* pPassword,
size_t nPassSize);
37 static const char k_BEGINf[19];
38 static const char k_ENDf[17];
50 static const char* FindHeader(
const char* pData,
const char* pszType);
52 HRESULT ReadPEM(
const char* pszType,
const BYTE* pData,
const BYTE* pPassword =
nullptr,
size_t nPassSize = 0);
54 static HRESULT GRAYCALL WriteToPEM(
char* pOut,
StrLen_t nOutLen,
const char* pszType,
const BYTE* pDerData,
size_t nSizeDer);
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
~cPEM() noexcept
Definition: cPEM.h:46
size_t m_nSizeRead
The uncompressed read size.
Definition: cPEM.h:40
cPEM() noexcept
Definition: cPEM.h:43
int StrLen_t
the length of a string in chars (bytes for UTF8, wchar_t for UNICODE). or offset in characters....
Definition: StrConst.h:32