From flyaflyaa at GMAIL.COM Sun Mar 1 01:11:58 2009 From: flyaflyaa at GMAIL.COM (flya flya) Date: Sun, 1 Mar 2009 08:11:58 +0800 Subject: [PYTHON-CRYPTO] How to get exponent from a PKey object? In-Reply-To: <49A7E540.2050900@kiilerich.com> References: <5916e1f60902270437n6ef9be85sb8716df2045fd486@mail.gmail.com> <49A7E540.2050900@kiilerich.com> Message-ID: <5916e1f60902281611l119bb4atec8e0441fe8bc945@mail.gmail.com> very thanks, pk.get_rsa().pub() can get a tuple with E and N, I tried this function, in ubuntu 8.10, the program crashed, In windows, it works, maybe there's a bug in ubuntu version, but no matter, my program will just on windows. On Fri, Feb 27, 2009 at 9:06 PM, Mads Kiilerich wrote: > flya flya wrote: >> >> I need read the public key from ?certificate, I can get a PKey object >> use follow codes: >> ? ?from M2Crypto import X509 >> ? ?cer = X509.load_cert('test.pem', X509.FORMAT_PEM) >> ? ?pk = cer.get_pubkey() >> and use pk.get_modulus() to get the modulus, but how can I get exponent? >> I need these ?two values to make a new public key struct , and use it >> as a param to call a function from a dll file using ctypes. I found E >> is often 65537, but I ask a university teacher, he say it can be any >> value, so how can I get it? >> > > When I looked at it briefly some time ago I concluded that > pk.get_rsa().pub() was the best option. The prefixes there doesn't look like > anything I have seen before, but adding and removing them is an easy and > ugly hack. > > (The question is slightly similar to > http://article.gmane.org/gmane.comp.python.cryptography/524 - and the answer > might be the same ;-) ) > > /Mads > > > -- http://www.flyaflya.com From info at EGENIX.COM Mon Mar 16 23:41:19 2009 From: info at EGENIX.COM (eGenix Team: M.-A. Lemburg) Date: Mon, 16 Mar 2009 23:41:19 +0100 Subject: [PYTHON-CRYPTO] ANN: eGenix pyOpenSSL Distribution 0.8.1-0.9.8j-1 Message-ID: <49BED58F.8010507@egenix.com> ________________________________________________________________________ ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.8.1-0.9.8j-1 An easy to install and use repackaged distribution of the pyOpenSSL Python interface for OpenSSL - available on Windows and Unix platforms This announcement is also available on our web-site for online reading: http://www.egenix.com/company/news/eGenix-pyOpenSSL-Distribution-0.8.1-0.9.8j-1-GA.html ________________________________________________________________________ INTRODUCTION The eGenix.com pyOpenSSL Distribution includes everything you need to get started with SSL in Python. It comes with an easy to use installer that includes the most recent OpenSSL library versions in pre-compiled form. pyOpenSSL is an open-source Python add-on (http://pyopenssl.sf.net/) that allows writing SSL aware networking applications as well as certificate management tools. OpenSSL is an open-source implementation of the SSL protocol (http://www.openssl.org/). For more information, please see the product page: http://www.egenix.com/products/python/pyOpenSSL/ ________________________________________________________________________ NEWS This new release of the eGenix.com pyOpenSSL Distribution fixes a serious problem in pyOpenSSL 0.8 related to threaded applications. The problem causes invalid thread states in the Python interpreter which then result in random core dumps and seg faults. The patch was provided by Maxim Sobolev on SourceForge: http://sourceforge.net/tracker/index.php?func=detail&aid=2543118&group_id=31249&atid=401760 Note that this patch has not yet been integrated into upstream pyOpenSSL. We have also fixed several compiler warnings found in the code. The version of pyOpenSSL you find in the source release has those patches applied. Binaries are available for Linux x86 and x64 as well as Windows x86 and include pyOpenSSL as well as the OpenSSL libraries. For Plone users and friends of buildout scripts, we have added pre-built binaries for Windows. They install just like the Linux versions and allow easy integration of the archives into buildout scripts. ________________________________________________________________________ DOWNLOADS The download archives and instructions for installing the package can be found at: http://www.egenix.com/products/python/pyOpenSSL/ ________________________________________________________________________ UPGRADING Before installing this version of pyOpenSSL, please make sure that you uninstall any previously installed pyOpenSSL version. Otherwise, you could end up not using the included OpenSSL libs. _______________________________________________________________________ SUPPORT Commercial support for these packages is available from eGenix.com. Please see http://www.egenix.com/services/support/ for details about our support offerings. Enjoy, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Mar 16 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From info at EGENIX.COM Wed Mar 18 15:35:52 2009 From: info at EGENIX.COM (eGenix Team: M.-A. Lemburg) Date: Wed, 18 Mar 2009 15:35:52 +0100 Subject: [PYTHON-CRYPTO] ANN: eGenix pyOpenSSL Distribution 0.8.1-0.9.8j now also for Mac OS X Message-ID: <49C106C8.70300@egenix.com> ________________________________________________________________________ ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.8.1-0.9.8j An easy to install and use repackaged distribution of the pyOpenSSL Python interface for OpenSSL - available on Windows, Mac OS X and Unix platforms This announcement is also available on our web-site for online reading: http://www.egenix.com/company/news/eGenix-pyOpenSSL-Distribution-0.8.1-0.9.8j-1-GA.html ________________________________________________________________________ INTRODUCTION The eGenix.com pyOpenSSL Distribution includes everything you need to get started with SSL in Python. It comes with an easy to use installer that includes the most recent OpenSSL library versions in pre-compiled form. pyOpenSSL is an open-source Python add-on (http://pyopenssl.sf.net/) that allows writing SSL aware networking applications as well as certificate management tools. OpenSSL is an open-source implementation of the SSL protocol (http://www.openssl.org/). For more information, please see the product page: http://www.egenix.com/products/python/pyOpenSSL/ ________________________________________________________________________ NEWS This new release of the eGenix.com pyOpenSSL Distribution fixes a serious problem in pyOpenSSL 0.8 related to threaded applications. The problem causes invalid thread states in the Python interpreter which then result in random core dumps and seg faults. The patch was provided by Maxim Sobolev on SourceForge: http://sourceforge.net/tracker/index.php?func=detail&aid=2543118&group_id=31249&atid=401760 Note that this patch has not yet been integrated into upstream pyOpenSSL. We have also fixed several compiler warnings found in the code. The version of pyOpenSSL you find in the source release has those patches applied. Binaries are available for Linux x86 and x64 as well as Windows x86 and Mac OS X PPC/Intel. They include pyOpenSSL and the necessary OpenSSL libraries. For Plone users and friends of buildout scripts, we have added pre-built binaries for Windows. They install just like the Linux versions and allow easy integration of the archives into buildout scripts. ________________________________________________________________________ DOWNLOADS The download archives and instructions for installing the package can be found at: http://www.egenix.com/products/python/pyOpenSSL/ ________________________________________________________________________ UPGRADING Before installing this version of pyOpenSSL, please make sure that you uninstall any previously installed pyOpenSSL version. Otherwise, you could end up not using the included OpenSSL libs. _______________________________________________________________________ SUPPORT Commercial support for these packages is available from eGenix.com. Please see http://www.egenix.com/services/support/ for details about our support offerings. Enjoy, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Mar 18 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From shramov at MEXMAT.NET Tue Mar 24 13:54:42 2009 From: shramov at MEXMAT.NET (Pavel Shramov) Date: Tue, 24 Mar 2009 15:54:42 +0300 Subject: [PYTHON-CRYPTO] Add ANS1_UTCTIME.get_datetime function Message-ID: <20090324125442.GA6465@grid.pp.ru> OpenSSL ASN1_UTCTIME_print (and other time printing functions) produce output not suitable for parsing with strptime: * Month name are not locale-dependant so python strptime fail to recognize them (e.g. in gtk applications) * Timezone is either missing or ' GMT' (with space) Proposed patch adds get_datetime function that returns python datetime.datetime structure with correct timezone. If this function looks suitable I'll add tests. Pavel P.S. Error messages are not perfect so they must be changed. -------------- next part -------------- A non-text attachment was scrubbed... Name: get_datetime.patch Type: text/x-diff Size: 2103 bytes Desc: not available URL: From hjtoi at COMCAST.NET Tue Mar 24 16:54:08 2009 From: hjtoi at COMCAST.NET (Heikki Toivonen) Date: Tue, 24 Mar 2009 08:54:08 -0700 Subject: [PYTHON-CRYPTO] Add ANS1_UTCTIME.get_datetime function In-Reply-To: <20090324125442.GA6465@grid.pp.ru> References: <20090324125442.GA6465@grid.pp.ru> Message-ID: <49C90220.9030300@comcast.net> Pavel Shramov wrote: > Proposed patch adds get_datetime function that returns python > datetime.datetime structure with correct timezone. If this function > looks suitable I'll add tests. Yes, I'd welcome such a change. With tests of course :) For symmetry, could you also add set_datetime method? Make a bugzilla bug and attach the patch there, so I can find it in my review queue. Thanks, -- Heikki Toivonen - http://heikkitoivonen.net From shramov at MEXMAT.NET Tue Mar 24 19:54:03 2009 From: shramov at MEXMAT.NET (Pavel Shramov) Date: Tue, 24 Mar 2009 21:54:03 +0300 Subject: [PYTHON-CRYPTO] Add ANS1_UTCTIME.get_datetime function In-Reply-To: <49C90220.9030300@comcast.net> References: <20090324125442.GA6465@grid.pp.ru> <49C90220.9030300@comcast.net> Message-ID: <20090324185403.GA1335@grid.pp.ru> On Tue, Mar 24, 2009 at 08:54:08AM -0700, Heikki Toivonen wrote: > Yes, I'd welcome such a change. With tests of course :) Tests added :) > For symmetry, could you also add set_datetime method? Done. > Make a bugzilla bug and attach the patch there, so I can find it in my > review queue. Created bug 12762 [1] Pavel -- [1] https://bugzilla.osafoundation.org/show_bug.cgi?id=12762