forked from open-license-manager/licensecc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
open-license-manager
committed
Sep 14, 2014
1 parent
1922d8c
commit 345c7b7
Showing
40 changed files
with
491 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
add_subdirectory("bootstrap") | ||
add_subdirectory("library") | ||
add_subdirectory("pc-identifier") | ||
add_subdirectory("license-generator") | ||
add_subdirectory("tools") | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* LicenseReader.cpp | ||
* | ||
* Created on: Mar 30, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifdef _WIN32 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* LicenseReader.h | ||
* | ||
* Created on: Mar 30, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifndef LICENSEREADER_H_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* EventRegistry.cpp | ||
* | ||
* Created on: Mar 30, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#include "EventRegistry.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* EventRegistry.h | ||
* | ||
* Created on: Mar 30, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifndef EVENTREGISTRY_H_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* StringUtils.cpp | ||
* | ||
* Created on: Apr 8, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#include <cctype> //toupper | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* StringUtils.h | ||
* | ||
* Created on: Apr 8, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifndef STRINGUTILS_H_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* os-dependent.hpp | ||
* | ||
* Created on: Mar 29, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifndef OS_DEPENDENT_CPP_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* os-dependent.hpp | ||
* | ||
* Created on: Mar 29, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifndef OS_DEPENDENT_HPP_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* pc-identifiers.c | ||
* | ||
* Created on: Apr 16, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#include "os/os.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* pc-identifiers.h | ||
* | ||
* Created on: Apr 16, 2014 | ||
* Author: devel | ||
* | ||
*/ | ||
|
||
#ifndef PC_IDENTIFIERS_H_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
enable_language(CXX) | ||
add_subdirectory("base_lib") | ||
add_subdirectory("bootstrap") | ||
add_subdirectory("pc-identifier") | ||
add_subdirectory("license-generator") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
if(WIN32) | ||
ADD_LIBRARY( | ||
tools_base STATIC | ||
CryptoHelper.cpp | ||
win/CryptoHelperWindows.cpp | ||
) | ||
else(WIN32) | ||
ADD_LIBRARY( | ||
tools_base STATIC | ||
CryptoHelper.cpp | ||
linux/CryptoHelperLinux.cpp | ||
) | ||
ENDIF(WIN32) | ||
|
||
target_link_libraries( | ||
tools_base | ||
${EXTERNAL_LIBS} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <memory> | ||
#include "CryptoHelper.h" | ||
#ifdef __unix__ | ||
#include"linux/CryptoHelperLinux.h" | ||
#else | ||
#include"win/CryptoHelperWindows.h" | ||
#endif | ||
|
||
using namespace std; | ||
namespace license { | ||
|
||
unique_ptr<CryptoHelper> CryptoHelper::getInstance() { | ||
#ifdef __unix__ | ||
unique_ptr<CryptoHelper> ptr((CryptoHelper*) new CryptoHelperLinux()); | ||
#else | ||
unique_ptr<CryptoHelper> ptr((CryptoHelper*) new CryptpHelperWindows()); | ||
#endif | ||
return ptr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef CRYPTPHELPER_H_ | ||
#define CRYPTPHELPER_H_ | ||
|
||
#include <memory> | ||
#include <cstddef> | ||
|
||
namespace license { | ||
using namespace std; | ||
/** | ||
* Helper class definition to generate and export Public/Private keys | ||
* for Asymmetric encryption. | ||
* | ||
* <p>Since this part relies heavily on operating system libraries this class | ||
* provides a common facade to the cryptographic functions. The two implementing | ||
* subclasses are chosen in the factory method #getInstance(). This is to avoid | ||
* to clutter the code with many "ifdef". (extreme performance is not an issue here)</p> | ||
*<p> *it is shared by bootstrap and license-generator projects.</p> | ||
*/ | ||
|
||
class CryptoHelper { | ||
|
||
protected: | ||
CryptoHelper(); | ||
|
||
public: | ||
virtual void generateKeyPair() = 0; | ||
virtual const string exportPrivateKey() const = 0; | ||
virtual const string exportPublicKey() const = 0; | ||
|
||
virtual const string signString(const unsigned char* privateKey, | ||
size_t pklen, const string& license) const = 0; | ||
static unique_ptr<CryptoHelper> getInstance(); | ||
virtual ~CryptoHelper(); | ||
}; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This is the base library for the tools projects. | ||
It contains cryptographic functions (that are very different from Linux and | ||
Windows operating systems) |
Oops, something went wrong.