com.ibm.security.pkcs9
Class PKCS9DerObject

java.lang.Object
  |
  +--com.ibm.security.pkcsutil.PKCSDerObject
        |
        +--com.ibm.security.pkcs9.PKCS9DerObject
Direct Known Subclasses:
ChallengePassword, ContentType, Countersignature, EmailAddress, ExtendedCertificateAttributes, FriendlyName, LocalKeyId, MessageDigest, SigningTime, UnstructuredAddress, UnstructuredName

public abstract class PKCS9DerObject
extends PKCSDerObject
implements Cloneable

Abstract class inherited by other PKCS #9 attribute objects.


Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject
provider
 
Constructor Summary
protected PKCS9DerObject()
           
  PKCS9DerObject(byte[] der)
          Create a PKCS9DerObject subclass with a DER byte array.
  PKCS9DerObject(byte[] der, String provider)
          Create a PKCS9DerObject subclass with a DER byte array.
protected PKCS9DerObject(String provider)
           
  PKCS9DerObject(String filename, boolean base64)
          Create a PKCS9DerObject with the filename of the DER-encoded or BASE64-encoded object.
  PKCS9DerObject(String filename, boolean base64, String provider)
          Create a PKCS9DerObject with the filename of the DER-encoded or BASE64-encoded object.
 
Method Summary
protected  void decode(com.ibm.security.pkcs9.DerValue encoding)
           
abstract  String getAttributeName()
          Returns a String indicating the name of the attribute.
 String getName()
          Return the name of this attribute.
 ObjectIdentifier getOID()
          Return the OID of this attribute.
 PKCSAttribute getPKCSAttribute()
          Returns a PKCSAttribute based on this PKCS9DerObject values.
abstract  Object getValue()
          Returns the value of the attribute.
abstract  boolean isSingleValued()
          Returns a boolean indicating if the PKCS #9 attribute is single valued or multivalued.
abstract  boolean isTagValid(byte tag)
          Returns a boolean indicating if the tag is valid for the PKCS #9 attribute.
 
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject
decode, decode, encode, encode, equals, getObjectIdentifier, hashCode, read, readBASE64, toString, write, write, writeBASE64
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PKCS9DerObject

protected PKCS9DerObject()

PKCS9DerObject

protected PKCS9DerObject(String provider)

PKCS9DerObject

public PKCS9DerObject(byte[] der)
               throws IOException
Create a PKCS9DerObject subclass with a DER byte array.

PKCS9DerObject

public PKCS9DerObject(byte[] der,
                      String provider)
               throws IOException
Create a PKCS9DerObject subclass with a DER byte array.

PKCS9DerObject

public PKCS9DerObject(String filename,
                      boolean base64)
               throws IOException
Create a PKCS9DerObject 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.

PKCS9DerObject

public PKCS9DerObject(String filename,
                      boolean base64,
                      String provider)
               throws IOException
Create a PKCS9DerObject 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

getOID

public ObjectIdentifier getOID()
Return the OID of this attribute. Calls the object's getObjectIdentifier method.

getName

public String getName()
Return the name of this attribute. Calls the object's getAttributeName method.

getPKCSAttribute

public PKCSAttribute getPKCSAttribute()
                               throws IOException
Returns a PKCSAttribute based on this PKCS9DerObject values.

decode

protected void decode(com.ibm.security.pkcs9.DerValue encoding)
               throws IOException

isTagValid

public abstract boolean isTagValid(byte tag)
Returns a boolean indicating if the tag is valid for the PKCS #9 attribute.

isSingleValued

public abstract boolean isSingleValued()
Returns a boolean indicating if the PKCS #9 attribute is single valued or multivalued.

getAttributeName

public abstract String getAttributeName()
Returns a String indicating the name of the attribute.

getValue

public abstract Object getValue()
Returns the value of the attribute. The object returned depends on the attribute type.