summaryrefslogtreecommitdiffstats
path: root/src/PolarSSL++/CryptoKey.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-30 16:00:06 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2017-08-30 16:00:06 +0200
commit84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7 (patch)
treeaa1648c2ba260b8576673677435481d371eec7b0 /src/PolarSSL++/CryptoKey.h
parentUpdate core plugins to latest version (#3951) (diff)
downloadcuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.gz
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.bz2
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.lz
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.xz
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.tar.zst
cuberite-84941bcc9f25cbe3fd3b2604080d0a1cfd8fbaa7.zip
Diffstat (limited to '')
-rw-r--r--src/mbedTLS++/CryptoKey.h (renamed from src/PolarSSL++/CryptoKey.h)20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/PolarSSL++/CryptoKey.h b/src/mbedTLS++/CryptoKey.h
index db15cefb4..1a74090ac 100644
--- a/src/PolarSSL++/CryptoKey.h
+++ b/src/mbedTLS++/CryptoKey.h
@@ -1,7 +1,7 @@
-
+
// CryptoKey.h
-// Declares the cCryptoKey class representing a RSA public key in PolarSSL
+// Declares the cCryptoKey class representing a RSA public key in mbedTLS
@@ -10,7 +10,7 @@
#pragma once
#include "CtrDrbgContext.h"
-#include "polarssl/pk.h"
+#include "mbedtls/pk.h"
@@ -18,7 +18,7 @@
class cCryptoKey
{
- friend class cSslContext;
+ friend class cSslConfig;
public:
/** Constructs an empty key instance. Before use, it needs to be filled by ParsePublic() or ParsePrivate() */
@@ -45,28 +45,28 @@ public:
/** Parses the specified data into a public key representation.
The key can be DER- or PEM-encoded.
- Returns 0 on success, PolarSSL error code on failure. */
+ Returns 0 on success, mbedTLS error code on failure. */
int ParsePublic(const void * a_Data, size_t a_NumBytes);
/** Parses the specified data into a private key representation.
If a_Password is empty, no password is assumed.
The key can be DER- or PEM-encoded.
- Returns 0 on success, PolarSSL error code on failure. */
+ Returns 0 on success, mbedTLS error code on failure. */
int ParsePrivate(const void * a_Data, size_t a_NumBytes, const AString & a_Password);
/** Returns true if the contained key is valid. */
bool IsValid(void) const;
protected:
- /** The PolarSSL representation of the key data */
- pk_context m_Pk;
+ /** The mbedTLS representation of the key data */
+ mbedtls_pk_context m_Pk;
/** The random generator used in encryption and decryption */
cCtrDrbgContext m_CtrDrbg;
- /** Returns the internal context ptr. Only use in PolarSSL API calls. */
- pk_context * GetInternal(void) { return &m_Pk; }
+ /** Returns the internal context ptr. Only use in mbedTLS API calls. */
+ mbedtls_pk_context * GetInternal(void) { return &m_Pk; }
} ;
typedef std::shared_ptr<cCryptoKey> cCryptoKeyPtr;