Integrated DataOutputLayer to ModuleGenerateKey
This commit is contained in:
parent
0ab87de23c
commit
ba37b4325c
@ -1,5 +1,5 @@
|
||||
#include "ModuleGenerateKey.h"
|
||||
|
||||
#include "DataOutputLayer.h"
|
||||
#include "KeyManager.h"
|
||||
#include "CommandlineInterface.h"
|
||||
|
||||
@ -8,7 +8,24 @@ using namespace Module;
|
||||
|
||||
void GenerateKey::Run() {
|
||||
|
||||
// Pass KeyManager::GetKey() to data output layer
|
||||
// Initialize the data output layer
|
||||
IO::DataOutputLayer::Init();
|
||||
|
||||
// Enqueue our single block of data
|
||||
IO::DataOutputLayer::Enqueue(KeyManager::GetKey());
|
||||
|
||||
// Tell the data output layer, that is has received all blocks
|
||||
IO::DataOutputLayer::ReachedEOF();
|
||||
|
||||
// Tell it to write all blocks
|
||||
// (a single call should suffice, but a while-loop is the proper
|
||||
// way to do it)
|
||||
while (!IO::DataOutputLayer::IsFinished()) {
|
||||
IO::DataOutputLayer::WriteBlock();
|
||||
}
|
||||
|
||||
// Destruct the data output layer
|
||||
IO::DataOutputLayer::Destruct();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -19,8 +19,11 @@ int main(int argc, char* const* argv) {
|
||||
switch (Configuration::activeModule) {
|
||||
case Configuration::MODULE::GENERATE_KEY:
|
||||
Module::GenerateKey::Run();
|
||||
break;
|
||||
|
||||
case Configuration::MODULE::ENCRYPTION:
|
||||
Module::Encryption::Run();
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user