PEM signing now works...silly double pointergit add -A Test code still needs to be removed

This commit is contained in:
Arun M 2017-11-25 22:44:16 +05:30
parent 5a150780cf
commit aaf5c9bb46
8 changed files with 233 additions and 9 deletions

View file

@ -451,6 +451,11 @@ public:
{
std::error_code ec{};
char* out;
unsigned int l;
std::string ii{data.data(), data.length()};
libjwt_sign(&out, &l, ii.c_str(), key.data(), key.length());
EC_PKEY_uptr pkey{load_key(key, ec), ev_pkey_deletor};
if (ec) return { std::string{}, ec };
@ -472,6 +477,9 @@ public:
verify(const string_view key, const string_view head, const string_view sign);
private:
static void libjwt_sign(char** out, unsigned int *len, const char* str, const char* key, size_t klen);
/*!
*/
static EVP_PKEY* load_key(const string_view key, std::error_code& ec);