Leaked source code of windows server 2003
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.

51 lines
896 B

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. crypt.hxx
  5. Abstract:
  6. CSecureString: Encrypted string for holding passwords
  7. History:
  8. 12-April-2002 MattRim Created
  9. --*/
  10. #ifndef __CRYPT_HXX__
  11. #define __CRYPT_HXX__ 1
  12. class CSecureString {
  13. public:
  14. CSecureString();
  15. ~CSecureString();
  16. CSecureString& operator=(const CSecureString& rhs);
  17. CSecureString& operator=(const PWCHAR& rhs);
  18. bool GetString(PWCHAR *ppszString);
  19. void ReleaseString();
  20. bool Empty() const {return m_fEmpty;};
  21. private:
  22. CSecureString(const CSecureString & x);
  23. void Reset();
  24. bool GenerateEncryptedData(const PWCHAR pszSource);
  25. bool Decrypt();
  26. bool m_fEncrypted;
  27. bool m_fEmpty;
  28. PWCHAR m_pszUnencryptedString;
  29. DATA_BLOB m_EncryptedData;
  30. };
  31. #endif // __CRYPT_HXX__