Skip to content

Reading a binary RSA key from memory? #460

Answered by lsh123
elseifthen asked this question in Q&A
Discussion options

You must be logged in to vote

First, this functionality is crypto library specific. If you are using default OpenSSL, then multiple RSA key formats are supported -- PEM, DER, ...:

xmlSecOpenSSLAppKeyLoadBIO(BIO* bio, xmlSecKeyDataFormat format,

Note that RSA key has multiple components while AES/DES keys have only one. Thus, you need to know how these components are stored in memory to correctly read the key.

You can also use something like xmlSecOpenSSLEvpKeyDataAdoptEvp() function to use an RSA key stored in OpenSSL EVP key which can be initialized / loaded using any relevant OpenSSL functions (e.g. EVP key can be on a hardware device).

Aleksey

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lsh123
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants