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

Module EVP



M2Crypto wrapper for OpenSSL EVP API.

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

Portions Copyright (c) 2004-2007 Open Source Applications Foundation. Author: Heikki Toivonen

Classes
  EVPError
  MessageDigest
Message Digest
  HMAC
  Cipher
  PKey
Public Key
Functions
str
pbkdf2(password, salt, iter, keylen)
Derive a key from password using PBKDF2 algorithm specified in RFC 2898.
 
hmac(key, data, algo='sha1')
M2Crypto.EVP.PKey
load_key(file, callback=<function passphrase_callback at 0x83b2a04>)
Load an M2Crypto.EVP.PKey from file.
M2Crypto.EVP.PKey
load_key_bio(bio, callback=<function passphrase_callback at 0x83b2a04>)
Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.
M2Crypto.EVP.PKey
load_key_string(string, callback=<function passphrase_callback at 0x83b2a04>)
Load an M2Crypto.EVP.PKey from a string.
Function Details

pbkdf2(password, salt, iter, keylen)

 

Derive a key from password using PBKDF2 algorithm specified in RFC 2898.

Parameters:
  • password (str) - Derive the key from this password.
  • salt (str) - Salt.
  • iter (int) - Number of iterations to perform.
  • keylen (int) - Length of key to produce.
Returns: str
Key.

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

 

Load an M2Crypto.EVP.PKey from file.

Parameters:
  • file (string) - Name of file containing the key in PEM format.
  • callback (Python callable) - A Python callable object that is invoked to acquire a passphrase with which to protect the key.
Returns: M2Crypto.EVP.PKey
M2Crypto.EVP.PKey object.

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

 

Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.

Parameters:
  • bio (M2Crypto.BIO) - M2Crypto.BIO object containing the key in PEM format.
  • callback (Python callable) - A Python callable object that is invoked to acquire a passphrase with which to protect the key.
Returns: M2Crypto.EVP.PKey
M2Crypto.EVP.PKey object.

load_key_string(string, callback=<function passphrase_callback at 0x83b2a04>)

 

Load an M2Crypto.EVP.PKey from a string.

Parameters:
  • string (string) - String containing the key in PEM format.
  • callback (Python callable) - A Python callable object that is invoked to acquire a passphrase with which to protect the key.
Returns: M2Crypto.EVP.PKey
M2Crypto.EVP.PKey object.