org.bouncycastle.asn1.x509

Class ObjectDigestInfo

public class ObjectDigestInfo extends ASN1Encodable

ObjectDigestInfo ASN.1 structure used in v2 attribute certificates.
  
    ObjectDigestInfo ::= SEQUENCE {
         digestedObjectType  ENUMERATED {
                 publicKey            (0),
                 publicKeyCert        (1),
                 otherObjectTypes     (2) },
                         -- otherObjectTypes MUST NOT
                         -- be used in this profile
         otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
         digestAlgorithm     AlgorithmIdentifier,
         objectDigest        BIT STRING
    }
   
 
Field Summary
static intotherObjectDigest
An other object is hashed.
static intpublicKey
The public key is hashed.
static intpublicKeyCert
The public key certificate is hashed.
Constructor Summary
ObjectDigestInfo(int digestedObjectType, String otherObjectTypeID, AlgorithmIdentifier digestAlgorithm, byte[] objectDigest)
Constructor from given details.
Method Summary
AlgorithmIdentifiergetDigestAlgorithm()
DEREnumeratedgetDigestedObjectType()
static ObjectDigestInfogetInstance(Object obj)
static ObjectDigestInfogetInstance(ASN1TaggedObject obj, boolean explicit)
DERBitStringgetObjectDigest()
DERObjectIdentifiergetOtherObjectTypeID()
DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.

Field Detail

otherObjectDigest

public static final int otherObjectDigest
An other object is hashed.

publicKey

public static final int publicKey
The public key is hashed.

publicKeyCert

public static final int publicKeyCert
The public key certificate is hashed.

Constructor Detail

ObjectDigestInfo

public ObjectDigestInfo(int digestedObjectType, String otherObjectTypeID, AlgorithmIdentifier digestAlgorithm, byte[] objectDigest)
Constructor from given details.

If digestedObjectType is not publicKeyCert or publicKey otherObjectTypeID must be given, otherwise it is ignored.

Parameters: digestedObjectType The digest object type. otherObjectTypeID The object type ID for otherObjectDigest. digestAlgorithm The algorithm identifier for the hash. objectDigest The hash value.

Method Detail

getDigestAlgorithm

public AlgorithmIdentifier getDigestAlgorithm()

getDigestedObjectType

public DEREnumerated getDigestedObjectType()

getInstance

public static ObjectDigestInfo getInstance(Object obj)

getInstance

public static ObjectDigestInfo getInstance(ASN1TaggedObject obj, boolean explicit)

getObjectDigest

public DERBitString getObjectDigest()

getOtherObjectTypeID

public DERObjectIdentifier getOtherObjectTypeID()

toASN1Object

public DERObject toASN1Object()
Produce an object suitable for an ASN1OutputStream.
  
    ObjectDigestInfo ::= SEQUENCE {
         digestedObjectType  ENUMERATED {
                 publicKey            (0),
                 publicKeyCert        (1),
                 otherObjectTypes     (2) },
                         -- otherObjectTypes MUST NOT
                         -- be used in this profile
         otherObjectTypeID   OBJECT IDENTIFIER OPTIONAL,
         digestAlgorithm     AlgorithmIdentifier,
         objectDigest        BIT STRING
    }