//---------------------------------------------------------------------------- // EgalTech 2014-2023 //---------------------------------------------------------------------------- // File : SELkLockId.cpp Data : 30.05.23 Versione : 2.5e5 // Contenuto : Dichiarazione funzioni per gestione/calcolo Id protezione, // da macchina o da chiave hardware. // // // Modifiche : 10.09.14 DS Creazione modulo. // 16.05.22 DS Aggiunta gestione chiave di rete. // 30.05.23 DS Aggiunta gestione utente di rete e rilascio chiave di rete. // //---------------------------------------------------------------------------- #pragma once #include //------------------------------------------------------------------------------- // Imposto il tipo di protezione ammessa (ANY, HW, SW) bool SetLockType( int nType) ; // Imposto chiave di rete, identificativo utente (0-9) e indirizzo bool SetNetHwKey( bool bNetHwKey, int nUserId, const std::string& sAddrPort) ; // Libero chiave di rete (da eseguire al termine del programma) bool CloseNetHwKey( void) ; // Recupero l'identificativo in chiaro della protezione bool GetLockId( std::string& sLockId) ; // Recupero l'identificativo cifrato della protezione bool GetLockId2( std::string& sLockId) ; // conversioni bool ConvertLockIdToLockId2( const std::string& sLockId, std::string& sLockId2) ; bool ConvertLockId2ToLockId( const std::string& sLockId2, std::string& sLockId) ; bool ConvertLockIdToScramKey( const std::string& sLockId, std::string& sScramKey) ; bool ConvertLockId2ToScramKey( const std::string& sLockId2, std::string& sScramKey) ; // Serial Number della chiave hw (non di rete) bool GetLockSN( int& nLockSN) ; //-------------------------- Constants ---------------------------------------- // Tipo di protezione const int KEY_LOCK_TYPE_ANY = 0 ; const int KEY_LOCK_TYPE_SW = 1 ; const int KEY_LOCK_TYPE_HW = 2 ; // Inizio Id protezione hw const std::string KEY_LOCK_HW_START = "EGTECH" ;