Re: [openssl-users] reading DER format public keys

2017-09-15 Thread Viktor Dukhovni
> On Sep 15, 2017, at 6:24 PM, Michael Richardson wrote: > >> It is the DER analogue of PEM_read_bio_PUBKEY. With few exceptions, >> you can s/PEM_READ_bio/d2i/ to go from reading PEM to reading DER. > > It would be great if there were cross-references... I should note

Re: [openssl-users] reading DER format public keys

2017-09-15 Thread Michael Richardson
Viktor Dukhovni wrote: > On Fri, Sep 15, 2017 at 11:57:17AM -0400, Michael Richardson wrote: >> pkey = PEM_read_bio_PUBKEY(bio, NULL, ossl_pem_passwd_cb, (void *)pass); >> There must be a way to read DER format public keys. >> I'm suspecting that

Re: [openssl-users] reading DER format public keys

2017-09-15 Thread Viktor Dukhovni
On Fri, Sep 15, 2017 at 11:57:17AM -0400, Michael Richardson wrote: > pkey = PEM_read_bio_PUBKEY(bio, NULL, ossl_pem_passwd_cb, (void *)pass); > There must be a way to read DER format public keys. > I'm suspecting that maybe the magic is in the way the BIO is created? > (FAQ question PROG03,

Re: [openssl-users] reading DER format public keys

2017-09-15 Thread Robert Moskowitz
On 09/15/2017 11:57 AM, Michael Richardson wrote: The PEM_* routines, as documented at: https://www.openssl.org/docs/man1.0.2/crypto/PEM_read_bio_PUBKEY.html do not claim to read DER format input. (Actually they don't say anything about DER). Ruby's library uses: pkey =

Re: [openssl-users] reading DER format public keys

2017-09-15 Thread Salz, Rich via openssl-users
➢ pkey = PEM_read_bio_PUBKEY(bio, NULL, ossl_pem_passwd_cb, (void *)pass); That only reads PEM files. If docs say otherwise, they are wrong. ➢ There must be a way to read DER format public keys. A raw public key? Or a cert? Or a pkcs object? Anyhow, doc/man3/d2i_X509.pod in master.

[openssl-users] reading DER format public keys

2017-09-15 Thread Michael Richardson
The PEM_* routines, as documented at: https://www.openssl.org/docs/man1.0.2/crypto/PEM_read_bio_PUBKEY.html do not claim to read DER format input. (Actually they don't say anything about DER). Ruby's library uses: pkey = PEM_read_bio_PUBKEY(bio, NULL, ossl_pem_passwd_cb, (void *)pass);