FileDocCategorySizeDatePackage
Holder.javaAPI DocAndroid 1.5 API3343Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509

Holder

public class Holder extends org.bouncycastle.asn1.ASN1Encodable
The Holder object.
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
}

Fields Summary
IssuerSerial
baseCertificateID
GeneralNames
entityName
ObjectDigestInfo
objectDigestInfo
Constructors Summary
public Holder(org.bouncycastle.asn1.ASN1Sequence seq)

        if (seq.size() > 3)
        {
            throw new IllegalArgumentException("Bad sequence size: "
                    + seq.size());
        }

        for (int i = 0; i != seq.size(); i++)
        {
            ASN1TaggedObject    tObj = ASN1TaggedObject.getInstance(seq.getObjectAt(i));
            
            switch (tObj.getTagNo())
            {
            case 0:
                baseCertificateID = IssuerSerial.getInstance(tObj, false);
                break;
            case 1:
                entityName = GeneralNames.getInstance(tObj, false);
                break;
            case 2:
                objectDigestInfo = ObjectDigestInfo.getInstance(tObj, false);
                break;
            default:
                throw new IllegalArgumentException("unknown tag in Holder");
            }
        }
    
public Holder(IssuerSerial baseCertificateID)

        this.baseCertificateID = baseCertificateID;
    
public Holder(GeneralNames entityName)

        this.entityName = entityName;
    
Methods Summary
public IssuerSerialgetBaseCertificateID()

        return baseCertificateID;
    
public GeneralNamesgetEntityName()

        return entityName;
    
public static org.bouncycastle.asn1.x509.HoldergetInstance(java.lang.Object obj)

        if (obj instanceof Holder)
        {
            return (Holder)obj;
        }
        else if (obj instanceof ASN1Sequence)
        {
            return new Holder((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public ObjectDigestInfogetObjectDigestInfo()

        return objectDigestInfo;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector  v = new ASN1EncodableVector();

        if (baseCertificateID != null)
        {
            v.add(new DERTaggedObject(false, 0, baseCertificateID));
        }

        if (entityName != null)
        {
            v.add(new DERTaggedObject(false, 1, entityName));
        }

        if (objectDigestInfo != null)
        {
            v.add(new DERTaggedObject(false, 2, objectDigestInfo));
        }

        return new DERSequence(v);