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

x_pkcs7_signature

public class x_pkcs7_signature extends Object implements DataContentHandler

Fields Summary
private static final ActivationDataFlavor
ADF
private static final DataFlavor[]
ADFs
Constructors Summary
Methods Summary
public java.lang.ObjectgetContent(javax.activation.DataSource _ds)

        ADF  = new ActivationDataFlavor(MimeBodyPart.class, "application/x-pkcs7-signature", "Signature");
        ADFs = new DataFlavor[] { ADF };
    
        return _ds.getInputStream();
    
public java.lang.ObjectgetTransferData(java.awt.datatransfer.DataFlavor _df, javax.activation.DataSource _ds)

    
        if (ADF.equals(_df)) 
        {
            return getContent(_ds);
        }
        else 
        {
            return null;
        }
    
public java.awt.datatransfer.DataFlavor[]getTransferDataFlavors()

        return ADFs;
    
public voidwriteTo(java.lang.Object _obj, java.lang.String _mimeType, java.io.OutputStream _os)

        if (_obj instanceof MimeBodyPart) 
        {
            try 
            {
                ((MimeBodyPart)_obj).writeTo(_os);
            } 
            catch (MessagingException ex) 
            {
                throw new IOException(ex.getMessage());
            }
        }
        else if (_obj instanceof byte[]) 
        {
            _os.write((byte[])_obj);
        }
        else if (_obj instanceof InputStream)
        {
            int            b;
            InputStream    in = (InputStream)_obj;

            while ((b = in.read()) >= 0)
            {
                _os.write(b);
            }
        }
        else
        {
            throw new IOException("unknown object in writeTo " + _obj);
        }