PKCS #7 detached signature with Python and PyOpenSSL
I need to get a detached PKCS #7 signature of some string in Python, using PyOpenSSL. I've got a key in .p12 file. So far, I'm trying to do so: from OpenSSL.crypto import load_pkcs12, sign pkcs12 = load_pkcs12(key_dat, key_pwd) algo = pkcs12.get_certificate().get_signature_algorithm() pkey = pkcs12.get_privatekey() sg = sign(pkey, manifest, algo) But it's not what required. I've searched net, but most examples are related to signing email chunks and use M2Crypto. Is there any way of doing it in bare PyOpenSSL? The PKCS#7 OpenSSL functions that you need for this do not seem to be exported by