mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 01:08:31 +00:00
PEM signing now works...silly double pointergit add -A Test code still needs to be removed
This commit is contained in:
parent
5a150780cf
commit
aaf5c9bb46
8 changed files with 233 additions and 9 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue