IdPs like Okta are providing public key and exponent in this format.
"n":"sNwO2gzGvmmQH8BKFa--JbsaQrEY7hg9YrJ3lqs_t36cd6EJInE3W0EbmdAHWbZC4-AeMS73BZQsaJqa2UvqWfUTwpVrEVlPOHc0_Tc4VTqLsmuoPaByYOgz5hn3Z_0gYfPq8eGIYuh6QLvKkuYdAWr5yMK0xDof2eFmQ-BoSMjiB4id_c2BjX_TlqxHCDoXtwCD-51R2ZFTNP9PW2ivunDmAD4RCuLjHxnjiB-GmJFGX0KwTp71Ppyd8MYcUFi_ExxOFDWtOqyPzBhWVX0NmxvvujTAUdTa90u29UE0g59W1tbhKQH8LzakWlpaopkqhfDZxeKCo9dDrYhw5NQ1ow"
"e":"AQAB"
Can someone tell me how do I decode the exponent 'AQAB' programmatically to a valid value which can be given as input to RSA structure in C/C++ language? I know AQAB decodes to 010001 in hex but I am looking for a sample in c/c++ sample to do that.
After that I can do:
RSA* rsa = RSA_new();
rsa->e = e;
rsa->n = n;
char* lPublic = BIO_new(BIO_s_mem());
PEM_write_bio_RSAPublicKey(lPublic, rsa);