Exporting certificates
Certificate-only messages provide a simple method of transmitting certificates between users. To create these messages, use the following constructor.
PKCS7EncodeStream encoder = new PKCS7EncodeStream(user, new FileOutputStream(<output file>), PKCS7EncodeStream.EXPORT_CERTIFICATES);