Examples of ASN1Oid


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

                    new byte[] { 0x06, 0x03, (byte) 0x81, 0x34, 0x03 } } };

    public void test_MappingToIntArray() throws IOException {

        // oid decoder/encoder for testing
        ASN1Oid asn1 = ASN1Oid.getInstance();

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

            int[] decoded = (int[]) asn1.decode(new DerInputStream(
                    (byte[]) oid[i][2]));

            assertTrue("Failed to decode oid: " + oid[i][0], // error message
                    Arrays.equals((int[]) oid[i][1], // expected array
                            decoded));
View Full Code Here

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

    }

    public void test_MappingToString() throws IOException {

        // oid decoder/encoder for testing
        ASN1Oid asn1 = ASN1Oid.getInstanceForString();
       
        // testing decoding
        for (int i = 0; i < oid.length; i++) {
            assertEquals("Failed to decode oid: " + oid[i][0], // error message
                    oid[i][0], // expected string
                    asn1.decode(new DerInputStream((byte[]) oid[i][2])));
        }

        // testing encoding
        for (int i = 0; i < oid.length; i++) {
            assertTrue("Failed to encode oid: " + oid[i][0], // error message
View Full Code Here

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

                    new byte[] { 0x06, 0x03, (byte) 0x81, 0x34, 0x03 } } };

    public void test_MappingToIntArray() throws IOException {

        // oid decoder/encoder for testing
        ASN1Oid asn1 = ASN1Oid.getInstance();

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

            int[] decoded = (int[]) asn1.decode(new DerInputStream(
                    (byte[]) oid[i][2]));

            assertTrue("Failed to decode oid: " + oid[i][0], // error message
                    Arrays.equals((int[]) oid[i][1], // expected array
                            decoded));
View Full Code Here

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

    }

    public void test_MappingToString() throws IOException {

        // oid decoder/encoder for testing
        ASN1Oid asn1 = ASN1Oid.getInstanceForString();
       
        // testing decoding
        for (int i = 0; i < oid.length; i++) {
            assertEquals("Failed to decode oid: " + oid[i][0], // error message
                    oid[i][0], // expected string
                    asn1.decode(new DerInputStream((byte[]) oid[i][2])));
        }

        // testing encoding
        for (int i = 0; i < oid.length; i++) {
            assertTrue("Failed to encode oid: " + oid[i][0], // error message
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.