FileDocCategorySizeDatePackage
ESSCertID.javaAPI DocAndroid 1.5 API2291Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.ess

ESSCertID

public class ESSCertID extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.ASN1OctetString
certHash
private org.bouncycastle.asn1.x509.IssuerSerial
issuerSerial
Constructors Summary
public ESSCertID(org.bouncycastle.asn1.ASN1Sequence seq)
constructor

        if (seq.size() < 1 || seq.size() > 2)
        {
            throw new IllegalArgumentException("Bad sequence size: " + seq.size());
        }

        certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
 
        if (seq.size() > 1)
        {
            issuerSerial = IssuerSerial.getInstance(seq.getObjectAt(1));
        }
    
public ESSCertID(byte[] hash)

        certHash = new DEROctetString(hash);
    
public ESSCertID(byte[] hash, org.bouncycastle.asn1.x509.IssuerSerial issuerSerial)

        this.certHash = new DEROctetString(hash);
        this.issuerSerial = issuerSerial;
    
Methods Summary
public byte[]getCertHash()

        return certHash.getOctets();
    
public static org.bouncycastle.asn1.ess.ESSCertIDgetInstance(java.lang.Object o)

        if (o == null || o instanceof ESSCertID)
        {
            return (ESSCertID)o;
        }
        else if (o instanceof ASN1Sequence)
        {
            return new ESSCertID((ASN1Sequence)o);
        }

        throw new IllegalArgumentException(
                "unknown object in 'ESSCertID' factory : "
                        + o.getClass().getName() + ".");
    
public org.bouncycastle.asn1.x509.IssuerSerialgetIssuerSerial()

        return issuerSerial;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
ESSCertID ::= SEQUENCE {
certHash Hash,
issuerSerial IssuerSerial OPTIONAL }

        ASN1EncodableVector v = new ASN1EncodableVector();
        
        v.add(certHash);
        
        if (issuerSerial != null)
        {
            v.add(issuerSerial);
        }

        return new DERSequence(v);