com.ibm.security12.sun.security.pkcs
Class PKCS10Attributes

java.lang.Object
  |
  +--com.ibm.security12.sun.security.pkcs.PKCS10Attributes

public class PKCS10Attributes
extends Object
implements DerEncoder

This class defines the PKCS10 attributes for the request. The ASN.1 syntax for this is:

 Attributes ::= SET OF Attribute
 

Version:
1.13
Author:
Amit Kapoor, Hemma Prafullchandra
See Also:
PKCS10, PKCS10Attribute

Constructor Summary
PKCS10Attributes()
          Default constructor for the PKCS10 attribute.
PKCS10Attributes(DerInputStream in)
          Create the object, decoding the values from the passed DER stream.
PKCS10Attributes(PKCS10Attribute[] attrs)
          Create the object from the array of PKCS10Attribute objects.
 
Method Summary
 void deleteAttribute(String name)
          Delete the attribute value.
 void derEncode(OutputStream out)
          Encode the attributes in DER form to the stream.
 void encode(OutputStream out)
          Encode the attributes in DER form to the stream.
 boolean equals(Object other)
          Compares this PKCS10Attributes for equality with the specified object.
 Object getAttribute(String name)
          Get the attribute value.
 Collection getAttributes()
          Return a Collection of attributes existing within this PKCS10Attributes object.
 Enumeration getElements()
          Return an enumeration of names of attributes existing within this attribute.
 int hashCode()
          Returns a hashcode value for this PKCS10Attributes.
 void setAttribute(String name, Object obj)
          Set the attribute value.
 String toString()
          Returns a string representation of this PKCS10Attributes object in the form of a set of entries, enclosed in braces and separated by the ASCII characters "" (comma and space).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PKCS10Attributes

public PKCS10Attributes()
Default constructor for the PKCS10 attribute.

PKCS10Attributes

public PKCS10Attributes(PKCS10Attribute[] attrs)
Create the object from the array of PKCS10Attribute objects.
Parameters:
attrs - the array of PKCS10Attribute objects.

PKCS10Attributes

public PKCS10Attributes(DerInputStream in)
                 throws IOException
Create the object, decoding the values from the passed DER stream. The DER stream contains the SET OF Attribute.
Parameters:
in - the DerInputStream to read the attributes from.
Throws:
IOException - on decoding errors.
Method Detail

encode

public void encode(OutputStream out)
            throws IOException
Encode the attributes in DER form to the stream.
Parameters:
out - the OutputStream to marshal the contents to.
Throws:
IOException - on encoding errors.

derEncode

public void derEncode(OutputStream out)
               throws IOException
Encode the attributes in DER form to the stream. Implements the DerEncoder interface.
Specified by:
derEncode in interface DerEncoder
Parameters:
out - the OutputStream to marshal the contents to.
Throws:
IOException - on encoding errors.

setAttribute

public void setAttribute(String name,
                         Object obj)
Set the attribute value.

getAttribute

public Object getAttribute(String name)
Get the attribute value.

deleteAttribute

public void deleteAttribute(String name)
Delete the attribute value.

getElements

public Enumeration getElements()
Return an enumeration of names of attributes existing within this attribute.

getAttributes

public Collection getAttributes()
Return a Collection of attributes existing within this PKCS10Attributes object.

equals

public boolean equals(Object other)
Compares this PKCS10Attributes for equality with the specified object. If the other object is an instanceof PKCS10Attributes, then all the entries are compared with the entries from this.
Parameters:
other - the object to test for equality with this PKCS10Attributes.
Returns:
true iff all the entries match that of the Other, false otherwise.
Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hashcode value for this PKCS10Attributes.
Returns:
the hashcode value.
Overrides:
hashCode in class Object

toString

public String toString()
Returns a string representation of this PKCS10Attributes object in the form of a set of entries, enclosed in braces and separated by the ASCII characters "" (comma and space).

Overrides the toString method of Object.

Returns:
a string representation of this PKCS10Attributes.
Overrides:
toString in class Object