On Friday, 31 May 2019 at 10:35:46 UTC, Dukc wrote:
The key pair needs to be persistant between, so I made a 4096-bit private key with OpenSSL, stored in .pem file. Then I constructed a public key from the private one, again with OpenSSL. It seemed strange to me that I could generate a public key afterwards with the private key, instead of having to do both at the same time. I just thought that perhaps crypto is somehow cryptic enough to do that.

The public key can always be constructed from the private key.

But then came a problem that I need to feed the key from .pem to initialize RSA class.

Just base64 decode the PEM data (without the ====) and feed it to RSA.this(ubyte[] publicKey). Ought to be that simple.

Disclaimer: I have only used openssl directly. No experience with SecureD.

Reply via email to