X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=ctypescrypto%2Fpkey.py;h=10366ee0b318e1947b4448a1be4f9419884af5b3;hb=766de77591d848bb229ec25ab6b19fb902ee7971;hp=a561ddf23df08bbb7daea0e777ffe00c690b9595;hpb=2f721f8751a08e35ae3a8a63dd53e2d9ab216c47;p=oss%2Fctypescrypto.git diff --git a/ctypescrypto/pkey.py b/ctypescrypto/pkey.py index a561ddf..10366ee 100644 --- a/ctypescrypto/pkey.py +++ b/ctypescrypto/pkey.py @@ -1,3 +1,10 @@ +""" +This module provides interface for low-level private/public keypair operation + +PKey object of this module is wrapper around OpenSSL EVP_PKEY object. +""" + + from ctypes import c_char_p,c_void_p,byref,c_int,c_long, c_longlong, create_string_buffer,CFUNCTYPE,POINTER from ctypescrypto import libcrypto from ctypescrypto.exception import LibCryptoError,clear_err_stack @@ -8,6 +15,11 @@ class PKeyError(LibCryptoError): CALLBACK_FUNC=CFUNCTYPE(c_int,c_char_p,c_int,c_int,c_char_p) def password_callback(buf,length,rwflag,u): + """ + Example password callback for private key. Assumes that + password is store in the userdata parameter, so allows to pass password + from constructor arguments to the libcrypto keyloading functions + """ cnt=len(u) if length