public SafeContents getSafeContents(int i, java.security.PrivateKey key,
java.security.cert.X509Certificate cert) throws IOException,
ASN1Exception, GeneralSecurityException, NoSuchElementException {
ByteArrayInputStream bais;
ContentInfo cinfo = (ContentInfo) this.get(i);
EnvelopedData envData = null;
if (cinfo.getContent() instanceof EnvelopedData) {
envData = (EnvelopedData) cinfo.getContent();
} else {
System.out
.println("This bag is password protected or not protected at all.");
return null;
}