On Mon, Apr 6, 2020, 11:59 PM Jason Proctor <jason@xxxxxxxxxxxxxxx> wrote:
On Mon, Apr 6, 2020 at 9:44 PM William Roberts <bill.c.roberts@xxxxxxxxx> wrote:
>
>
> There's setter functions now. See:
> https://www.openssl.org/docs/man1.1.0/man3/RSA_set0_key.html
Thanks, yes it does look like that replaces direct access to "n" and
"e". It's a hack, but it might work for the moment.
Ideally though I wouldn't be reliant on offsets into the binary SPKI
structure :-)
I don't think I would consider it a hack necessarily. I work on the TPM stack and have to convert TPM structures to RSA public key structures for ooenssl to utilize, and we use this routine along the way. I would imagine theirs a higher level public from private routine you can call. I would dissect what:
openssl rsa -in mykey.pem -pubout > mykey.pub
Is doing
any help with SPKI welcome!
J