PuttyTools.h 1.9 KB

123456789101112131415161718192021222324252627282930
  1. //---------------------------------------------------------------------------
  2. #ifndef PuttyToolsH
  3. #define PuttyToolsH
  4. //---------------------------------------------------------------------------
  5. enum TKeyType { ktUnopenable, ktUnknown, ktSSH1, ktSSH2, ktOpenSSH, ktSSHCom };
  6. TKeyType KeyType(UnicodeString FileName);
  7. UnicodeString KeyTypeName(TKeyType KeyType);
  8. bool IsKeyEncrypted(TKeyType KeyType, const UnicodeString & FileName, UnicodeString & Comment);
  9. struct TPrivateKey;
  10. TPrivateKey * LoadKey(TKeyType KeyType, const UnicodeString & FileName, const UnicodeString & Passphrase);
  11. void ChangeKeyComment(TPrivateKey * PrivateKey, const UnicodeString & Comment);
  12. void SaveKey(TKeyType KeyType, const UnicodeString & FileName,
  13. const UnicodeString & Passphrase, TPrivateKey * PrivateKey);
  14. void FreeKey(TPrivateKey * PrivateKey);
  15. //---------------------------------------------------------------------------
  16. __int64 __fastcall ParseSize(UnicodeString SizeStr);
  17. //---------------------------------------------------------------------------
  18. bool __fastcall HasGSSAPI(UnicodeString CustomPath);
  19. //---------------------------------------------------------------------------
  20. void __fastcall AES256EncodeWithMAC(char * Data, size_t Len, const char * Password,
  21. size_t PasswordLen, const char * Salt);
  22. //---------------------------------------------------------------------------
  23. UnicodeString __fastcall NormalizeFingerprint(UnicodeString Fingerprint);
  24. UnicodeString __fastcall KeyTypeFromFingerprint(UnicodeString Fingerprint);
  25. //---------------------------------------------------------------------------
  26. UnicodeString __fastcall GetPuTTYVersion();
  27. //---------------------------------------------------------------------------
  28. UnicodeString __fastcall Sha256(const char * Data, size_t Size);
  29. //---------------------------------------------------------------------------
  30. #endif