Re: Reading .pem files for secured

2019-06-06 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Thursday, 6 June 2019 at 11:08:18 UTC, Dukc wrote: We were both wrong :-). It turned out that the correct way to initialize a SecureD RSA private key is to feed contents of .pem in without ANY processing. Ah, they made it even easier :)

Re: Reading .pem files for secured

2019-06-06 Thread Dukc via Digitalmars-d-learn
On Friday, 31 May 2019 at 12:17:14 UTC, Sebastiaan Koppe wrote: On Friday, 31 May 2019 at 10:35:46 UTC, Dukc wrote: 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[]

Re: Reading .pem files for secured

2019-06-03 Thread Dukc via Digitalmars-d-learn
On Friday, 31 May 2019 at 10:35:46 UTC, Dukc wrote: if I understand the logic of Base64, it's that each character stores 6 bits. My private key .pem has 49 lines of 64 characters worth of Base64, though the sat line isn't full. Anyway, this is data worth of over 18000 bits. The RSA key is

Re: Reading .pem files for secured

2019-06-02 Thread Dukc via Digitalmars-d-learn
On Friday, 31 May 2019 at 12:17:14 UTC, Sebastiaan Koppe wrote: Just base64 decode the PEM data (without the ) and feed it to RSA.this(ubyte[] publicKey). Ought to be that simple. I assume the same should apply with private key and private key constructor (along with a random password of

Re: Reading .pem files for secured

2019-06-02 Thread Dukc via Digitalmars-d-learn
On Friday, 31 May 2019 at 12:17:14 UTC, Sebastiaan Koppe wrote: Just base64 decode the PEM data (without the ) and feed it to RSA.this(ubyte[] publicKey). Ought to be that simple. That's logic of SSL? Okay, I'll try that first.

Re: Reading .pem files for secured

2019-05-31 Thread Sebastiaan Koppe via Digitalmars-d-learn
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

Re: Reading .pem files for secured

2019-05-31 Thread KnightMare via Digitalmars-d-learn
https://lapo.it/asn1js but dont insert ur certificate there, generate new one for tests

Re: Reading .pem files for secured

2019-05-31 Thread Dukc via Digitalmars-d-learn
On Friday, 31 May 2019 at 11:09:07 UTC, KnightMare wrote: The reason is that if I understand the logic of Base64, it's that each character stores 6 bits. My private key .pem has 49 lines of 64 characters worth of Base64, though the sat line isn't full. Anyway, this is data worth of over 18000

Re: Reading .pem files for secured

2019-05-31 Thread KnightMare via Digitalmars-d-learn
The reason is that if I understand the logic of Base64, it's that each character stores 6 bits. My private key .pem has 49 lines of 64 characters worth of Base64, though the sat line isn't full. Anyway, this is data worth of over 18000 bits. The RSA key is supposed to be 4096 bits, so this

Reading .pem files for secured

2019-05-31 Thread Dukc via Digitalmars-d-learn
I need to manually sign and verify stuff with asymmetric crypto keys. I ended up using rsa from secured. 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.