public EncryptedContentInfo(ASN1Sequence seq) {
   contentType = (DERObjectIdentifier) seq.getObjectAt(0);
   contentEncryptionAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
   if (seq.size() > 2) {
     encryptedContent = ASN1OctetString.getInstance((ASN1TaggedObject) seq.getObjectAt(2), false);
   }
 }
  public EncryptedData(
      DERObjectIdentifier contentType,
      AlgorithmIdentifier encryptionAlgorithm,
      DEREncodable content) {
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(contentType);
    v.add(encryptionAlgorithm.getDERObject());
    v.add(new BERTaggedObject(false, 0, content));

    data = new BERSequence(v);
  }
 public AlgorithmIdentifier getEncryptionAlgorithm() {
   return AlgorithmIdentifier.getInstance(data.getObjectAt(1));
 }