file_decrypt(input_file_path,
recipient_private_key,
recipient_cert,
output_file_path=None,
keyring_source='file',
type='DER')
| source code
|
Decrypts the input file data with input private key and input
certificate. If an output file path is present, the decrypted data is
also written to that file.
- Parameters:
input_file_path (filepath) - the filepath from where retrieve the data to decrypt
recipient_private_key (filepath or M2Crypto.BIO or M2Crypto.EVP.PKey) - recipient private key reference, could be from file, from memory
or from pkcs11 smartcard, based on keyring_source input
parameter.
recipient_cert (filepath or M2Crypto.BIO or M2Crypto.X509.X509) - recipient certificate, could be from filepath, from memory or
from pkcs11 smartcard, based on keyring_source input parameter.
output_file_path (filepath) - if present, the filepath where to write the decrypted data.
keyring_source (str) - the type of the source for input certificate, used to recall the
appropriate method for decrypter settings. Ammitted values are:
file, memory, pkcs11.
type (str) - specifies the type of input PKCS#7 data: PEM or DER
- Returns: str
- the decrypted data in plain form.
|