Possible to add decoder for openssh key format.
Stef Bon <[email protected]> Thu, 4 Jun 2026 00:11:22 -0700 (PDT)
| Newsgroups | gmane.comp.encryption.openssl.user |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_39450_279150460.1780557082940 Content-Type: multipart/alternative; boundary="----=_Part_39451_1315366952.1780557082940" ------=_Part_39451_1315366952.1780557082940 Content-Type: text/plain; charset="UTF-8" Hi, I've written code to decode the openssh_key format. It detects the header, and if its "-----BEGIN OPENSSH PRIVATE KEY-----", it reads the data between header and footer and start processing that. If this header is not found, it calls OSSL_DECODER_CTX_new_for_pkey(&spk, "PEM", NULL, NULL, EVP_PKEY_KEYPAIR, NULL, NULL) and OSSL_DECODER_from_bio. It works, different files of different schemes are read succesfully. Is it possible to add a decoder (a custom decoder) to read the openssh key format, so I do not have to open the file using an fd, check for the openssh header, if not found open it using BIO. I've read about OSSL_DECODER_CTX_add_decoder, but I need an example here. Thanks, Stef -- You received this message because you are subscribed to the Google Groups "openssl-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to openssl-users+unsubscribe-MCmKBN63+Bmbup2nOX2J7Q@public.gmane.org To view this discussion visit https://groups.google.com/a/openssl.org/d/msgid/openssl-users/d1323156-1e30-47d3-8e9e-41b635fc13d7n%40openssl.org. ------=_Part_39451_1315366952.1780557082940 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div>Hi,</div><div><br /></div><div>I've written code to decode the openssh= _key format. It detects the header, and if its</div><div>"-----BEGIN OPENSS= H PRIVATE KEY-----", it reads the data between header and footer and start = processing that. If this header is not found, it calls OSSL_DECODER_CTX_new= _for_pkey(&spk, "PEM", NULL, NULL, EVP_PKEY_KEYPAIR, NULL, NULL) and OS= SL_DECODER_from_bio.</div><div><br /></div><div>It works, different files o= f different schemes are read succesfully.</div><div><br /></div><div>Is it = possible to add a decoder (a custom decoder) to read the openssh key format= , so I do not have to open the file using an fd, check for the openssh head= er, if not found open it using BIO. I've read about=C2=A0<span><span>OSSL_D= ECODER_CTX_add_decoder, but I need an example here.</span></span></div><div= ><br /></div><div>Thanks,</div><div>Stef</div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;openssl-users" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:openssl-users+unsubscribe-MCmKBN63+BlAfugRpC6u6w@public.gmane.org">openssl-us= [email protected]</a>.<br /> To view this discussion visit <a href=3D"https://groups.google.com/a/openss= l.org/d/msgid/openssl-users/d1323156-1e30-47d3-8e9e-41b635fc13d7n%40openssl= .org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/a/op= enssl.org/d/msgid/openssl-users/d1323156-1e30-47d3-8e9e-41b635fc13d7n%40ope= nssl.org</a>.<br /> ------=_Part_39451_1315366952.1780557082940-- ------=_Part_39450_279150460.1780557082940--