aboutsummaryrefslogtreecommitdiff
path: root/envelope.h
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2016-10-08 11:59:44 +0200
committertomsmeding <tom.smeding@gmail.com>2016-10-08 11:59:44 +0200
commit113f90b689af1d7169df9db5d7e84443972b5f68 (patch)
tree06cea871ae704f5cb335ea2381fa5dd98e9e62d3 /envelope.h
parentddeae250bc6661daafb25ae07f8c2e01b53b0d44 (diff)
Add digital envelope encryption
Diffstat (limited to 'envelope.h')
-rw-r--r--envelope.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/envelope.h b/envelope.h
new file mode 100644
index 0000000..a72a7ad
--- /dev/null
+++ b/envelope.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include <string>
+#include "rsa.h"
+
+namespace Envelope{
+
+ std::string encrypt(const std::string &data,const RSA::PublicKey &pubkey);
+
+ //throws invalid_argument for an invalid ciphertext (length invalid)
+ std::string decrypt(const std::string &data,const RSA::PrivateKey &privkey);
+
+}