Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b482420d3a |
41
include/sp/extensions/Encrypt.h
Normal file
41
include/sp/extensions/Encrypt.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* \file Encrypt.h
|
||||
* \brief File containing encrypt utilities
|
||||
*/
|
||||
|
||||
#include <sp/common/DataBuffer.h>
|
||||
|
||||
namespace sp {
|
||||
namespace option {
|
||||
|
||||
struct TlsEncrypt {
|
||||
bool m_Enabled = true;
|
||||
};
|
||||
|
||||
} // namespace option
|
||||
} // namespace sp
|
||||
|
||||
#include <sp/io/IOInterface.h>
|
||||
|
||||
namespace sp {
|
||||
namespace ssl {
|
||||
|
||||
// encrypt
|
||||
|
||||
// decrypt
|
||||
|
||||
} // namespace ssl
|
||||
|
||||
namespace io {
|
||||
|
||||
template <>
|
||||
class MessageEncapsulator<option::TlsEncrypt> {
|
||||
public:
|
||||
static DataBuffer Encapsulate(const DataBuffer& a_Data, const option::TlsEncrypt& a_Option);
|
||||
static DataBuffer Decapsulate(DataBuffer& a_Data, const option::TlsEncrypt& a_Option);
|
||||
};
|
||||
|
||||
} // namespace io
|
||||
} // namespace sp
|
||||
3
src/sp/extensions/Encrypt.cpp
Normal file
3
src/sp/extensions/Encrypt.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include <sp/extensions/Encrypt.h>
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
@@ -6,9 +6,14 @@ local modules = {
|
||||
Compression = {
|
||||
Option = "zlib",
|
||||
Deps = {"zlib"},
|
||||
Packages = {"zlib"},
|
||||
Includes = {"include/(sp/extensions/Compress.h)"},
|
||||
Sources = {"src/sp/extensions/Compress.cpp"}
|
||||
},
|
||||
Encryption = {
|
||||
Option = "ssl",
|
||||
Deps = {"openssl"},
|
||||
Includes = {"include/(sp/extensions/Encrypt.h)"},
|
||||
Sources = {"src/sp/extensions/Encrypt.cpp"}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +42,7 @@ for name, module in table.orderpairs(modules) do
|
||||
for _, source in table.orderpairs(module.Sources) do
|
||||
add_files(source)
|
||||
end
|
||||
for _, package in table.orderpairs(module.Packages) do
|
||||
for _, package in table.orderpairs(module.Deps) do
|
||||
add_packages(package)
|
||||
end
|
||||
set_group("Library")
|
||||
|
||||
Reference in New Issue
Block a user