From The Compiler, 8 Years ago, written in Plain Text.
Embed
  1. $ openssl smime -pk7out -in foo.msg | openssl pkcs7 -print_certs -noout
  2. subject=/C=CH/O=SwissSign AG/CN=SwissSign Gold CA - G2
  3. issuer=/C=CH/O=SwissSign AG/CN=SwissSign Gold CA - G2
  4.  
  5. subject=/C=CH/O=PostFinance AG/CN=PostFinance File Delivery PF24 Die Schweizerische Post/emailAddress=filedelivery@postfinance.ch
  6. issuer=/C=CH/O=SwissSign AG/CN=SwissSign Personal Gold CA 2008 - G2
  7.  
  8. subject=/C=CH/O=SwissSign AG/CN=SwissSign Personal Gold CA 2008 - G2
  9. issuer=/C=CH/O=SwissSign AG/CN=SwissSign Gold CA - G2
  10.  
  11. $ openssl x509 -in /usr/share/ca-certificates/mozilla/SwissSign_Gold_CA_-_G2.crt -noout -text
  12. Certificate:
  13.     Data:
  14.         Version: 3 (0x2)
  15.         Serial Number: 13492815561806991280 (0xbb401c43f55e4fb0)
  16.     Signature Algorithm: sha1WithRSAEncryption
  17.         Issuer: C=CH, O=SwissSign AG, CN=SwissSign Gold CA - G2
  18.         Validity
  19.             Not Before: Oct 25 08:30:35 2006 GMT
  20.             Not After : Oct 25 08:30:35 2036 GMT
  21.         Subject: C=CH, O=SwissSign AG, CN=SwissSign Gold CA - G2
  22.         Subject Public Key Info:
  23.                         [...]
  24.         X509v3 extensions:
  25.                         [...]
  26.  
  27.     Signature Algorithm: sha1WithRSAEncryption
  28.                 [...]
  29.        
  30. $ openssl smime -verify -in foo.msg -out /dev/null -CAfile /usr/share/ca-certificates/mozilla/SwissSign_Gold_CA_-_G2.crt
  31. Verification successful
  32.  
  33. $ openssl smime -verify -in foo.msg -out /dev/null -CApath /usr/share/ca-certificates
  34. Verification failure
  35. 139652391847592:error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error:pk7_smime.c:342:Verify error:self signed certificate in certificate chain