Source code of Windows XP (NT5)
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.

50 lines
1.0 KiB

  1. // KeyManager.h: interface for the CKeyManager class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_KEYMANAGER_H__0AC10C43_D0D5_11D2_95E5_00C04F8E7A70__INCLUDED_)
  5. #define AFX_KEYMANAGER_H__0AC10C43_D0D5_11D2_95E5_00C04F8E7A70__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #ifdef UNIX
  10. #include <des.h>
  11. // BUGBUG needs some headers to get MAC Address on unix
  12. #else
  13. #include "nt\des.h"
  14. #include "nt\tripldes.h"
  15. #include "nt\modes.h"
  16. #include <nb30.h>
  17. #endif
  18. class CKeyManager
  19. {
  20. public:
  21. CKeyManager();
  22. virtual ~CKeyManager();
  23. HRESULT encryptKey(BYTE input[24], BYTE output[32]);
  24. HRESULT decryptKey(BYTE input[32], BYTE output[24]);
  25. BOOL isOk() { return m_ok; }
  26. protected:
  27. void LogBlob(LPBYTE pbBlob, DWORD dwBlobLen, LPCSTR pszCaption);
  28. void makeDESKey(LPBYTE pbKey);
  29. BOOL m_ok;
  30. BOOL m_dwLoggingEnabled;
  31. #ifdef UNIX
  32. des_key_schedule ks1, ks2, ks3;
  33. #else
  34. DES3TABLE m_ks;
  35. #endif
  36. };
  37. #endif // !defined(AFX_KEYMANAGER_H__0AC10C43_D0D5_11D2_95E5_00C04F8E7A70__INCLUDED_)