Package org.bouncycastle.sasn1

Examples of org.bouncycastle.sasn1.Asn1InputStream.readObject()


        if (info.getContentType().equals(data))
        {
            bIn = new ASN1InputStream(((ASN1OctetString)info.getContent()).getOctets());

            AuthenticatedSafe authSafe = AuthenticatedSafe.getInstance(bIn.readObject());
            ContentInfo[] c = authSafe.getContentInfo();

            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
View Full Code Here


            for (int i = 0; i != c.length; i++)
            {
                if (c[i].getContentType().equals(data))
                {
                    ASN1InputStream dIn = new ASN1InputStream(((ASN1OctetString)c[i].getContent()).getOctets());
                    ASN1Sequence seq = (ASN1Sequence)dIn.readObject();

                    for (int j = 0; j != seq.size(); j++)
                    {
                        SafeBag b = SafeBag.getInstance(seq.getObjectAt(j));
                        if (b.getBagId().equals(pkcs8ShroudedKeyBag))
View Full Code Here

    {
        ByteArrayInputStream     bIn = new ByteArrayInputStream(enc);
        Asn1InputStream          aIn = new Asn1InputStream(bIn);

        Asn1ObjectIdentifier      o = new Asn1ObjectIdentifier(oid);
        Asn1ObjectIdentifier      encO = (Asn1ObjectIdentifier)aIn.readObject();
       
        if (!o.equals(encO))
        {
            fail("oid ID didn't match - got: " + o + " expected " + encO);
        }
View Full Code Here

    {
        Asn1ObjectIdentifier    o = new Asn1ObjectIdentifier(oid);
        ByteArrayInputStream    bIn = new ByteArrayInputStream(o.getEncoded());
        Asn1InputStream         aIn = new Asn1InputStream(bIn);
       
        o = (Asn1ObjectIdentifier)aIn.readObject();
       
        if (!o.toString().equals(oid))
        {
            fail("failed oid check for " + oid);
        }
View Full Code Here

    public void testDerReading()
        throws Exception
    {
        Asn1InputStream aIn = new Asn1InputStream(seqData);
       
        Asn1Sequence    seq = (Asn1Sequence)aIn.readObject();
        Object          o = null;
        int             count = 0;
       
        assertNotNull("null sequence returned", seq);
       
View Full Code Here

        byte[] data)
        throws Exception
    {
        Asn1InputStream aIn = new Asn1InputStream(data);
       
        Asn1Sequence    seq = (Asn1Sequence)aIn.readObject();
        Object          o = null;
        int             count = 0;
       
        assertNotNull("null sequence returned", seq);
       
View Full Code Here

    public void testBerReading()
        throws Exception
    {
        Asn1InputStream aIn = new Asn1InputStream(berSeqData);
       
        Asn1Sequence    seq = (Asn1Sequence)aIn.readObject();
        Object          o = null;
        int             count = 0;
       
        assertNotNull("null sequence returned", seq);
       
View Full Code Here

    public void testLongTag()
        throws IOException
    {
        Asn1InputStream aIn = new Asn1InputStream(longTagged);
       
        Asn1TaggedObject tagged = (Asn1TaggedObject)aIn.readObject();
       
        assertEquals(31, tagged.getTagNumber());
    }
   
    private void parseEnveloped(byte[] data) throws IOException
View Full Code Here

   
    private void parseEnveloped(byte[] data) throws IOException
    {
        Asn1InputStream aIn = new Asn1InputStream(data);
       
        ContentInfoParser cP = new ContentInfoParser((Asn1Sequence)aIn.readObject());
       
        EnvelopedDataParser eP = new EnvelopedDataParser((Asn1Sequence)cP.getContent(BerTag.SEQUENCE));
       
        eP.getRecipientInfos();
       
View Full Code Here

      
       out.close();
      
       Asn1InputStream aIn = new Asn1InputStream(bOut.toByteArray());
      
       BerOctetString s = (BerOctetString)aIn.readObject();
      
       InputStream in = s.getOctetStream();
       int         count = 0;
      
       while (in.read() >= 0)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.