Package M2Crypto :: Module DSA
[frames] | no frames]

Module DSA



M2Crypto wrapper for OpenSSL DSA API.

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.

Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved.

Classes
  DSAError
  DSA
This class is a context supporting DSA key and parameter values, signing and verifying.
  DSA_pub
This class is a DSA context that only supports a public key and verification.
Functions
DSA
gen_params(bits, callback=<function genparam_callback at 0x83b2994>)
Factory function that generates DSA parameters and instantiates a DSA object from the output.
DSA
set_params(p, q, g)
Factory function that instantiates a DSA object with DSA parameters.
DSA
load_params(file, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a DSA object with DSA parameters from a file.
DSA
load_params_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a DSA object with DSA parameters from a M2Crypto.BIO object.
DSA
load_key(file, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a DSA object from a PEM encoded DSA key pair.
DSA
load_key_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a DSA object from a PEM encoded DSA key pair.
DSA_pub
load_pub_key(file, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM file.
DSA_pub
load_pub_key_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM format.
Function Details

gen_params(bits, callback=<function genparam_callback at 0x83b2994>)

 

Factory function that generates DSA parameters and instantiates a DSA object from the output.

Parameters:
  • bits (int) - The length of the prime to be generated. If 'bits' < 512, it is set to 512.
  • callback (function) - A Python callback object that will be invoked during parameter generation; it usual purpose is to provide visual feedback.
Returns: DSA
instance of DSA.

set_params(p, q, g)

 

Factory function that instantiates a DSA object with DSA parameters.

Parameters:
  • p (str) - value of p, a "byte string"
  • q (str) - value of q, a "byte string"
  • g (str) - value of g, a "byte string"
Returns: DSA
instance of DSA.

load_params(file, callback=<function passphrase_callback at 0x83b2a04>)

 

Factory function that instantiates a DSA object with DSA parameters from a file.

Parameters:
  • file (str) - Names the file (a path) that contains the PEM representation of the DSA parameters.
  • callback (A Python callable) - A Python callback object that will be invoked if the DSA parameters file is passphrase-protected.
Returns: DSA
instance of DSA.

load_params_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)

 

Factory function that instantiates a DSA object with DSA parameters from a M2Crypto.BIO object.

Parameters:
  • bio (M2Crypto.BIO object) - Contains the PEM representation of the DSA parameters.
  • callback (A Python callable) - A Python callback object that will be invoked if the DSA parameters file is passphrase-protected.
Returns: DSA
instance of DSA.

load_key(file, callback=<function passphrase_callback at 0x83b2a04>)

 

Factory function that instantiates a DSA object from a PEM encoded DSA key pair.

Parameters:
  • file (str) - Names the file (a path) that contains the PEM representation of the DSA key pair.
  • callback (A Python callable) - A Python callback object that will be invoked if the DSA key pair is passphrase-protected.
Returns: DSA
instance of DSA.

load_key_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)

 

Factory function that instantiates a DSA object from a PEM encoded DSA key pair.

Parameters:
  • bio (M2Crypto.BIO object) - Contains the PEM representation of the DSA key pair.
  • callback (A Python callable) - A Python callback object that will be invoked if the DSA key pair is passphrase-protected.
Returns: DSA
instance of DSA.

load_pub_key(file, callback=<function passphrase_callback at 0x83b2a04>)

 

Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM file. The PEM file must contain the parameters in addition to the public key.

Parameters:
  • file (str) - Names the file (a path) that contains the PEM representation of the DSA public key.
  • callback (A Python callable) - A Python callback object that will be invoked should the DSA public key be passphrase-protected.
Returns: DSA_pub
instance of DSA_pub.

load_pub_key_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)

 

Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM format. The PEM must contain the parameters in addition to the public key.

Parameters:
  • bio (M2Crypto.BIO object) - Contains the PEM representation of the DSA public key (with params).
  • callback (A Python callable) - A Python callback object that will be invoked should the DSA public key be passphrase-protected.
Returns: DSA_pub
instance of DSA_pub.