FileDocCategorySizeDatePackage
SMIMEEnvelopedParser.javaAPI DocBouncy Castle Crypto API 1.41 (Java 1.5)2568Wed Oct 01 10:55:30 BST 2008org.bouncycastle.mail.smime

SMIMEEnvelopedParser

public class SMIMEEnvelopedParser extends org.bouncycastle.cms.CMSEnvelopedDataParser
Stream based containing class for an S/MIME pkcs7-mime encrypted MimePart.

Fields Summary
private final MimePart
message
Constructors Summary
public SMIMEEnvelopedParser(MimeBodyPart message)

        this(message, 0);
    
public SMIMEEnvelopedParser(MimeMessage message)

        this(message, 0);
    
public SMIMEEnvelopedParser(MimeBodyPart message, int bufferSize)
Create a parser from a MimeBodyPart using the passed in buffer size for reading it.

param
message body part to be parsed.
param
bufferSize bufferSoze to be used.

        super(getInputStream(message, bufferSize));

        this.message = message;
    
public SMIMEEnvelopedParser(MimeMessage message, int bufferSize)
Create a parser from a MimeMessage using the passed in buffer size for reading it.

param
message message to be parsed.
param
bufferSize bufferSoze to be used.

        super(getInputStream(message, bufferSize));

        this.message = message;
    
Methods Summary
public javax.mail.internet.MimePartgetEncryptedContent()

        return message;
    
private static java.io.InputStreamgetInputStream(javax.mail.Part bodyPart, int bufferSize)

        try
        {
            InputStream in = bodyPart.getInputStream();
            
            if (bufferSize == 0)
            {
                return new BufferedInputStream(in);
            }
            else
            {
                return new BufferedInputStream(in, bufferSize);
            }
        }
        catch (IOException e)
        {
            throw new MessagingException("can't extract input stream: " + e);
        }