org.bouncycastle.asn1.x509

## Class Holder

- java.lang.Object
- - org.bouncycastle.asn1.ASN1Encodable
  - - org.bouncycastle.asn1.x509.Holder

All Implemented Interfaces:
  DEREncodable

    public class Holder
    extends ASN1Encodable

The Holder object.

For an v2 attribute certificate this is:

                Holder ::= SEQUENCE {
                      baseCertificateID   [0] IssuerSerial OPTIONAL,
                               -- the issuer and serial number of
                               -- the holder's Public Key Certificate
                      entityName          [1] GeneralNames OPTIONAL,
                               -- the name of the claimant or role
                      objectDigestInfo    [2] ObjectDigestInfo OPTIONAL
                               -- used to directly authenticate the holder,
                               -- for example, an executable
                }

For an v1 attribute certificate this is:

             subject CHOICE {
              baseCertificateID [0] IssuerSerial,
              -- associated with a Public Key Certificate
              subjectName [1] GeneralNames },
              -- associated with a name

### Field Summary

### Fields inherited from class org.bouncycastle.asn1.ASN1Encodable

`BER, DER`

### Constructor Summary

Constructors
Constructor and Description
`Holder(ASN1Sequence seq)` Constructor for a holder for an v2 attribute certificate
`Holder(ASN1TaggedObject tagObj)` Constructor for a holder for an v1 attribute certificate.
`Holder(GeneralNames entityName)` Constructs a holder with an entityName for v2 attribute certificates or with a subjectName for v1 attribute certificates.
`Holder(GeneralNames entityName, int version)` Constructs a holder with an entityName for v2 attribute certificates or with a subjectName for v1 attribute certificates.
`Holder(IssuerSerial baseCertificateID)`
`Holder(IssuerSerial baseCertificateID, int version)` Constructs a holder from a IssuerSerial.
`Holder(ObjectDigestInfo objectDigestInfo)` Constructs a holder from an object digest info.

### Method Summary

Methods
`IssuerSerial` `getBaseCertificateID()`
`GeneralNames` `getEntityName()` Returns the entityName for an v2 attribute certificate or the subjectName for an v1 attribute certificate.
`static Holder` `getInstance(java.lang.Object obj)`
`ObjectDigestInfo` `getObjectDigestInfo()`
`int` `getVersion()` Returns 1 for v2 attribute certificates or 0 for v1 attribute certificates.
`DERObject` `toASN1Object()`

### Methods inherited from class org.bouncycastle.asn1.ASN1Encodable

`equals, getDEREncoded, getDERObject, getEncoded, getEncoded, hashCode`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Holder

    public Holder(ASN1TaggedObject tagObj)

Constructor for a holder for an v1 attribute certificate.

Parameters:
  `tagObj` - The ASN.1 tagged holder object.

#### Holder

    public Holder(ASN1Sequence seq)

Constructor for a holder for an v2 attribute certificate. *

Parameters:
  `seq` - The ASN.1 sequence.

#### Holder

    public Holder(IssuerSerial baseCertificateID)

#### Holder

    public Holder(IssuerSerial baseCertificateID,
          int version)

Constructs a holder from a IssuerSerial.

Parameters:
  `baseCertificateID` - The IssuerSerial.
  `version` - The version of the attribute certificate.

#### Holder

    public Holder(GeneralNames entityName)

Constructs a holder with an entityName for v2 attribute certificates or with a subjectName for v1 attribute certificates.

Parameters:
  `entityName` - The entity or subject name.

#### Holder

    public Holder(GeneralNames entityName,
          int version)

Constructs a holder with an entityName for v2 attribute certificates or with a subjectName for v1 attribute certificates.

Parameters:
  `entityName` - The entity or subject name.
  `version` - The version of the attribute certificate.

#### Holder

    public Holder(ObjectDigestInfo objectDigestInfo)

Constructs a holder from an object digest info.

Parameters:
  `objectDigestInfo` - The object digest info object.

### Method Detail

#### getInstance

    public static Holder getInstance(java.lang.Object obj)

#### getVersion

    public int getVersion()

Returns 1 for v2 attribute certificates or 0 for v1 attribute certificates.

Returns:
  The version of the attribute certificate.

#### getBaseCertificateID

    public IssuerSerial getBaseCertificateID()

#### getEntityName

    public GeneralNames getEntityName()

Returns the entityName for an v2 attribute certificate or the subjectName for an v1 attribute certificate.

Returns:
  The entityname or subjectname.

#### getObjectDigestInfo

    public ObjectDigestInfo getObjectDigestInfo()

#### toASN1Object

    public DERObject toASN1Object()

Specified by:
  `toASN1Object` in class `ASN1Encodable`