Add dump_publickey as a complement for dump_privatekey

Bug #780089 reported by Adi Roiban on 2011-05-09
This bug affects 4 people
Affects Status Importance Assigned to Milestone

Bug Description

The pyOpenSSL API already has a crypto.dump_privatekey .

It would be nice to also have a dump_publickey method.

I will attach a branch with an initial implementation of this method (only PEM format).

If this change is wanted, I can improve the branch.


Related branches

Changed in pyopenssl:
milestone: none → 0.13
status: New → Confirmed
Adi Roiban (adiroiban) wrote :


Do you have any comments about how you would like to bug solved?

I reported this bug while I was looking for a way to generate SSH public and private keys from Python without external calls to openssh-keygen or openssl.

My first stop was pyOpenSSL since I knew that OpenSSH is using openssl.

Later I found the code from twisted.conch.ssh.key and used the Key class to generate my public and private keys in the OpenSSH format.

I am willing to continue implementing the crypto.dump_privatekey API, but after learning more about pyOpenSSL I was thinking that it would be better to export the key elements in PKey and the dump_privakekey could use them to dump the key in various formats.

Jean-Paul Calderone (exarkun) wrote :

I think adding a dump_publickey API is fine. None of these APIs is what I'd call ideal. Instead they're simple to implement and maintain without adding too much extra functionality on top of OpenSSL.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers