This sample parses the content of a PFX/PKCS#12 file and it lists the certificates and private keys it contains.
Here is the source : pfx_parse.cpp
The Cryptology ePrint Archive provides rapid access to recent research in cryptology. It's hosted by the International Association for Cryptologic Research. The latest articles can be accessed by clicking here.