PuttyTools.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. UnicodeString GetPublicKeyLine(const UnicodeString & FileName, UnicodeString & Comment);
  21. extern const UnicodeString PuttyKeyExt;
  22. //---------------------------------------------------------------------------
  23. bool __fastcall HasGSSAPI(UnicodeString CustomPath);
  24. //---------------------------------------------------------------------------
  25. void __fastcall AES256EncodeWithMAC(char * Data, size_t Len, const char * Password,
  26. size_t PasswordLen, const char * Salt);
  27. //---------------------------------------------------------------------------
  28. UnicodeString __fastcall NormalizeFingerprint(UnicodeString Fingerprint);
  29. UnicodeString __fastcall KeyTypeFromFingerprint(UnicodeString Fingerprint);
  30. //---------------------------------------------------------------------------
  31. UnicodeString __fastcall GetPuTTYVersion();
  32. //---------------------------------------------------------------------------
  33. UnicodeString __fastcall Sha256(const char * Data, size_t Size);
  34. //---------------------------------------------------------------------------
  35. void __fastcall DllHijackingProtection();
  36. //---------------------------------------------------------------------------
  37. UnicodeString __fastcall ParseOpenSshPubLine(const UnicodeString & Line, const struct ssh_signkey *& Algorithm);
  38. //---------------------------------------------------------------------------
  39. UnicodeString __fastcall GetKeyTypeHuman(const UnicodeString & KeyType);
  40. //---------------------------------------------------------------------------
  41. bool IsOpenSSH(const UnicodeString & SshImplementation);
  42. //---------------------------------------------------------------------------
  43. TStrings * SshCipherList();
  44. TStrings * SshKexList();
  45. TStrings * SshHostKeyList();
  46. TStrings * SshMacList();
  47. //---------------------------------------------------------------------------
  48. #endif