Ejemplo n.º 1
0
    public byte[] GetContent()
    {
        CompressedData  instance         = CompressedData.GetInstance(contentInfo.Content);
        ContentInfo     encapContentInfo = instance.EncapContentInfo;
        Asn1OctetString asn1OctetString  = (Asn1OctetString)encapContentInfo.Content;
        ZInputStream    zInputStream     = new ZInputStream(asn1OctetString.GetOctetStream());

        try
        {
            return(CmsUtilities.StreamToByteArray(zInputStream));
        }
        catch (IOException e)
        {
            throw new CmsException("exception reading compressed stream.", e);
        }
        finally
        {
            Platform.Dispose(zInputStream);
        }
    }
Ejemplo n.º 2
0
        /**
         * Return the uncompressed content.
         *
         * @return the uncompressed content
         * @throws CmsException if there is an exception uncompressing the data.
         */
        public byte[] GetContent()
        {
            CompressedData comData = CompressedData.GetInstance(contentInfo.Content);
            ContentInfo    content = comData.EncapContentInfo;

            Asn1OctetString      bytes = (Asn1OctetString)content.Content;
            ZInflaterInputStream zIn   = new ZInflaterInputStream(bytes.GetOctetStream());

            try
            {
                return(CmsUtilities.StreamToByteArray(zIn));
            }
            catch (IOException e)
            {
                throw new CmsException("exception reading compressed stream.", e);
            }
            finally
            {
                zIn.Close();
            }
        }
Ejemplo n.º 3
0
        /**
         * Return the uncompressed content.
         *
         * @return the uncompressed content
         * @throws CmsException if there is an exception uncompressing the data.
         */
        public byte[] GetContent()
        {
            CompressedData comData = CompressedData.GetInstance(contentInfo.Content);
            ContentInfo    content = comData.EncapContentInfo;

            Asn1OctetString bytes = (Asn1OctetString)content.Content;
            ZInputStream    zIn   = new ZInputStream(bytes.GetOctetStream());

            try
            {
                return(CmsUtilities.StreamToByteArray(zIn));
            }
            catch (IOException e)
            {
                throw new CmsException("exception reading compressed stream.", e);
            }
            finally
            {
                BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Platform.Dispose(zIn);
            }
        }
Ejemplo n.º 4
0
        public byte[] GetContent()
        {
            //IL_003c: Expected O, but got Unknown
            CompressedData  instance         = CompressedData.GetInstance(contentInfo.Content);
            ContentInfo     encapContentInfo = instance.EncapContentInfo;
            Asn1OctetString asn1OctetString  = (Asn1OctetString)encapContentInfo.Content;
            ZInputStream    zInputStream     = new ZInputStream(asn1OctetString.GetOctetStream());

            try
            {
                return(CmsUtilities.StreamToByteArray((Stream)(object)zInputStream));
            }
            catch (IOException val)
            {
                IOException e = val;
                throw new CmsException("exception reading compressed stream.", (global::System.Exception)(object) e);
            }
            finally
            {
                Platform.Dispose((Stream)(object)zInputStream);
            }
        }