pyOpenSSL : install & check on Debian

deb1:~# wget http://downloads.sourceforge.net/pyopenssl/pyOpenSSL-0.7.tar.gz?modtime=1207915982&big_mirror=0
[1] 26585
deb1:~# –17:01:56–  http://downloads.sourceforge.net/pyopenssl/pyOpenSSL-0.7.tar.gz?modtime=1207915982
           => `pyOpenSSL-0.7.tar.gz?modtime=1207915982′
Resolving downloads.sourceforge.net… 216.34.181.60
Connecting to downloads.sourceforge.net|216.34.181.60|:80… connected.
HTTP request sent, awaiting response… 302 Found
Location: http://garr.dl.sourceforge.net/sourceforge/pyopenssl/pyOpenSSL-0.7.tar.gz [following]
–17:02:07–  http://garr.dl.sourceforge.net/sourceforge/pyopenssl/pyOpenSSL-0.7.tar.gz
           => `pyOpenSSL-0.7.tar.gz’
Resolving garr.dl.sourceforge.net… 193.206.140.34
Connecting to garr.dl.sourceforge.net|193.206.140.34|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 189,022 (185K) [application/x-tar]

0% [                                     ] 0             –.–K/s
100%[====================================>] 189,022       18.00K/s    ETA 00:00

17:02:51 (12.40 KB/s) – `pyOpenSSL-0.7.tar.gz’ saved [189022/189022]

[1]+  Done                    wget http://downloads.sourceforge.net/pyopenssl/pyOpenSSL-0.7.tar.gz?modtime=1207915982

 

deb1:~# tar xvfz pyOpenSSL-0.7.tar.gz

deb1:~# cd pyOpenSSL-0.7
deb1:~/pyOpenSSL-0.7# python setup.py build
deb1:~/pyOpenSSL-0.7# python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
creating /usr/lib/python2.4/site-packages/OpenSSL
copying build/lib.linux-i686-2.4/OpenSSL/__init__.py -> /usr/lib/python2.4/site-packages/OpenSSL
copying build/lib.linux-i686-2.4/OpenSSL/tsafe.py -> /usr/lib/python2.4/site-packages/OpenSSL
copying build/lib.linux-i686-2.4/OpenSSL/SSL.so -> /usr/lib/python2.4/site-packages/OpenSSL
creating /usr/lib/python2.4/site-packages/OpenSSL/test
copying build/lib.linux-i686-2.4/OpenSSL/test/__init__.py -> /usr/lib/python2.4/site-packages/OpenSSL/test
copying build/lib.linux-i686-2.4/OpenSSL/test/test_crypto.py -> /usr/lib/python2.4/site-packages/OpenSSL/test
copying build/lib.linux-i686-2.4/OpenSSL/test/test_ssl.py -> /usr/lib/python2.4/site-packages/OpenSSL/test
copying build/lib.linux-i686-2.4/OpenSSL/crypto.so -> /usr/lib/python2.4/site-packages/OpenSSL
copying build/lib.linux-i686-2.4/OpenSSL/rand.so -> /usr/lib/python2.4/site-packages/OpenSSL
copying build/lib.linux-i686-2.4/OpenSSL/version.py -> /usr/lib/python2.4/site-packages/OpenSSL
byte-compiling /usr/lib/python2.4/site-packages/OpenSSL/__init__.py to __init__.pyc
byte-compiling /usr/lib/python2.4/site-packages/OpenSSL/tsafe.py to tsafe.pyc
byte-compiling /usr/lib/python2.4/site-packages/OpenSSL/test/__init__.py to __init__.pyc
byte-compiling /usr/lib/python2.4/site-packages/OpenSSL/test/test_crypto.py to test_crypto.pyc
byte-compiling /usr/lib/python2.4/site-packages/OpenSSL/test/test_ssl.py to test_ssl.pyc
byte-compiling /usr/lib/python2.4/site-packages/OpenSSL/version.py to version.pyc

 

deb1:~/pyOpenSSL-0.7# python
Python 2.4.4 (#2, Apr 15 2008, 23:43:20)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
>>> pem=open('/home/hide/ca_cert.pem').read()
>>> pem
'-----BEGIN CERTIFICATE-----\nMIIG/zCCBOegAwIBAgIDBaBOMA0GCSqGSIb3DQEBBQUAMHkx
  (省略)
nTg==\n-----END CERTIFICATE-----\n\n'
>>> cer=OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,pem)
>>> dir(cer)
['add_extensions', 'digest', 'get_issuer', 'get_notAfter', 'get_notBefore', 
'get_pubkey', 'get_serial_number', 'get_subject', 'get_version', 'gmtime_adj_notAfter'
, 'gmtime_adj_notBefore', 'has_expired', 'set_issuer', 'set_notAfter', 'set_notBefore'
, 'set_pubkey', 'set_serial_number', 'set_subject', 'set_version', 'sign'
, 'subject_name_hash']
>>> cer.get_subject().get_components()
[('CN', '03-nov-03.net')]
>>> cer.get_pubkey().bits()
2048
>>> cer.get_pubkey().type()
6
カテゴリー: 未分類 パーマリンク

pyOpenSSL : install & check on Debian への1件のフィードバック

  1. Unknown より:

    Hi,Do you have used LCD monitors, second hand lcd monitors and second hand flat screens? Please go here:www.sstar-hk.com(Southern Stars).We are constantly buying re-usable LCD panels,LCD recycle.The re-usable panels go through strictly designed process of categorizing, checking, testing, repairing and refurbishing before they are re-used to make remanufactured LCD displays and TV sets.Due to our recent breakthrough in testing and repairing technology of LCD, we can improve the value for your LCD panels.
    website:www.sstar-hk.com[dgfghdfgecgfihi]

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中