Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 4th, 2012  |  syntax: Bash  |  size: 0.83 KB  |  views: 65  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #convert key to pem format:
  2. openssl pkcs12 -in alonso-testkey.pfx -out key.pem -nocerts
  3.  
  4. #rewrite without password
  5. openssl rsa -in key.pem -out key1.pem
  6.  
  7. #decrypt without leading 4 bytes:
  8. cms -decrypt -inform DER -in sandvout-without-4byte.txt -out decrypted.bin -recip AlonsoCert.pem -inkey key1.pem
  9. Error decrypting CMS structure
  10. 3073943752:error:2E078066:CMS routines:cms_EncryptedContent_init_bio:cipher parameter initialisation error:cms_enc.c:139:
  11.  
  12. #decrypt with leading 4 bytes:
  13.  openssl cms -decrypt -inform DER -in sandvout.txt -out decrypted.bin -recip AlonsoCert.pem -inkey key1.pem
  14. Error reading S/MIME message
  15. 3073661128:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319:
  16. 3073661128:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=CMS_ContentInfo