com.ibm.security12.sun.security.x509
Interface CertAttrSet

All Known Implementing Classes:
AuthorityKeyIdentifierExtension, BasicConstraintsExtension, CertificateAlgorithmId, CertificateExtensions, CertificateIssuerName, CertificateIssuerUniqueIdentity, CertificateSerialNumber, CertificateSubjectName, CertificateSubjectUniqueIdentity, CertificateValidity, CertificateVersion, CertificateX509Key, CRLNumberExtension, CRLReasonCodeExtension, IssuerAlternativeNameExtension, KeyUsageExtension, NameConstraintsExtension, NetscapeCertTypeExtension, PolicyConstraintsExtension, PolicyMappingsExtension, PrivateKeyUsageExtension, SubjectAlternativeNameExtension, X509CertInfo, SubjectKeyIdentifierExtension

public abstract interface CertAttrSet

This interface defines the methods required of a certificate attribute. Examples of X.509 certificate attributes are Validity, Issuer_Name, and Subject Name. A CertAttrSet may comprise one attribute or many attributes.

A CertAttrSet itself can also be comprised of other sub-sets. In the case of X.509 V3 certificates, for example, the "extensions" attribute has subattributes, such as those for KeyUsage and AuthorityKeyIdentifier.

Version:
1.11
Author:
Amit Kapoor, Hemma Prafullchandra
See Also:
CertificateException

Method Summary
 void decode(InputStream in)
          Decodes the attribute in the input stream.
 void delete(String name)
          Deletes an attribute value from this CertAttrSet.
 void encode(OutputStream out)
          Encodes the attribute to the output stream in a format that can be parsed by the decode method.
 Object get(String name)
          Gets an attribute value for this CertAttrSet.
 Enumeration getElements()
          Returns an enumeration of the names of the attributes existing within this attribute.
 String getName()
          Returns the name (identifier) of this CertAttrSet.
 void set(String name, Object obj)
          Sets an attribute value within this CertAttrSet.
 String toString()
          Returns a short string describing this certificate attribute.
 

Method Detail

toString

public String toString()
Returns a short string describing this certificate attribute.
Returns:
value of this certificate attribute in printable form.
Overrides:
toString in class Object

encode

public void encode(OutputStream out)
            throws CertificateException,
                   IOException
Encodes the attribute to the output stream in a format that can be parsed by the decode method.
Parameters:
out - the OutputStream to encode the attribute to.
Throws:
CertificateException - on encoding or validity errors.
IOException - on other errors.

decode

public void decode(InputStream in)
            throws CertificateException,
                   IOException
Decodes the attribute in the input stream.
Parameters:
in - the InputStream to read the encoded attribute from.
Throws:
CertificateException - on decoding or validity errors.
IOException - on other errors.

set

public void set(String name,
                Object obj)
         throws CertificateException,
                IOException
Sets an attribute value within this CertAttrSet.
Parameters:
name - the name of the attribute (e.g. "x509.info.key")
obj - the attribute object.
Throws:
CertificateException - on attribute handling errors.
IOException - on other errors.

get

public Object get(String name)
           throws CertificateException,
                  IOException
Gets an attribute value for this CertAttrSet.
Parameters:
name - the name of the attribute to return.
Throws:
CertificateException - on attribute handling errors.
IOException - on other errors.

delete

public void delete(String name)
            throws CertificateException,
                   IOException
Deletes an attribute value from this CertAttrSet.
Parameters:
name - the name of the attribute to delete.
Throws:
CertificateException - on attribute handling errors.
IOException - on other errors.

getElements

public Enumeration getElements()
Returns an enumeration of the names of the attributes existing within this attribute.
Returns:
an enumeration of the attribute names.

getName

public String getName()
Returns the name (identifier) of this CertAttrSet.
Returns:
the name of this CertAttrSet.