Package org.apache.harmony.security.asn1

Examples of org.apache.harmony.security.asn1.ASN1Boolean


                    utime.decode(in)); //decoded
        }

        // encoding date object
        for (int i = 0; i < validUTCTimes.length; i++) {
            DerOutputStream out = new DerOutputStream(utime,
                    validUTCTimes[i][2]);
            assertTrue("Encoding date for " + validUTCTimes[i][0], Arrays
                    .equals((byte[]) validUTCTimes[i][1], // expected
                            out.encoded)); //encoded
        }
View Full Code Here


                    gtime.decode(in)); //decoded
        }

        // encoding date object
        for (int i = 0; i < validGeneralizedTimes.length; i++) {
            DerOutputStream out = new DerOutputStream(gtime,
                    validGeneralizedTimes[i][2]);
            assertTrue("Encoding date for " + validGeneralizedTimes[i][0],
                    Arrays.equals((byte[]) validGeneralizedTimes[i][1], // expected
                            out.encoded)); //encoded
        }
View Full Code Here

        }
       
        // testing encoding
        for (int i = 0; i < oid.length; i++) {

            byte[] encoded = new DerOutputStream(ASN1Oid.getInstance(),
                    oid[i][1]).encoded;

            assertTrue("Failed to encode oid: " + oid[i][0], // error message
                    Arrays.equals((byte[]) oid[i][2], // expected encoding
                            encoded));
View Full Code Here

        // testing encoding
        for (int i = 0; i < oid.length; i++) {
            assertTrue("Failed to encode oid: " + oid[i][0], // error message
                    Arrays.equals((byte[]) oid[i][2], // expected encoding
                            new DerOutputStream(asn1, oid[i][0]).encoded));
        }
    }
View Full Code Here

        assertTrue(Arrays.equals(encoded, (byte[]) ASN1Any.getInstance()
                .decode(in)));
    }

    public void testEncode() throws IOException {
        DerOutputStream out = new DerOutputStream(ASN1Any.getInstance(),
                encoded);
        assertTrue("False", Arrays.equals(encoded, out.encoded));
    }
View Full Code Here

    //ASN.1 DER encoding
    private byte[] encoding;

    Oid(int[] data) {
        super();
        oid = new ObjectIdentifier(data);
    }
View Full Code Here

    }

    public Oid(byte[] data) throws GSSException {
        super();
        try {
            oid = new ObjectIdentifier((int[]) ASN1.decode(data));
        } catch (IOException e) {
            GSSException gsse = new GSSException(GSSException.FAILURE);
            gsse.initCause(e);
            throw gsse;
        }
View Full Code Here

        if (derOid == null) {
            throw new NullPointerException();
        }

        try {
            oid = new ObjectIdentifier((int[]) ASN1.decode(derOid));
        } catch (IOException e) {
            GSSException gsse = new GSSException(GSSException.FAILURE);
            gsse.initCause(e);
            throw gsse;
        }
View Full Code Here

            {
                Object o = seq.getObjectAt(i);

                if (o instanceof ASN1Boolean)
                {
                    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;
                    case 1:
                        x = ASN1Boolean.getInstance(t, false);
                        result.setInhibitAnyPolicy(x.isTrue());
                    }
                }
            }
            return result;
        }
View Full Code Here

        v.add(new DERSequence(pV));

        if (inhibitPolicyMapping)
        {
            v.add(new ASN1Boolean(inhibitPolicyMapping));
        }
        if (explicitPolicyReqd)
        {
            v.add(new DERTaggedObject(false, 0, new ASN1Boolean(explicitPolicyReqd)));
        }
        if (inhibitAnyPolicy)
        {
            v.add(new DERTaggedObject(false, 1, new ASN1Boolean(inhibitAnyPolicy)));
        }

        return new DERSequence(v);
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.asn1.ASN1Boolean

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.