Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36967
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | Piet van Oostrum <piet@vanoostrum.org> |
| Newsgroups | comp.lang.python |
| Subject | Re: Loading a PKCS#1 public key using M2Crypto |
| Date | Fri, 18 Jan 2013 00:10:20 +0100 |
| Lines | 20 |
| Message-ID | <m2622vqucj.fsf@cochabamba.vanoostrum.org> (permalink) |
| References | <922c97d0-77cf-4e68-8edc-d65c6d7e7831@googlegroups.com> <m2k3rcr6na.fsf@cochabamba.vanoostrum.org> <m2bocnrcf6.fsf@cochabamba.vanoostrum.org> <58e8a6c7-d512-4f44-b41f-a4f7efacf14f@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| X-Trace | individual.net f7lP36M2dqXucYlxEVHyXAAKjA2sKjnhCTEij6i2P9DT5cyq8pO1d8oUHQ831JZ2oD |
| Cancel-Lock | sha1:8EikY3Q+5vveZhduZhr2bISJqv8= sha1:zQLPLXxscX3sRPDZxiJPodQRkKA= |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (darwin) |
| Xref | csiph.com comp.lang.python:36967 |
Show key headers only | View raw
Marc Aymerich <glicerinu@gmail.com> writes: > Thank you very much Piet, > I'm just starting to grasp these cryptography related concepts and your code is helping me a lot to understand how to handle these keys in a low level. > > I'm updating my code incorporating your new contribution! > > Just to let you know, during my previous research I had found a python-Crypto related solution that also uses DER and ASN.1 [1], but it uses a different approach (I guess). I suspect that this approach is also possible with M2Crypto because it has a method for constructing RSA keys [2]. > > [1] http://stackoverflow.com/a/10574723 > [2] http://www.heikkitoivonen.net/m2crypto/api/M2Crypto.RSA-module.html#new_pub_key > new_pub_key could be used but then you would have to do an ASN.1 parse of the DER format of your key to get the n and e values. AFAICT M2Crypto doesn't have methods to do this, so you would need to use one of the python ASN.1 libraries (or write that part yourself). -- Piet van Oostrum <piet@vanoostrum.org> WWW: http://pietvanoostrum.com/ PGP key: [8DAE142BE17999C4]
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Loading a PKCS#1 public key using M2Crypto Marc Aymerich <glicerinu@gmail.com> - 2013-01-16 11:58 -0800
Re: Loading a PKCS#1 public key using M2Crypto Piet van Oostrum <piet@vanoostrum.org> - 2013-01-17 01:32 +0100
Re: Loading a PKCS#1 public key using M2Crypto Marc Aymerich <glicerinu@gmail.com> - 2013-01-17 01:16 -0800
Re: Loading a PKCS#1 public key using M2Crypto Piet van Oostrum <piet@vanoostrum.org> - 2013-01-17 17:39 +0100
Re: Loading a PKCS#1 public key using M2Crypto Marc Aymerich <glicerinu@gmail.com> - 2013-01-17 09:13 -0800
Re: Loading a PKCS#1 public key using M2Crypto Piet van Oostrum <piet@vanoostrum.org> - 2013-01-18 00:10 +0100
Re: Loading a PKCS#1 public key using M2Crypto Marc Aymerich <glicerinu@gmail.com> - 2013-01-18 10:13 +0100
csiph-web