Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
  
Parser of RFC 5652 EnvelopedData object.

 EnvelopedData ::= SEQUENCE {
     version CMSVersion,
     originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
     recipientInfos RecipientInfos,
     encryptedContentInfo EncryptedContentInfo,
     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL 
 }
 
 
 public class EnvelopedDataParser
 {
     private ASN1SequenceParser _seq;
     private ASN1Integer        _version;
     private ASN1Encodable      _nextObject;
     private boolean            _originatorInfoCalled;
     
     public EnvelopedDataParser(
         ASN1SequenceParser seq)
         throws IOException
     {
         this. = seq;
         this. = ASN1Integer.getInstance(seq.readObject());
     }
 
     public ASN1Integer getVersion()
     {
         return ;
     }
 
     public OriginatorInfo getOriginatorInfo() 
         throws IOException
     {
          = true
         
         if ( == null)
         {
              = .readObject();
         }
         
         if ( instanceof ASN1TaggedObjectParser && ((ASN1TaggedObjectParser)).getTagNo() == 0)
         {
             ASN1SequenceParser originatorInfo = (ASN1SequenceParser) ((ASN1TaggedObjectParser)).getObjectParser(.false);
              = null;
             return OriginatorInfo.getInstance(originatorInfo.toASN1Primitive());
         }
         
         return null;
     }
     
     public ASN1SetParser getRecipientInfos()
         throws IOException
     {
         if (!)
         {
             getOriginatorInfo();
         }
         
         if ( == null)
         {
              = .readObject();
         }
         
         ASN1SetParser recipientInfos = (ASN1SetParser);
          = null;
         return recipientInfos;
     }
 
         throws IOException
     {
         if ( == null)
         {
              = .readObject();
         }
         
         
         if ( != null)
         {
             ASN1SequenceParser o = (ASN1SequenceParser;
              = null;
             return new EncryptedContentInfoParser(o);
         }
         
         return null;
    }
        throws IOException
    {
        if ( == null)
        {
             = .readObject();
        }
        
        
        if ( != null)
        {
            ASN1Encodable o = ;
             = null;
            return (ASN1SetParser)((ASN1TaggedObjectParser)o).getObjectParser(.false);
        }
        
        return null;
    }
New to GrepCode? Check out our FAQ X