PEM verification code added

This commit is contained in:
Arun M 2017-11-24 19:59:13 +05:30
parent f8947b53ac
commit 5a150780cf
3 changed files with 118 additions and 24 deletions

View file

@ -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