Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
RFC 5652 EncryptedData object.

 EncryptedData ::= SEQUENCE {
     version CMSVersion,
     encryptedContentInfo EncryptedContentInfo,
     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
 
 
 public class EncryptedData
     extends ASN1Object
 {
     private ASN1Integer version;
     private ASN1Set unprotectedAttrs;

    
Return an EncryptedData object from the given object.

Accepted inputs:

  • null → null
  • EncryptedData object
  • ASN1Sequence input formats

Parameters:
o the object we want converted.
Throws:
java.lang.IllegalArgumentException if the object cannot be converted.
 
     public static EncryptedData getInstance(Object o)
     {
         if (o instanceof EncryptedData)
         {
             return (EncryptedData)o;
         }
 
         if (o != null)
         {
             return new EncryptedData(ASN1Sequence.getInstance(o));
         }
 
         return null;
     }
 
     public EncryptedData(EncryptedContentInfo encInfo)
     {
         this(encInfo,  null);
     }
 
     public EncryptedData(EncryptedContentInfo encInfoASN1Set unprotectedAttrs)
     {
         this. = new ASN1Integer((unprotectedAttrs == null) ? 0 : 2);
         this. = encInfo;
         this. = unprotectedAttrs;
     }
 
     private EncryptedData(ASN1Sequence seq)
     {
         this. = ASN1Integer.getInstance(seq.getObjectAt(0));
         this. = EncryptedContentInfo.getInstance(seq.getObjectAt(1));
 
         if (seq.size() == 3)
         {
             this. = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(2), false);
         }
     }
 
     public ASN1Integer getVersion()
     {
         return ;
     }
 
     {
         return ;
     }
 
     public ASN1Set getUnprotectedAttrs()
     {
         return ;
     }

    

Returns:
a basic ASN.1 object representation.
 
     public ASN1Primitive toASN1Primitive()
    {
        ASN1EncodableVector v = new ASN1EncodableVector();
        v.add();
        v.add();
        if ( != null)
        {
            v.add(new BERTaggedObject(false, 1, ));
        }
        return new BERSequence(v);
    }
New to GrepCode? Check out our FAQ X