Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
  
Parser for RFC 5544: TimeStampedData object.

 TimeStampedData ::= SEQUENCE {
   version              INTEGER { v1(1) },
   dataUri              IA5String OPTIONAL,
   metaData             MetaData OPTIONAL,
   content              OCTET STRING OPTIONAL,
   temporalEvidence     Evidence
 }
 
 
 public class TimeStampedDataParser
 {
     private ASN1Integer version;
     private DERIA5String dataUri;
     private MetaData metaData;
     private ASN1OctetStringParser content;
     private Evidence temporalEvidence;
     private ASN1SequenceParser parser;
 
     private TimeStampedDataParser(ASN1SequenceParser parser)
         throws IOException
     {
         this. = parser;
         this. = ASN1Integer.getInstance(parser.readObject());
 
         ASN1Encodable obj = parser.readObject();
 
         if (obj instanceof DERIA5String)
         {
             this. = DERIA5String.getInstance(obj);
             obj = parser.readObject();
         }
         if (obj instanceof MetaData || obj instanceof ASN1SequenceParser)
         {
             this. = MetaData.getInstance(obj.toASN1Primitive());
             obj = parser.readObject();
         }
         if (obj instanceof ASN1OctetStringParser)
         {
             this. = (ASN1OctetStringParser)obj;
         }
     }
 
     public static TimeStampedDataParser getInstance(Object obj)
         throws IOException
     {
         if (obj instanceof ASN1Sequence)
         {
             return new TimeStampedDataParser(((ASN1Sequence)obj).parser());
         }
         if (obj instanceof ASN1SequenceParser)
         {
             return new TimeStampedDataParser((ASN1SequenceParser)obj);
         }
 
         return null;
     }
 
     public DERIA5String getDataUri()
     {
         return ;
     }
 
     public MetaData getMetaData()
     {
         return ;
     }
 
     public ASN1OctetStringParser getContent()
     {
         return ;
     }
 
     public Evidence getTemporalEvidence()
         throws IOException
     {
         if ( == null)
         {
              = Evidence.getInstance(.readObject().toASN1Primitive());
         }
 
        return ;
    }

    
 TimeStampedData ::= SEQUENCE {
   version              INTEGER { v1(1) },
   dataUri              IA5String OPTIONAL,
   metaData             MetaData OPTIONAL,
   content              OCTET STRING OPTIONAL,
   temporalEvidence     Evidence
 }
 

Deprecated:
will be removed
Returns:
    {
        ASN1EncodableVector v = new ASN1EncodableVector();
        v.add();
        if ( != null)
        {
            v.add();
        }
        if ( != null)
        {
            v.add();
        }
        if ( != null)
        {
            v.add();
        }
        v.add();
        return new BERSequence(v);
    }
New to GrepCode? Check out our FAQ X