Package org.apache.harmony.security.x509

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


                                ? 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


     * @throws IOException
     *             if parsing the name fails.
     */
    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

     * @throws IOException
     *             if the decoding of the name fails.
     */
    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

     * @throws IOException
     *             if parsing fails.
     * @see #setPathToNames
     */
    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

     * @throws IOException
     *             if decoding fails.
     * @see #setPathToNames
     */
    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

    }

    public void test_EncodeDecode() throws IOException {
       
        GeneralNames subj_alt_names = new GeneralNames(Arrays
                .asList(new GeneralName[] { new GeneralName(1, "rfc@822.Name"),
                        new GeneralName(2, "dNSName"),
                        new GeneralName(4, "O=Organization"),
                        new GeneralName(6, "http://uniform.Resource.Id"),
                        new GeneralName(7, "255.255.255.0"),
                        new GeneralName(8, "1.2.3.4444.55555") }));
       
        byte[] encoding = GeneralNames.ASN1.encode(subj_alt_names);
       
        GeneralNames gnames = (GeneralNames) GeneralNames.ASN1.decode(encoding);
       
View Full Code Here

*/
public class GeneralNameTest extends TestCase {

    public void testGeneralName() {
        try {
            GeneralName san0 =
                new GeneralName(new OtherName("1.2.3.4.5", new byte[] {1, 2, 0, 1}));
            GeneralName san1 = new GeneralName(1, "rfc@822.Name");
            GeneralName san2 = new GeneralName(2, "dNSName");
            GeneralName san3 = new GeneralName(new ORAddress());
            GeneralName san4 = new GeneralName(new Name("O=Organization"));
            GeneralName san5 =
                new GeneralName(new EDIPartyName("assigner", "party"));
            GeneralName san6 = new GeneralName(6, "http://uniform.Resource.Id");
            GeneralName san7 = new GeneralName(7, "1.1.1.1");
            GeneralName san8 = new GeneralName(8, "1.2.3.4444.55555");

            GeneralNames sans_1 = new GeneralNames();
            sans_1.addName(san0);
            sans_1.addName(san1);
            sans_1.addName(san2);
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.