0N/A/*
2362N/A * Copyright (c) 1997, 2003, 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/Aimport java.io.OutputStream;
0N/Aimport java.security.cert.CertificateException;
0N/Aimport java.util.Enumeration;
0N/A
0N/A/**
0N/A * This interface defines the methods required of a certificate attribute.
0N/A * Examples of X.509 certificate attributes are Validity, Issuer_Name, and
0N/A * Subject Name. A CertAttrSet may comprise one attribute or many
0N/A * attributes.
0N/A * <p>
0N/A * A CertAttrSet itself can also be comprised of other sub-sets.
0N/A * In the case of X.509 V3 certificates, for example, the "extensions"
0N/A * attribute has subattributes, such as those for KeyUsage and
0N/A * AuthorityKeyIdentifier.
0N/A *
0N/A * @author Amit Kapoor
0N/A * @author Hemma Prafullchandra
0N/A * @see CertificateException
0N/A */
0N/Apublic interface CertAttrSet<T> {
0N/A /**
0N/A * Returns a short string describing this certificate attribute.
0N/A *
0N/A * @return value of this certificate attribute in
0N/A * printable form.
0N/A */
0N/A String toString();
0N/A
0N/A /**
0N/A * Encodes the attribute to the output stream in a format
0N/A * that can be parsed by the <code>decode</code> method.
0N/A *
0N/A * @param out the OutputStream to encode the attribute to.
0N/A *
0N/A * @exception CertificateException on encoding or validity errors.
0N/A * @exception IOException on other errors.
0N/A */
0N/A void encode(OutputStream out)
0N/A throws CertificateException, IOException;
0N/A
0N/A /**
0N/A * Sets an attribute value within this CertAttrSet.
0N/A *
0N/A * @param name the name of the attribute (e.g. "x509.info.key")
0N/A * @param obj the attribute object.
0N/A *
0N/A * @exception CertificateException on attribute handling errors.
0N/A * @exception IOException on other errors.
0N/A */
0N/A void set(String name, Object obj)
0N/A throws CertificateException, IOException;
0N/A
0N/A /**
0N/A * Gets an attribute value for this CertAttrSet.
0N/A *
0N/A * @param name the name of the attribute to return.
0N/A *
0N/A * @exception CertificateException on attribute handling errors.
0N/A * @exception IOException on other errors.
0N/A */
0N/A Object get(String name)
0N/A throws CertificateException, IOException;
0N/A
0N/A /**
0N/A * Deletes an attribute value from this CertAttrSet.
0N/A *
0N/A * @param name the name of the attribute to delete.
0N/A *
0N/A * @exception CertificateException on attribute handling errors.
0N/A * @exception IOException on other errors.
0N/A */
0N/A void delete(String name)
0N/A throws CertificateException, IOException;
0N/A
0N/A /**
0N/A * Returns an enumeration of the names of the attributes existing within
0N/A * this attribute.
0N/A *
0N/A * @return an enumeration of the attribute names.
0N/A */
0N/A Enumeration<T> getElements();
0N/A
0N/A /**
0N/A * Returns the name (identifier) of this CertAttrSet.
0N/A *
0N/A * @return the name of this CertAttrSet.
0N/A */
0N/A String getName();
0N/A}