EnvelInfo: Display CMS/PKCS #7 Enveloped Message Recipients


EnvelInfo is a .NET assembly CryptoAPI console utility which displays information about a CMS/PKCS #7 enveloped message file. Both binary DER and base64 file formats are supported. Information displayed includes the recipients certificate SerialNumber and the displayable extensions of the IssuerName for each recipient specified in the enveloped file. The symmetric encryption algorithm used is also decoded and displayed along with key size, if RC2.

This utility does not explicitly decrypt the enveloped message to any recipient in the message. Typically this would involve using CertGetSubjectCertificateFromStore() with the CERT_INFO structure and with the ADDRESSBOOK certificate store as described in CryptMsgOpenToDecode.

This utility uses P/Invoke to CryptoAPI functions:

CAPICOM 2 provides easy access to EnvelopedData message information. However, recipient information is only available if the EnvelopedData.Decrypt method succeeds. The utility provided here does not require any decryption to access the enveloped message recipient information.

C# Source
Sample output (for 2 recipients)

PKCS #7 - Cryptographic Message Syntax Standard


Michel I. Gallant
neutron@istar.ca