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

Module EC



M2Crypto wrapper for OpenSSL ECDH/ECDSA API.


Requires: OpenSSL 0.9.8 or newer

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

Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved.

Classes
  ECError
  EC
Object interface to a EC key pair.
  EC_pub
Object interface to an EC public key.
Functions
 
gen_params(curve)
Factory function that generates EC parameters and instantiates a EC object from the output.
 
load_key(file, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a EC object.
 
load_key_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)
Factory function that instantiates a EC object.
M2Crypto.EC.EC_pub
load_pub_key(file)
Load an EC public key from file.
M2Crypto.EC.EC_pub
load_pub_key_bio(bio)
Load an EC public key from an M2Crypto.BIO.BIO object.
 
ec_error()
 
pub_key_from_der(der)
Create EC_pub from DER.
Variables
  NID_secp112r1 = 704
  NID_secp112r2 = 705
  NID_secp128r1 = 706
  NID_secp128r2 = 707
  NID_secp160k1 = 708
  NID_secp160r1 = 709
  NID_secp160r2 = 710
  NID_secp192k1 = 711
  NID_secp224k1 = 712
  NID_secp224r1 = 713
  NID_secp256k1 = 714
  NID_secp384r1 = 715
  NID_secp521r1 = 716
  NID_sect113r1 = 717
  NID_sect113r2 = 718
  NID_sect131r1 = 719
  NID_sect131r2 = 720
  NID_sect163k1 = 721
  NID_sect163r1 = 722
  NID_sect163r2 = 723
  NID_sect193r1 = 724
  NID_sect193r2 = 725
  NID_sect233k1 = 726
  NID_sect233r1 = 727
  NID_sect239k1 = 728
  NID_sect283k1 = 729
  NID_sect283r1 = 730
  NID_sect409k1 = 731
  NID_sect409r1 = 732
  NID_sect571k1 = 733
  NID_sect571r1 = 734
  NID_X9_62_prime192v1 = 409
  NID_X9_62_prime192v2 = 410
  NID_X9_62_prime192v3 = 411
  NID_X9_62_prime239v1 = 412
  NID_X9_62_prime239v2 = 413
  NID_X9_62_prime239v3 = 414
  NID_X9_62_prime256v1 = 415
  NID_X9_62_c2pnb163v1 = 684
  NID_X9_62_c2pnb163v2 = 685
  NID_X9_62_c2pnb163v3 = 686
  NID_X9_62_c2pnb176v1 = 687
  NID_X9_62_c2tnb191v1 = 688
  NID_X9_62_c2tnb191v2 = 689
  NID_X9_62_c2tnb191v3 = 690
  NID_X9_62_c2pnb208w1 = 693
  NID_X9_62_c2tnb239v1 = 694
  NID_X9_62_c2tnb239v2 = 695
  NID_X9_62_c2tnb239v3 = 696
  NID_X9_62_c2pnb272w1 = 699
  NID_X9_62_c2pnb304w1 = 700
  NID_X9_62_c2tnb359v1 = 701
  NID_X9_62_c2pnb368w1 = 702
  NID_X9_62_c2tnb431r1 = 703
  NID_wap_wsg_idm_ecid_wtls1 = 735
  NID_wap_wsg_idm_ecid_wtls3 = 736
  NID_wap_wsg_idm_ecid_wtls4 = 737
  NID_wap_wsg_idm_ecid_wtls5 = 738
  NID_wap_wsg_idm_ecid_wtls6 = 739
  NID_wap_wsg_idm_ecid_wtls7 = 740
  NID_wap_wsg_idm_ecid_wtls8 = 741
  NID_wap_wsg_idm_ecid_wtls9 = 742
  NID_wap_wsg_idm_ecid_wtls10 = 743
  NID_wap_wsg_idm_ecid_wtls11 = 744
  NID_wap_wsg_idm_ecid_wtls12 = 745
Function Details

gen_params(curve)

 

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

Parameters:
  • curve - This is the OpenSSL nid of the curve to use.

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

 

Factory function that instantiates a EC object.

Parameters:
  • file - Names the file that contains the PEM representation of the EC key pair.
  • callback - Python callback object that will be invoked if the EC key pair is passphrase-protected.

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

 

Factory function that instantiates a EC object.

Parameters:
  • bio - M2Crypto.BIO object that contains the PEM representation of the EC key pair.
  • callback - Python callback object that will be invoked if the EC key pair is passphrase-protected.

load_pub_key(file)

 

Load an EC public key from file.

Parameters:
  • file (string) - Name of file containing EC public key in PEM format.
Returns: M2Crypto.EC.EC_pub
M2Crypto.EC.EC_pub object.

load_pub_key_bio(bio)

 

Load an EC public key from an M2Crypto.BIO.BIO object.

Parameters:
  • bio (M2Crypto.BIO.BIO) - M2Crypto.BIO.BIO object containing EC public key in PEM format.
Returns: M2Crypto.EC.EC_pub
M2Crypto.EC.EC_pub object.