summaryrefslogtreecommitdiffstats
path: root/src/PolarSSL++/RsaPrivateKey.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:45:45 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:50:18 +0100
commitca6ef58b1ee8521e4b940ee4883dee714960e413 (patch)
tree8532add455224b07c07a759e3d906f50c0695888 /src/PolarSSL++/RsaPrivateKey.h
parentMerge pull request #2972 from marvinkopf/PlayerAutoComplete (diff)
downloadcuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip
Diffstat (limited to '')
-rw-r--r--src/PolarSSL++/RsaPrivateKey.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/PolarSSL++/RsaPrivateKey.h b/src/PolarSSL++/RsaPrivateKey.h
index 4d03f27df..32422da8d 100644
--- a/src/PolarSSL++/RsaPrivateKey.h
+++ b/src/PolarSSL++/RsaPrivateKey.h
@@ -20,41 +20,41 @@
class cRsaPrivateKey
{
friend class cSslContext;
-
+
public:
/** Creates a new empty object, the key is not assigned */
cRsaPrivateKey(void);
-
+
/** Deep-copies the key from a_Other */
cRsaPrivateKey(const cRsaPrivateKey & a_Other);
-
+
~cRsaPrivateKey();
-
+
/** Generates a new key within this object, with the specified size in bits.
Returns true on success, false on failure. */
bool Generate(unsigned a_KeySizeBits = 1024);
-
+
/** Returns the public key part encoded in ASN1 DER encoding */
AString GetPubKeyDER(void);
-
+
/** Decrypts 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 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:
/** The PolarSSL key context */
rsa_context m_Rsa;
/** The random generator used for generating the key and encryption / decryption */
cCtrDrbgContext m_CtrDrbg;
-
-
+
+
/** Returns the internal context ptr. Only use in PolarSSL API calls. */
rsa_context * GetInternal(void) { return &m_Rsa; }
} ;