mirror of
https://github.com/arun11299/cpp-jwt.git
synced 2025-05-15 01:08:31 +00:00
PEM verification code added
This commit is contained in:
parent
f8947b53ac
commit
5a150780cf
3 changed files with 118 additions and 24 deletions
|
@ -483,6 +483,31 @@ private:
|
|||
/*!
|
||||
*/
|
||||
static std::string public_key_ser(EVP_PKEY* pkey, string_view sign, std::error_code& ec);
|
||||
|
||||
//ATTN: Below 2 functions
|
||||
//are Taken from https://github.com/nginnever/zogminer/issues/39
|
||||
|
||||
/**
|
||||
*/
|
||||
static void ECDSA_SIG_get0(const ECDSA_SIG* sig, const BIGNUM** pr, const BIGNUM** ps)
|
||||
{
|
||||
if (pr != nullptr) *pr = sig->r;
|
||||
if (ps != nullptr) *ps = sig->s;
|
||||
};
|
||||
|
||||
/**
|
||||
*/
|
||||
static int ECDSA_SIG_set0(ECDSA_SIG* sig, BIGNUM* r, BIGNUM* s)
|
||||
{
|
||||
if (r == nullptr || s == nullptr) return 0;
|
||||
|
||||
BN_clear_free(sig->r);
|
||||
BN_clear_free(sig->s);
|
||||
|
||||
sig->r = r;
|
||||
sig->s = s;
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
} // END namespace jwt
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue