summaryrefslogtreecommitdiffstats
path: root/src/Crypto.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-01-25 19:19:17 +0100
committermadmaxoft <github@xoft.cz>2014-01-25 19:19:17 +0100
commitca0e51d89c5b3979f38918b3df7e0f9137f251ce (patch)
tree065d0a7a84fe04b91113893f95b67064d64ec58f /src/Crypto.h
parentMerged branch 'master' into ChangeToPolarSSL. (diff)
downloadcuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.tar
cuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.tar.gz
cuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.tar.bz2
cuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.tar.lz
cuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.tar.xz
cuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.tar.zst
cuberite-ca0e51d89c5b3979f38918b3df7e0f9137f251ce.zip
Diffstat (limited to '')
-rw-r--r--src/Crypto.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Crypto.h b/src/Crypto.h
index 6b576f55b..a97f34fbf 100644
--- a/src/Crypto.h
+++ b/src/Crypto.h
@@ -43,6 +43,11 @@ public:
Returns the number of bytes decrypted, or negative number for error. */
int Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, Byte * a_DecryptedData, size_t a_DecryptedMaxLength);
+ /** Encrypts the data using RSAES-PKCS#1 algorithm.
+ Both a_EncryptedData and a_DecryptedData must be at least <KeySizeBytes> bytes large.
+ Returns the number of bytes decrypted, or negative number for error. */
+ int Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a_EncryptedData, size_t a_EncryptedMaxLength);
+
protected:
rsa_context m_Rsa;
entropy_context m_Entropy;