[Cryptography-dev] openssl command one that needs a pyca/cryptography rewrite

Paul Kehrer paul.l.kehrer at gmail.com
Mon Aug 2 18:10:01 EDT 2021


Hi Dan,

This mailing list doesn't have a great deal of active members who help
with questions like this in general, but I'll try to help out.

For this one you're just reading a password protected private key and
outputting a (still not PKCS8) private key without a password. The
standard load_pem_private_key method (and public_bytes for
serialization) will do this.

-Paul

On Mon, Aug 2, 2021 at 12:46 PM Dan Stromberg <dstromberglists at gmail.com> wrote:
>
>
> So the first command looks like this:
> ['openssl', 'rsa', '-passin', 'pass:{0}'.format(record.password)]
>
> It's just accepting the following on stdin, formatted like:
> -----BEGIN RSA PRIVATE KEY-----
> ...
> -----END RSA PRIVATE KEY-----
>
> ...and outputting something that'll later be passed to ssh-keygen -i -f -mPKCS8.
>
> Is there a pyca/cryptography equivalent?
>
> Thanks!
>
> PS: I should've mentioned previously: I'm a bit of a cryptography newb.
>
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev at python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev


More information about the Cryptography-dev mailing list