Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
  
Parse AuthEnvelopedData input stream.
 AuthEnvelopedData ::= SEQUENCE {
   version CMSVersion,
   originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
   recipientInfos RecipientInfos,
   authEncryptedContentInfo EncryptedContentInfo,
   authAttrs [1] IMPLICIT AuthAttributes OPTIONAL,
   mac MessageAuthenticationCode,
   unauthAttrs [2] IMPLICIT UnauthAttributes OPTIONAL }
 
 
 public class AuthEnvelopedDataParser
 {
     private ASN1SequenceParser seq;
     private ASN1Integer version;
     private ASN1Encodable nextObject;
     private boolean originatorInfoCalled;
 
     {
         this. = seq;
 
         // TODO
         // "It MUST be set to 0."
         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;
    }
    public ASN1SetParser getAuthAttrs()
        throws IOException
    {
        if ( == null)
        {
             = .readObject();
        }
        if ( instanceof ASN1TaggedObjectParser)
        {
            ASN1Encodable o = ;
             = null;
            return (ASN1SetParser)((ASN1TaggedObjectParser)o).getObjectParser(.false);
        }
        // TODO
        // "The authAttrs MUST be present if the content type carried in
        // EncryptedContentInfo is not id-data."
        return null;
    }
    public ASN1OctetString getMac()
        throws IOException
    {
        if ( == null)
        {
             = .readObject();
        }
        ASN1Encodable o = ;
         = null;
        return ASN1OctetString.getInstance(o.toASN1Primitive());
    }
    public ASN1SetParser getUnauthAttrs()
        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