Package org.bouncycastle.mail.smime.util

Examples of org.bouncycastle.mail.smime.util.FileBackedMimeBodyPart


        File              file)
        throws SMIMEException
    {
        try
        {
            return new FileBackedMimeBodyPart(content.getContentStream(), file);
        }
        catch (IOException e)
        {
            throw new SMIMEException("can't save content to file: " + e, e);
        }
View Full Code Here


        RecipientId                recId = getRecipientId(_reciCert2);

        RecipientInformationStore  recipients = m.getRecipientInfos();
        RecipientInformation       recipient = recipients.get(recId);
       
        FileBackedMimeBodyPart    res = SMIMEUtil.toMimeBodyPart(recipient.getContentStream(_reciKP2.getPrivate(), "BC"));

        verifyMessageBytes(_msg, res);
       
        m = new SMIMEEnvelopedParser(mp);

        res.dispose();
       
        recId = getRecipientId(_reciCert);

        recipients = m.getRecipientInfos();
        recipient = recipients.get(recId);
        res = SMIMEUtil.toMimeBodyPart(recipient.getContentStream(_reciKP.getPrivate(), "BC"));

        verifyMessageBytes(_msg, res);
       
        res.dispose();
    }
View Full Code Here

        throws Exception
    {
        MimeBodyPart res = generateEncapsulatedRsa(SMIMESignedGenerator.DIGEST_SHA1, msg);      
        SMIMESignedParser s = new SMIMESignedParser(res);

        FileBackedMimeBodyPart content = (FileBackedMimeBodyPart)s.getContent();
       
        verifyMessageBytes(msg, content);
   
        content.dispose();
       
        verifySigners(s.getCertificatesAndCRLs("Collection", "BC"), s.getSignerInfos());
       
        s.close();
    }
View Full Code Here

        throws Exception
    {
        File         tmp = File.createTempFile("bcTest", ".mime");
        MimeBodyPart res = generateEncapsulatedRsa(SMIMESignedGenerator.DIGEST_SHA1, msg);      
        SMIMESignedParser s = new SMIMESignedParser(res, tmp);
        FileBackedMimeBodyPart content = (FileBackedMimeBodyPart)s.getContent();
   
        verifyMessageBytes(msg, s.getContent());
   
        verifySigners(s.getCertificatesAndCRLs("Collection", "BC"), s.getSignerInfos());
       
        assertTrue(tmp.exists());
       
        s.close();
       
        content.dispose();
       
        assertFalse(tmp.exists());
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.mail.smime.util.FileBackedMimeBodyPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.