com.ibm.security.pkcs9
Class ExtendedCertificateAttributes

java.lang.Object
  |
  +--com.ibm.security.pkcsutil.PKCSDerObject
        |
        +--com.ibm.security.pkcs9.PKCS9DerObject
              |
              +--com.ibm.security.pkcs9.ExtendedCertificateAttributes

public final class ExtendedCertificateAttributes
extends PKCS9DerObject
implements Cloneable

Implements the ASN.1 ExtendedCertificateAttributes type.

An ExtendedCertificateAttributes attribute must have a single attribute value.

ExtendedCertificateAttributes ::= Attributes

ExtendedCertificateAttributes objects are immutable; they cannot be changed once created.


Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject
provider
 
Constructor Summary
ExtendedCertificateAttributes(byte[] der)
          Create an ExtendedCertificateAttributes object with a DER byte array.
ExtendedCertificateAttributes(byte[] der, String provider)
          Create an ExtendedCertificateAttributes object with a DER byte array.
ExtendedCertificateAttributes(PKCSAttribute attribute)
          Create an ExtendedCertificateAttributes object with a PKCSAttribute as the only element of the set of attributes.
ExtendedCertificateAttributes(PKCSAttributes attributes)
          Create an ExtendedCertificateAttributes object with a PKCSAttributes object.
ExtendedCertificateAttributes(PKCSAttributes attributes, String provider)
          Create an ExtendedCertificateAttributes object with a PKCSAttributes object.
ExtendedCertificateAttributes(PKCSAttribute attribute, String provider)
          Create an ExtendedCertificateAttributes object with a PKCSAttribute as the only element of the set of attributes.
ExtendedCertificateAttributes(String filename, boolean base64)
          Create an ExtendedCertificateAttributes with the filename of the DER-encoded or BASE64-encoded object.
ExtendedCertificateAttributes(String filename, boolean base64, String provider)
          Create an ExtendedCertificateAttributes with the filename of the DER-encoded or BASE64-encoded object.
 
Method Summary
 Object clone()
          Creates a clone of this ExtendedCertificateAttributes object.
protected  void decode(com.ibm.security.pkcs9.DerValue encoding)
          Initializes an ExtendedCertificateAttributes object from a DerValue.
 void encode(OutputStream os)
          Encodes this object to an OutputStream.
 boolean equals(Object obj)
          Determines if this ExtendedCertificateAttributes object is equivalent to * the input object.
 String getAttributeName()
          Returns a String indicating the name of the attribute.
 PKCSAttributes getExtendedCertificateAttributes()
          Returns a reference to the attributes object for this ExtendedCertificateAttributes object.
 ObjectIdentifier getObjectIdentifier()
          Returns the ObjectIdentifer for the ExtendedCertificateAttributes attribute.
 Object getValue()
          Calls the getExtendedCertificateAttributes method.
 boolean isSingleValued()
          Returns true.
 boolean isTagValid(byte tag)
          Returns a boolean indicating if the tag is valid for this object.
 String toString()
          Returns a string representation of this ExtendedCertificateAttributes object.
 
Methods inherited from class com.ibm.security.pkcs9.PKCS9DerObject
getName, getOID, getPKCSAttribute
 
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject
decode, decode, encode, hashCode, read, readBASE64, write, write, writeBASE64
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(byte[] der)
                              throws IOException
Create an ExtendedCertificateAttributes object with a DER byte array.
Parameters:
der - a DER byte array of an ExtendedCertificateAttributes object.
Throws:
IOException - on decoding errors.

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(byte[] der,
                                     String provider)
                              throws IOException
Create an ExtendedCertificateAttributes object with a DER byte array.
Parameters:
der - a DER byte array of an ExtendedCertificateAttributes object.
provider - the provider to be used.
Throws:
IOException - on decoding errors.

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(PKCSAttribute attribute)
Create an ExtendedCertificateAttributes object with a PKCSAttribute as the only element of the set of attributes.
Parameters:
attribute - PKCSAttribute

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(PKCSAttribute attribute,
                                     String provider)
Create an ExtendedCertificateAttributes object with a PKCSAttribute as the only element of the set of attributes.
Parameters:
attribute - PKCSAttribute
provider - the provider to be used

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(PKCSAttributes attributes)
Create an ExtendedCertificateAttributes object with a PKCSAttributes object.
Parameters:
attributes - PKCSAttributes

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(PKCSAttributes attributes,
                                     String provider)
Create an ExtendedCertificateAttributes object with a PKCSAttributes object.
Parameters:
attributes - PKCSAttributes
provider - the provider to be used

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(String filename,
                                     boolean base64)
                              throws IOException
Create an ExtendedCertificateAttributes with the filename of the DER-encoded or BASE64-encoded object.
Parameters:
filename - name of the DER-encoded or base64-encoded object
base64 - true if BASE64-encoded, false if DER-encoded
Throws:
IOException - on decoding errors.

ExtendedCertificateAttributes

public ExtendedCertificateAttributes(String filename,
                                     boolean base64,
                                     String provider)
                              throws IOException
Create an ExtendedCertificateAttributes with the filename of the DER-encoded or BASE64-encoded object.
Parameters:
filename - name of the DER-encoded or base64-encoded object
base64 - true if BASE64-encoded, false if DER-encoded
provider - the provider to be used
Throws:
IOException - on decoding errors.
Method Detail

clone

public Object clone()
Creates a clone of this ExtendedCertificateAttributes object.
Overrides:
clone in class Object
Returns:
clone of this ExtendedCertificateAttributes object.

equals

public boolean equals(Object obj)
Determines if this ExtendedCertificateAttributes object is equivalent to * the input object.
Overrides:
equals in class PKCSDerObject
Parameters:
other - the object to compare this one to.
Returns:
true, if the two objects are equivalent, false otherwise.

getObjectIdentifier

public ObjectIdentifier getObjectIdentifier()
Returns the ObjectIdentifer for the ExtendedCertificateAttributes attribute.
Overrides:
getObjectIdentifier in class PKCSDerObject
Returns:
the ObjectIdentifer for the ExtendedCertificateAttributes attribute.

encode

public void encode(OutputStream os)
            throws IOException
Encodes this object to an OutputStream.
Overrides:
encode in class PKCSDerObject
Parameters:
os - the OutputStream to write the encoded data to.
Throws:
IOException - on encoding errors.

getExtendedCertificateAttributes

public PKCSAttributes getExtendedCertificateAttributes()
Returns a reference to the attributes object for this ExtendedCertificateAttributes object. The attributes object is immutable.
Returns:
PKCSAttributes object

getValue

public Object getValue()
Calls the getExtendedCertificateAttributes method. Standard method to access the value of the PKCS #9 object.
Overrides:
getValue in class PKCS9DerObject

isTagValid

public boolean isTagValid(byte tag)
Returns a boolean indicating if the tag is valid for this object. The ExtendedCertificateAttributes object does not have a primative tag type. Instead it relies upon the top level tag for the PKCSAttributes object.
Overrides:
isTagValid in class PKCS9DerObject
Returns:
true if tag_Sequence, false otherwise.

isSingleValued

public boolean isSingleValued()
Returns true. ExtendedCertificateAttributes must have a single attribute value.
Overrides:
isSingleValued in class PKCS9DerObject
Returns:
true

getAttributeName

public String getAttributeName()
Returns a String indicating the name of the attribute.
Overrides:
getAttributeName in class PKCS9DerObject
Returns:
name of the ExtendedCertificateAttributes attribute.

toString

public String toString()
Returns a string representation of this ExtendedCertificateAttributes object.
Overrides:
toString in class PKCSDerObject
Returns:
a string representation of this object.

decode

protected void decode(com.ibm.security.pkcs9.DerValue encoding)
               throws IOException
Initializes an ExtendedCertificateAttributes object from a DerValue. The DER encoding must be in the format specified by the ExtendedCertificateAttributes ASN.1 notation.
Overrides:
decode in class PKCS9DerObject
Parameters:
encoding - a DER-encoded ExtendedCertificateAttributes object.
Throws:
IOException - on parsing error.