edt.setMimeType(attachment.getContentType());
EncryptionMethodType emt = new EncryptionMethodType();
emt.setAlgorithm(dataAlgo);
edt.setEncryptionMethod(emt);
CipherDataType ct = new CipherDataType();
CipherReferenceType crt = new CipherReferenceType();
crt.setURI(cid);
TransformsType tst = new TransformsType();
ArrayList<TransformType> ttList = new ArrayList<TransformType>();
ArrayList list = target.getCipherReferenceTransforms();
for(Object obj : list){
EncryptionTarget.Transform tr = (EncryptionTarget.Transform)obj;
TransformType tt = new TransformType();
tt.setAlgorithm(tr.getTransform());
ttList.add(tt);
}
if(!ttList.isEmpty()){
tst.setTransform(ttList);
}
crt.setTransforms(tst);
ct.setCipherReference(crt);
edt.setCipherData(ct);
edt.setId(id);
if(keyInfo != null){
edt.setKeyInfo(keyInfo);