Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bouncycastle.asn1.ess;
 
public class ESSCertID
    extends ASN1Object
    private ASN1OctetString certHash;
    private IssuerSerial issuerSerial;
    public static ESSCertID getInstance(Object o)
    {
        if (o instanceof ESSCertID)
        {
            return (ESSCertID)o;
        }
        else if (o != null)
        {
            return new ESSCertID(ASN1Sequence.getInstance(o));
        }
        return null;
    }

    
constructor
    private ESSCertID(ASN1Sequence seq)
    {
        if (seq.size() < 1 || seq.size() > 2)
        {
            throw new IllegalArgumentException("Bad sequence size: " + seq.size());
        }
         = ASN1OctetString.getInstance(seq.getObjectAt(0));
 
        if (seq.size() > 1)
        {
             = IssuerSerial.getInstance(seq.getObjectAt(1));
        }
    }
    public ESSCertID(
        byte[]          hash)
    {
         = new DEROctetString(hash);
    }
    public ESSCertID(
        byte[]          hash,
        IssuerSerial    issuerSerial)
    {
        this. = new DEROctetString(hash);
        this. = issuerSerial;
    }
    public byte[] getCertHash()
    {
        return .getOctets();
    }
    public IssuerSerial getIssuerSerial()
    {
        return ;
    }

    
 ESSCertID ::= SEQUENCE {
     certHash Hash, 
     issuerSerial IssuerSerial OPTIONAL }
 
    public ASN1Primitive toASN1Primitive()
    {
        ASN1EncodableVector v = new ASN1EncodableVector();
        
        v.add();
        
        if ( != null)
        {
            v.add();
        }
        return new DERSequence(v);
    }
New to GrepCode? Check out our FAQ X