PuttyTools.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //---------------------------------------------------------------------------
  2. #ifndef PuttyToolsH
  3. #define PuttyToolsH
  4. //---------------------------------------------------------------------------
  5. enum TKeyType
  6. {
  7. ktUnopenable, ktUnknown,
  8. ktSSH1, ktSSH2,
  9. ktOpenSSHAuto, ktOpenSSHPEM, ktOpenSSHNew, ktSSHCom,
  10. ktSSH1Public, ktSSH2PublicRFC4716, ktSSH2PublicOpenSSH
  11. };
  12. TKeyType KeyType(UnicodeString FileName);
  13. bool IsKeyEncrypted(TKeyType KeyType, const UnicodeString & FileName, UnicodeString & Comment);
  14. struct TPrivateKey;
  15. TPrivateKey * LoadKey(TKeyType KeyType, const UnicodeString & FileName, const UnicodeString & Passphrase);
  16. void ChangeKeyComment(TPrivateKey * PrivateKey, const UnicodeString & Comment);
  17. void SaveKey(TKeyType KeyType, const UnicodeString & FileName,
  18. const UnicodeString & Passphrase, TPrivateKey * PrivateKey);
  19. void FreeKey(TPrivateKey * PrivateKey);
  20. //---------------------------------------------------------------------------
  21. bool __fastcall HasGSSAPI(UnicodeString CustomPath);
  22. //---------------------------------------------------------------------------
  23. void __fastcall AES256EncodeWithMAC(char * Data, size_t Len, const char * Password,
  24. size_t PasswordLen, const char * Salt);
  25. //---------------------------------------------------------------------------
  26. UnicodeString __fastcall NormalizeFingerprint(UnicodeString Fingerprint);
  27. UnicodeString __fastcall KeyTypeFromFingerprint(UnicodeString Fingerprint);
  28. //---------------------------------------------------------------------------
  29. UnicodeString __fastcall GetPuTTYVersion();
  30. //---------------------------------------------------------------------------
  31. UnicodeString __fastcall Sha256(const char * Data, size_t Size);
  32. //---------------------------------------------------------------------------
  33. void __fastcall DllHijackingProtection();
  34. //---------------------------------------------------------------------------
  35. UnicodeString __fastcall ParseOpenSshPubLine(const UnicodeString & Line, const struct ssh_signkey *& Algorithm);
  36. //---------------------------------------------------------------------------
  37. #endif