The OpenSSL format is common but woefully underspecified. The OpenSSL API 
supports DER, but afaict no one ever actually uses that. Non-OpenSSL 
applications generally prefer PKCS 8 but some of the also support this 
style of serialisation too. Basically what you are smelling is that this 
format is terrible but also everywhere.


On 31 March 2014 21:31:06 Glyph <notifications@github.com> wrote:

> > +
> > +.. currentmodule:: cryptography.hazmat.primitives.serialization
> > +
> > +There are several common schemes for serializing asymmetric private and 
> public
> > +keys to bytes. They generally support encryption of private keys and 
> additional
> > +key metadata.
> > +
> > +
> > +.. class:: OpenSSLPrivateKey(private_key)
> > +
> > +    .. versionadded:: 0.4
> > +
> > +    The "traditional" PKCS #1 based serialization format used by OpenSSL.
> > +    It supports password based symmetric key encryption.  Commonly found in
> > +    OpenSSL based TLS applications. It is usually found in PEM format with a
> > +    header like ``-----BEGIN RSA PRIVATE KEY-----``.
>
> This is really a nitpick, but words like "commonly" and "usually" are a 
> (mild) documentation smell to me.  What kind of OpenSSL based TLS 
> application would one not find such a thing in?  If "it" (fewer pronouns 
> would also be better, as would a subject for the sentence fragment 
> "Commonly found…") is "usually" found in PEM format, where else might it be 
> found?  Also, if the only method is called `load_pem`, then presumably it 
> is *always* found in PEM format, although other comments on this PR suggest 
> to me that in fact it supports DER format in some way too (or was that just 
> referring to the underlying API?)
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/pyca/cryptography/pull/627/files#r11135165