Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
RFC 5652 EncryptedContentInfo object.
 EncryptedContentInfo ::= SEQUENCE {
     contentType ContentType,
     contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
     encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL 
 }
 
 
 public class EncryptedContentInfo
     extends ASN1Object
 {
     private ASN1ObjectIdentifier contentType;
     private ASN1OctetString     encryptedContent;
     
     public EncryptedContentInfo(
         ASN1ObjectIdentifier contentType
         AlgorithmIdentifier contentEncryptionAlgorithm,
         ASN1OctetString     encryptedContent)
     {
         this. = contentType;
         this. = contentEncryptionAlgorithm;
         this. = encryptedContent;
     }
     
     private EncryptedContentInfo(
         ASN1Sequence seq)
     {
         if (seq.size() < 2)
         {
             throw new IllegalArgumentException("Truncated Sequence Found");
         }
 
          = (ASN1ObjectIdentifier)seq.getObjectAt(0);
          = AlgorithmIdentifier.getInstance(
                                                         seq.getObjectAt(1));
         if (seq.size() > 2)
         {
              = ASN1OctetString.getInstance(
                                 (ASN1TaggedObject)seq.getObjectAt(2), false);
         }
     }

    
Return an EncryptedContentInfo object from the given object.

Accepted inputs:

Parameters:
obj the object we want converted.
Throws:
java.lang.IllegalArgumentException if the object cannot be converted.
 
     public static EncryptedContentInfo getInstance(
         Object obj)
     {
         if (obj instanceof EncryptedContentInfo)
         {
             return (EncryptedContentInfo)obj;
         }
         if (obj != null)
         {
             return new EncryptedContentInfo(ASN1Sequence.getInstance(obj));
         }
         
         return null;
     }
 
     {
         return ;
     }
 
     {
         return ;
     }
 
     {
        return ;
    }

    
Produce an object suitable for an ASN1OutputStream.
    {
        ASN1EncodableVector  v = new ASN1EncodableVector();
        
        v.add();
        if ( != null)
        {
            v.add(new BERTaggedObject(false, 0, ));
        }
        
        return new BERSequence(v);
    }
New to GrepCode? Check out our FAQ X