Package org.apache.harmony.security.x509

Examples of org.apache.harmony.security.x509.GeneralName


                printAsHex(16, "", " ", _encoded);
                System.out.println("");
                pass = false;
            }

            GeneralName gName = new GeneralName(ediPN);
            encoded = gName.getEncoded();
            // manually derived data:
            _encoded = new byte[] {
                (byte) 0xa5, (byte) 0x1d, (byte) 0x80, (byte) 0x0e,
                (byte) 0x13, (byte) 0x0c, (byte) 0x6e, (byte) 0x61,
                (byte) 0x6d, (byte) 0x65, (byte) 0x41, (byte) 0x73,
View Full Code Here


     */
    public void testEDIPartyName2() throws Exception {
        EDIPartyName ediName = new EDIPartyName("assigner", "party");
        byte[] encoding = EDIPartyName.ASN1.encode(ediName);
        EDIPartyName.ASN1.decode(encoding);
        new GeneralName(5, encoding);

        GeneralName gn = new GeneralName(ediName);
      
        new GeneralName(5, gn.getEncodedName());
    }
View Full Code Here

            System.out.println("");
            System.out.println("ORAddress:");
            printAsHex(8, "", " ", ora.getEncoded());
            System.out.println("");
           
            GeneralName gName = new GeneralName(ora);
            System.out.println("GeneralName:");
            printAsHex(8, "", " ", gName.getEncoded());
            System.out.println("");

            GeneralNames gNames = new GeneralNames();
            gNames.addName(gName);
            System.out.println("GeneralNames:");
View Full Code Here

    /**
     * @com.intel.drl.spec_ref
     */
    public void addSubjectAlternativeName(int tag, String name)
                                                       throws IOException {
        GeneralName alt_name = new GeneralName(tag, name);
        // create only if there was not any errors
        if (subjectAltNames == null) {
            subjectAltNames = new ArrayList[9];
        }
        if (subjectAltNames[tag] == null) {
View Full Code Here

    /**
     * @com.intel.drl.spec_ref
     */
    public void addSubjectAlternativeName(int tag, byte[] name)
                                            throws IOException {
        GeneralName alt_name = new GeneralName(tag, name);
        // create only if there was not any errors
        if (subjectAltNames == null) {
            subjectAltNames = new ArrayList[9];
        }
        if (subjectAltNames[tag] == null) {
View Full Code Here

    /**
     * @com.intel.drl.spec_ref
     */
    public void addPathToName(int type, String name) throws IOException {
        GeneralName path_name = new GeneralName(type, name);
        // create only if there was not any errors
        if (pathToNames == null) {
            pathToNames = new ArrayList();
        }
        pathToNames.add(path_name);
View Full Code Here

    /**
     * @com.intel.drl.spec_ref
     */
    public void addPathToName(int type, byte[] name) throws IOException {
        GeneralName path_name= new GeneralName(type, name);
        // create only if there was not any errors
        if (pathToNames == null) {
            pathToNames = new ArrayList();
        }
        pathToNames.add(path_name);
View Full Code Here

            return null;
        }
        ArrayList result = new ArrayList();
        Iterator it = pathToNames.iterator();
        while (it.hasNext()) {
            GeneralName name = (GeneralName) it.next();
            result.add(name.getAsList());
        }
        return result;
    }
View Full Code Here

                                ? new boolean[0]
                                : new boolean[subjectAltNames[i].size()];
                }
                Iterator it = sans.iterator();
                while (it.hasNext()) {
                    GeneralName name = (GeneralName) it.next();
                    int tag = name.getTag();
                    for (int i=0; i<map[tag].length; i++) {
                        if (((GeneralName) subjectAltNames[tag].get(i))
                                                            .equals(name)) {
                            if (!matchAllNames) {
                                break PASSED;
View Full Code Here

        boolean[]   subjectUniqueID = new boolean[]
                    {false, true, false, true, false, true, false, true}; // random value
        // make the Extensions for TBSCertificate
        // Subject Alternative Names
        GeneralName[] san = new GeneralName[] {
            new GeneralName(
                new OtherName("1.2.3.4.5",
                        ASN1Integer.getInstance().encode(
                                BigInteger.valueOf(55L).toByteArray()))),
            new GeneralName(1, "rfc@822.Name"),
            new GeneralName(2, "dNSName"),
            new GeneralName(new ORAddress()),
            new GeneralName(4, "O=Organization"),
            new GeneralName(new EDIPartyName("assigner","party")),
            new GeneralName(6, "http://Resource.Id"),
            new GeneralName(new byte[] {1, 1, 1, 1}),
            new GeneralName(8, "1.2.3.4444.55555")
        };
        GeneralNames sans = new GeneralNames(Arrays.asList(san));
        Extension extension = new Extension("2.5.29.17", true, sans.getEncoded());
        Extensions extensions = new Extensions();
        extensions.addExtension(extension);
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.x509.GeneralName

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.