0N/A/*
2362N/A * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage sun.security.x509;
0N/A
0N/Aimport java.io.IOException;
0N/A
0N/Aimport sun.security.util.*;
0N/A
0N/A/**
0N/A * This interface specifies the abstract methods which have to be
0N/A * implemented by all the members of the GeneralNames ASN.1 object.
0N/A *
0N/A * @author Amit Kapoor
0N/A * @author Hemma Prafullchandra
0N/A */
0N/Apublic interface GeneralNameInterface {
0N/A /**
0N/A * The list of names supported.
0N/A */
0N/A public static final int NAME_ANY = 0;
0N/A public static final int NAME_RFC822 = 1;
0N/A public static final int NAME_DNS = 2;
0N/A public static final int NAME_X400 = 3;
0N/A public static final int NAME_DIRECTORY = 4;
0N/A public static final int NAME_EDI = 5;
0N/A public static final int NAME_URI = 6;
0N/A public static final int NAME_IP = 7;
0N/A public static final int NAME_OID = 8;
0N/A
0N/A /**
0N/A * The list of constraint results.
0N/A */
0N/A public static final int NAME_DIFF_TYPE = -1; /* input name is different type from name (i.e. does not constrain) */
0N/A public static final int NAME_MATCH = 0; /* input name matches name */
0N/A public static final int NAME_NARROWS = 1; /* input name narrows name */
0N/A public static final int NAME_WIDENS = 2; /* input name widens name */
0N/A public static final int NAME_SAME_TYPE = 3; /* input name does not match, narrow, or widen, but is same type */
0N/A
0N/A /**
0N/A * Return the type of the general name, as
0N/A * defined above.
0N/A */
0N/A int getType();
0N/A
0N/A /**
0N/A * Encode the name to the specified DerOutputStream.
0N/A *
0N/A * @param out the DerOutputStream to encode the GeneralName to.
0N/A * @exception IOException thrown if the GeneralName could not be
0N/A * encoded.
0N/A */
0N/A void encode(DerOutputStream out) throws IOException;
0N/A
0N/A /**
0N/A * Return type of constraint inputName places on this name:<ul>
0N/A * <li>NAME_DIFF_TYPE = -1: input name is different type from name (i.e. does not constrain).
0N/A * <li>NAME_MATCH = 0: input name matches name.
0N/A * <li>NAME_NARROWS = 1: input name narrows name (is lower in the naming subtree)
0N/A * <li>NAME_WIDENS = 2: input name widens name (is higher in the naming subtree)
0N/A * <li>NAME_SAME_TYPE = 3: input name does not match or narrow name, but is same type.
0N/A * </ul>. These results are used in checking NameConstraints during
0N/A * certification path verification.
0N/A *
0N/A * @param inputName to be checked for being constrained
0N/A * @returns constraint type above
0N/A * @throws UnsupportedOperationException if name is same type, but comparison operations are
0N/A * not supported for this name type.
0N/A */
0N/A int constrains(GeneralNameInterface inputName) throws UnsupportedOperationException;
0N/A
0N/A /**
0N/A * Return subtree depth of this name for purposes of determining
0N/A * NameConstraints minimum and maximum bounds and for calculating
0N/A * path lengths in name subtrees.
0N/A *
0N/A * @returns distance of name from root
0N/A * @throws UnsupportedOperationException if not supported for this name type
0N/A */
0N/A int subtreeDepth() throws UnsupportedOperationException;
0N/A}