Other
Working with PKCS#12 files
12 files
S/MIME signature verification
Verify a signed email: split the multipart/signed message into the signed part and its detached CMS signature, check the signature, and check that the signer's certificate chains up to a root you trust.
S/MIME encryption
Encrypt an email for a recipient's certificate: wrap the message in a MIME entity, encrypt it as CMS EnvelopedData, and put it in an application/pkcs7-mime message. Then decrypt it as the recipient. Edit the message below, run the example, and download the encrypted .eml file.
How to verify a signature in a PDF file
Verify the signatures of a signed PDF without a PDF library: each signature dictionary has a /ByteRange listing the bytes it covers and a /Contents holding a detached CMS signature. The example checks each signature, whether it covers the whole file, and whether its certificate chains up to a root you trust.