Package org.bouncycastle.sasn1

Examples of org.bouncycastle.sasn1.Asn1TaggedObject


                    ASN1Boolean x = ASN1Boolean.getInstance(o);
                    result.setInhibitPolicyMapping(x.isTrue());
                }
                else if (o instanceof ASN1TaggedObject)
                {
                    ASN1TaggedObject t = ASN1TaggedObject.getInstance(o);
                    ASN1Boolean x;
                    switch (t.getTagNo())
                    {
                    case 0:
                        x = ASN1Boolean.getInstance(t, false);
                        result.setExplicitPolicyReqd(x.isTrue());
                        break;
View Full Code Here


    public ASN1OctetString getContent()
    {
        if (data.size() == 3)
        {
            ASN1TaggedObject o = ASN1TaggedObject.getInstance(data.getObjectAt(2));

            return ASN1OctetString.getInstance(o, false);
        }

        return null;
View Full Code Here

            // an interesting feature of SignedData is that there appear to be varying implementations...
            // for the moment we ignore anything which doesn't fit.
            //
            if (o instanceof ASN1TaggedObject)
            {
                ASN1TaggedObject tagged = (ASN1TaggedObject)o;

                switch (tagged.getTagNo())
                {
                case 0:
                    certificates = ASN1Set.getInstance(tagged, false);
                    break;
                case 1:
                    crls = ASN1Set.getInstance(tagged, false);
                    break;
                default:
                    throw new IllegalArgumentException("unknown tag value " + tagged.getTagNo());
                }
            }
            else
            {
                signerInfos = (ASN1Set)o;
View Full Code Here

            for (Enumeration en = certs.getObjects(); en.hasMoreElements();)
            {
                Object obj = en.nextElement();
                if (obj instanceof ASN1TaggedObject)
                {
                    ASN1TaggedObject tagged = ASN1TaggedObject.getInstance(obj);

                    if (tagged.getTagNo() == 1)
                    {
                        attrCertV1Found = true;
                    }
                    else if (tagged.getTagNo() == 2)
                    {
                        attrCertV2Found = true;
                    }
                    else if (tagged.getTagNo() == 3)
                    {
                        otherCert = true;
                    }
                }
            }
View Full Code Here

        }

        try
        {
            obj = seq.getObjectAt(i++);
            ASN1TaggedObject tagged = ASN1TaggedObject.getInstance(obj);
            switch (tagged.getTagNo())
            {
            case 0:
                this.pathProcInput = PathProcInput.getInstance(tagged, false);
                break;
            }
View Full Code Here

    public ASN1Integer getVersion()
    {
        if (info instanceof ASN1TaggedObject)
        {
            ASN1TaggedObject o = (ASN1TaggedObject)info;

            switch (o.getTagNo())
            {
            case 1:
                return KeyAgreeRecipientInfo.getInstance(o, false).getVersion();
            case 2:
                return getKEKInfo(o).getVersion();
View Full Code Here

    public ASN1Encodable getInfo()
    {
        if (info instanceof ASN1TaggedObject)
        {
            ASN1TaggedObject o = (ASN1TaggedObject)info;

            switch (o.getTagNo())
            {
            case 1:
                return KeyAgreeRecipientInfo.getInstance(o, false);
            case 2:
                return getKEKInfo(o);
View Full Code Here

        String oid,
        byte[] enc)
        throws IOException
    {
        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

        String  oid)
        throws IOException
    {
        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

TOP

Related Classes of org.bouncycastle.sasn1.Asn1TaggedObject

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.