issrg.ac
Class ObjectDigestInfo

java.lang.Object
  extended by issrg.ac.ObjectDigestInfo
All Implemented Interfaces:
java.lang.Cloneable

public class ObjectDigestInfo
extends java.lang.Object
implements java.lang.Cloneable

This class represents the ObjectDigestInfo ASN.1 construct.


Field Summary
protected  java.lang.String digestAlgorithm
           
protected  int digestedObjectType
           
protected  BIT_STRING objectDigest
           
static int OTHER_OBJECT_TYPES
          This constant defines the context tag for OTHER_OBJECT_TYPES objects.
protected  java.lang.String otherObjectTypeID
           
static int PUBLIC_KEY
          This constant defines the context tag for PUBLIC_KEY objects.
static int PUBLIC_KEY_CERT
          This constant defines the context tag for PUBLIC_KEY_CERT objects.
 
Constructor Summary
protected ObjectDigestInfo()
           
  ObjectDigestInfo(int digestedObjectType, java.lang.String otherObjectTypeID, java.lang.String digestAlgorithm, BIT_STRING objectDigest)
          This constructor is used to construct an ObjectDigestInfo object out of the specified components.
  ObjectDigestInfo(ObjectDigestInfo odi)
          This constructor copies a given ObjectDigestInfo.
 
Method Summary
 java.lang.Object clone()
           
 void decode(ASN1Object ao)
          This method decodes a given ASN1Object and sets the contents from it.
 java.lang.String getDigestAlgorithmID()
          Returns the OID of the digest algorithm in the dotted form.
 BIT_STRING getObjectDigest()
          Returns the Bit String of the digest of the object.
 int getObjectType()
          Returns Digested Object Type.
 java.lang.String getOtherObjectType()
          Returns the OID of the digested object Type, if it is not a public key or PKC; in the latter case it is null.
 void setDigestAlgorithmID(java.lang.String oid)
          Sets the OID of the digest algorithm in the dotted form.
 void setObjectDigest(BIT_STRING objectDigest)
          Returns the Bit String of the digest of the object.
 void setObjectType(int objectType)
          Sets Digested Object Type.
 void setOtherObjectType(java.lang.String oid)
          Sets the OID of the digested object Type, if it is not a public key or PKC.
 ASN1Object toASN1Object()
          This method returns the ASN1Object of this ObjectDigestInfo.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String indent)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PUBLIC_KEY

public static final int PUBLIC_KEY
This constant defines the context tag for PUBLIC_KEY objects.

See Also:
Constant Field Values

PUBLIC_KEY_CERT

public static final int PUBLIC_KEY_CERT
This constant defines the context tag for PUBLIC_KEY_CERT objects.

See Also:
Constant Field Values

OTHER_OBJECT_TYPES

public static final int OTHER_OBJECT_TYPES
This constant defines the context tag for OTHER_OBJECT_TYPES objects.

See Also:
Constant Field Values

digestedObjectType

protected int digestedObjectType

otherObjectTypeID

protected java.lang.String otherObjectTypeID

digestAlgorithm

protected java.lang.String digestAlgorithm

objectDigest

protected BIT_STRING objectDigest
Constructor Detail

ObjectDigestInfo

protected ObjectDigestInfo()

ObjectDigestInfo

public ObjectDigestInfo(int digestedObjectType,
                        java.lang.String otherObjectTypeID,
                        java.lang.String digestAlgorithm,
                        BIT_STRING objectDigest)
This constructor is used to construct an ObjectDigestInfo object out of the specified components.

Parameters:
digestedObjectType - can be one of the values: PUBLIC_KEY, PUBLIC_KEY_CERT or OTHER_OBJECT_TYPES
otherObjectTypeID - must contain the value of the ObjectID if the digestedObjectType is OTHER_OBJECT_TYPES
digestAlgorithm - must be the dotted form of the OID of the algorithm
objectDigest - is the bit string of the object digest value

ObjectDigestInfo

public ObjectDigestInfo(ObjectDigestInfo odi)
This constructor copies a given ObjectDigestInfo.

Parameters:
odi - - the ObjectDigestInfo to copy
Method Detail

getObjectType

public int getObjectType()
Returns Digested Object Type. See PUBLIC_KEY, PUBLIC_KEY_CERT and OTHER_OBJECT_TYPES.


setObjectType

public void setObjectType(int objectType)
Sets Digested Object Type. See PUBLIC_KEY, PUBLIC_KEY_CERT and OTHER_OBJECT_TYPES.

You have to set the type of the object, unless you did so by passing a correct value to the constructor.


getOtherObjectType

public java.lang.String getOtherObjectType()
Returns the OID of the digested object Type, if it is not a public key or PKC; in the latter case it is null.


setOtherObjectType

public void setOtherObjectType(java.lang.String oid)
Sets the OID of the digested object Type, if it is not a public key or PKC. Can be null.


getDigestAlgorithmID

public java.lang.String getDigestAlgorithmID()
Returns the OID of the digest algorithm in the dotted form.


setDigestAlgorithmID

public void setDigestAlgorithmID(java.lang.String oid)
Sets the OID of the digest algorithm in the dotted form.


getObjectDigest

public BIT_STRING getObjectDigest()
Returns the Bit String of the digest of the object.


setObjectDigest

public void setObjectDigest(BIT_STRING objectDigest)
Returns the Bit String of the digest of the object.


toASN1Object

public ASN1Object toASN1Object()
                        throws CodingException
This method returns the ASN1Object of this ObjectDigestInfo.

Returns:
SEQUENCE of object type, the digest algorithm identifier and the actual object digest; if object type is OTHER_OBJECT_TYPES, then the ObjectID of that object type is also added before the digest algorithm identifier
Throws:
CodingException

decode

public void decode(ASN1Object ao)
            throws CodingException
This method decodes a given ASN1Object and sets the contents from it. It must be a SEQUENCE of object type, digest algorithm identifier and the actual digest of the object; for OTHER_OBJECT_TYPES there must be the ObjectID of the object type before the digest algorithm identifier.

Parameters:
ao - - the ASN1Object to decode
Throws:
CodingException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String indent)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object