Commit graph

6 commits

Author SHA1 Message Date
Legrandin
791cfaa255 Add support for import/export of DSA keys
This patch adds methods importKey() to DSA module
and exportKey() to _DSAobj object.

Public and private keys can be imported/exported
in a variety of formats:

* DER vs PEM
* PKCS#8 vs OpenSSL vs OpenSSH/OpenSSL
* Encrypted vs clear
2013-07-14 21:16:46 -07:00
Legrandin
79ca3544e9 Add ElGamal tests to the test suite. 2012-04-27 00:49:35 +02:00
Dwayne C. Litzenberger
094d70b64d Python 3.x fixes:
- Use absolute imports
- Fix StringIO import so that 2to3 can translate it
2011-10-22 15:07:47 -04:00
Legrandin
0f45878cef Add ability to export and import RSA keys in DER and PEM format.
Typical usage for importing an RSA key:

f = file("ssl.pem")
key = RSA.importKey(f.read())
f.close()
key.verify(hash, signature)

Typical usage for exporting an RSA public key:

key = RSA.generate(512, randfunc)
f = file("ssl.der","w")
f.write(key.publickey.exportKey('DER'))
f.close()

I confirm I am eligible for submitting code to pycrypto according
to http://www.dlitz.net/software/pycrypto/submission-requirements/
fetched on 27 December 2009.

Committer: Legrandin <gooksankoo@hoiptorrow.mailexpire.com>
2010-08-02 16:34:13 -04:00
Dwayne C. Litzenberger
386de1947b Legal: Dedicate my files to the public domain.
In an attempt to simplify the copyright status of PyCrypto, I'm placing my
code into the public domain, and encouraging other contributors to do the
same.

I have used a public domain dedication that was recommended in a book on FOSS legal
issues[1], followed by the warranty disclaimer boilerplate from the MIT license.

[1] _Intellectual Property and Open Source: A Practical Guide to Protecting
    Code_, a book written by Van Lindberg and published by O'Reilly Media.
    (ISBN 978-0-596-51796-0)
2009-03-01 10:22:51 -05:00
Dwayne C. Litzenberger
ff8a657a8d cleanup: Move modules to "lib/Crypto" subdirectory.
This will avoid the previous situation where scripts like the old "test.py"
get included accidentally in a release.  It also frees us to put additional
build scripts in the top-level directory of the source tree.
2009-02-28 13:14:53 -05:00
Renamed from SelfTest/PublicKey/__init__.py (Browse further)