]> www.wagner.pp.ru Git - oss/ctypescrypto.git/commitdiff
Update README. Inherit everything from __builtin__.object
authorVictor Wagner <vitus@wagner.pp.ru>
Sat, 20 Dec 2014 12:14:10 +0000 (15:14 +0300)
committerVictor Wagner <vitus@wagner.pp.ru>
Sat, 20 Dec 2014 12:14:10 +0000 (15:14 +0300)
README.md
ctypescrypto/bio.py
ctypescrypto/cms.py
ctypescrypto/digest.py
ctypescrypto/pkey.py
ctypescrypto/x509.py

index a250102a2732613f727ee2bfe97a0131cb644403..cd91063ec370c97dc1091b5b02152976adb7c377 100644 (file)
--- a/README.md
+++ b/README.md
@@ -11,9 +11,21 @@ most recent version can be checked out from
 
 https://github.com/vbwagner/ctypescrypto.git
 
-It is aimed to provide Python interface to OpenSSL libcrypto functions.
-All the objects in this library are just wrappers around some OpenSSL
-data structures and groups of functions.
+Rationale
+---------
+
+Why have yet another crypto extension for Python? There is pyopenssl,
+m2crypto, hashlib in the standard library and many more.
+
+But most of these extension implement interfaces to particular set of
+cryptoalgorthms. This extension takes an another approach — it uses
+algorithm-agnostic EVP layer whenever possible, and so support any
+algorithms which are supported by underlying library, even this
+algorithms are implemented in the loadable modules (engines). Algorithms
+which you've just added to library, should be supported too.
+
+Also, this extension takes some care of correctly converting textual
+information from ASN.1 structures into unicode.
 
 
 
@@ -56,6 +68,9 @@ sign data, derive shared key and verify signatures.
 This is quite low-level object, which can be used to implement some
 non-standard protocols and operations.
 
+It is possible to extract public key from the certificate as PKey
+object (see below).
+
 Additional module **ctypescrypto.ec** allows to create **PKey** objects
 with elliptic curve keys from just raw secret key as byte buffer or
 python big integer.
@@ -78,7 +93,9 @@ names, public key (of course it is PKey object described above) and
 serial number. Subject and issuer names can be indexed by OIDs or by
 position of field. Unicode in the names is supported.
 
-Support for visualising certificate extensions is missing for now.
+Support for visualising certificate extensions is minimal for now.
+Extension object can be converted into string, extension Oid can be
+retrieved and critical flag is checked.
 
 **StackOfX509** implements collection of certificates, necessary for
 some operations with CMS and certificate verification.
@@ -152,11 +169,10 @@ Test suite is fairly incomplete. Contributions are welcome.
 Possible future enhancements
 ----------------------------
 
-1. Certificate extension support
-2. Create and signing of the certificate requests (PKCS#10)
-3. Parsing and analyzing CRLs
-4. OCSP request creation and response parsing
-5. Timestamping ([RFC 3161](http://www.ietf.org/rfc/rfc3161.txt))
+1. Create and signing of the certificate requests (PKCS#10)
+2. Parsing and analyzing CRLs
+3. OCSP request creation and response parsing
+4. Timestamping ([RFC 3161](http://www.ietf.org/rfc/rfc3161.txt))
 support.
 6. MAC support. Few people know that there is more MACs than just HMAC,
 and even fewer, that OpenSSL supports them.
index ae89aa3bac354b9e934002b3c40e2c1820fec96f..2743f705032ab407e8583c5bfe04c0a89125739b 100644 (file)
@@ -3,7 +3,7 @@ Interface to OpenSSL BIO library
 """
 from ctypescrypto import libcrypto
 from ctypes import c_char_p, c_void_p, c_int, string_at, c_long,POINTER,byref, create_string_buffer
-class Membio:
+class Membio(object):
        """ 
                Provides interface to OpenSSL memory bios 
                use str() or unicode() to get contents of writable bio
index 9213d27b8ff5390ce0aa38881900b8d8a25dd42f..3158b628f087d7ff21f25d7f0fbee57a1d6c4e36 100644 (file)
@@ -68,7 +68,7 @@ def CMS(data,format="PEM"):
        else:
                raise NotImplementedError("cannot handle "+typeoid.shortname())
 
-class CMSBase: 
+class CMSBase(object)
        """
        Common ancessor for all CMS types.
        Implements serializatio/deserialization
index 26b46bd7337e5bbd467a8252ec29514775a5edd9..2963e7034b19eac01bad510ff7ad389e65f0cb1c 100644 (file)
@@ -32,7 +32,7 @@ def new(algname):
        md=DigestType(algname)\r
        return Digest(md)\r
 \r
-class DigestType:\r
+class DigestType(object):\r
        """\r
                \r
                Represents EVP_MD object - constant structure which describes\r
@@ -57,7 +57,7 @@ class DigestType:
        def oid(self):\r
                return Oid(libcrypto.EVP_MD_type(self.digest))\r
 \r
-class Digest:\r
+class Digest(object):\r
        """\r
                Represents EVP_MD_CTX object which actually used to calculate\r
                digests.\r
index 59a53486f9f62e877cf1748fc5e6c83f5f15a063..85b831d96c870a8e140cecf9f88b1ee00890a6f7 100644 (file)
@@ -30,7 +30,7 @@ def password_callback(buf,length,rwflag,u):
 
 _cb=CALLBACK_FUNC(password_callback)
 
-class PKey:
+class PKey(object):
        def __init__(self,ptr=None,privkey=None,pubkey=None,format="PEM",cansign=False,password=None):
                if not ptr is None:
                        self.key=ptr
index 358ce7d81d7d244ca1d44b2dfc34769e2c1e0f9d..af61942adc5f685d1db83c299b2ac033f51bd37d 100644 (file)
@@ -83,7 +83,7 @@ class X509Error(LibCryptoError):
        pass
 
 
-class X509Name:
+class X509Name(object):
        """
        Class which represents X.509 distinguished name - typically 
        a certificate subject name or an issuer name.
@@ -376,7 +376,7 @@ class X509(object):
        def check_ca(self):
                """ Returns True if certificate is CA certificate """
                return libcrypto.X509_check_ca(self.cert)>0
-class X509Store:
+class X509Store(object):
        """
                Represents trusted certificate store. Can be used to lookup CA 
                certificates to verify
@@ -467,7 +467,7 @@ class X509Store:
                else:
                        raise TypeError("datetime.date, datetime.datetime or integer is required as time argument")
                raise NotImplementedError
-class StackOfX509:
+class StackOfX509(object):
        """
        Implements OpenSSL STACK_OF(X509) object.
        It looks much like python container types