I am openssl Newibe. I am trying to write a python script (calling openssl) to decrypt multiple p12 encrypted eml files but failing.
I can open them up in Thunderbird fine.
here is what i tried:
openssl pkcs12 -in keys/pkitepki.p12 -clcerts -nokeys -out file.crt.pem
openssl pkcs12 -in keys/pkitepki.p12 -nocerts -out file.key.pem
openssl smime -decrypt -in smime.p7m -recip file.crt.pem -inkey file.key.pem
The error i got is :
Error reading S/MIME message
139955665413864:error:0D0D40D1:asn1 encoding routines:SMIME_read_ASN1:no content type:asn_mime.c:451
What is wrong with my steps?
The input should not be smime.p7m. it should be the email with the smime.p7m inside it. There should be email headers and a base64 encoded content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With