Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cmp;
  
 
 public class OOBCertHash
     extends ASN1Object
 {
     private AlgorithmIdentifier hashAlg;
     private CertId certId;
     private DERBitString  hashVal;
 
     private OOBCertHash(ASN1Sequence seq)
     {
         int index = seq.size() - 1;
 
          = DERBitString.getInstance(seq.getObjectAt(index--));
 
         for (int i = indexi >= 0; i--)
         {
             ASN1TaggedObject tObj = (ASN1TaggedObject)seq.getObjectAt(i);
 
             if (tObj.getTagNo() == 0)
             {
                  = AlgorithmIdentifier.getInstance(tObjtrue);
             }
             else
             {
                  = CertId.getInstance(tObjtrue);
             }
         }
 
     }
 
     public static OOBCertHash getInstance(Object o)
     {
         if (o instanceof OOBCertHash)
         {
             return (OOBCertHash)o;
         }
 
         if (o != null)
         {
             return new OOBCertHash(ASN1Sequence.getInstance(o));
         }
 
         return null;
     }
 
     public OOBCertHash(AlgorithmIdentifier hashAlgCertId certIdbyte[] hashVal)
     {
         this(hashAlgcertIdnew DERBitString(hashVal));
     }
 
     public OOBCertHash(AlgorithmIdentifier hashAlgCertId certIdDERBitString hashVal)
     {
         this. = hashAlg;
         this. = certId;
         this. = hashVal;
     }
 
     public AlgorithmIdentifier getHashAlg()
     {
         return ;
     }
 
     public CertId getCertId()
     {
         return ;
     }
 
     public DERBitString getHashVal()
     {
         return ;
     }

    
 OOBCertHash ::= SEQUENCE {
                      hashAlg     [0] AlgorithmIdentifier     OPTIONAL,
                      certId      [1] CertId                  OPTIONAL,
                      hashVal         BIT STRING
                      -- hashVal is calculated over the DER encoding of the
                      -- self-signed certificate with the identifier certID.
       }
 

Returns:
a basic ASN.1 object representation.
 
     public ASN1Primitive toASN1Primitive()
     {
        ASN1EncodableVector v = new ASN1EncodableVector();
        addOptional(v, 0, );
        addOptional(v, 1, );
        v.add();
        return new DERSequence(v);
    }
    private void addOptional(ASN1EncodableVector vint tagNoASN1Encodable obj)
    {
        if (obj != null)
        {
            v.add(new DERTaggedObject(truetagNoobj));
        }
    }
New to GrepCode? Check out our FAQ X