[inline, virtual] [inline, virtual] [inline, virtual] [inline, virtual] [inline, virtual] [virtual] [inline, static] [inline, virtual] [inline, virtual] [virtual] [virtual] [protected] [virtual] [protected] [virtual] [virtual] [protected] [inline, virtual] [protected] [protected] [protected] [virtual] [protected] [inline, virtual] [inline, virtual] [pure virtual] [inline, virtual] [inline, virtual] [inline, virtual] [inline, virtual] [protected] [inline, virtual] [inline, virtual] [virtual] [virtual] [protected] [virtual] [protected] [protected] [protected] [protected] [protected] [virtual] [static] [virtual] [inline, virtual] [inline, virtual] [inline, virtual] [virtual] [inline, virtual] [virtual] [inline, virtual] [inline, virtual] [virtual] [inline, virtual] [protected] [virtual] |
Sets the cipher key for the given module. This function updates the key at runtime, but it does not write to the config file. To write the new unlock key to the config file use code like this:
SectionMap::iterator section;
ConfigEntMap::iterator entry;
DIR *dir = opendir(configPath);
struct dirent *ent;
char* modFile;
if (dir) { // find and update .conf file
rewinddir(dir);
while ((ent = readdir(dir)))
{
if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, "..")))
{
modFile = m_backend->configPath;
modFile += "/";
modFile += ent->d_name;
SWConfig *myConfig = new SWConfig( modFile );
section = myConfig->Sections.find( m_module->Name() );
if ( section != myConfig->Sections.end() )
{
entry = section->second.find("CipherKey");
if (entry != section->second.end())
{
entry->second = unlockKey;//set cipher key
myConfig->Save();//save config file
}
}
delete myConfig;
}
}
}
closedir(dir);
|
|