}
public void process(EncryptedParts encryptParts,EncryptionPolicy.FeatureBinding binding){
if(SecurityPolicyUtil.isEncryptedPartsEmpty(encryptParts)){
if(!bodyEncrypted){
EncryptionTarget target = etCreator.newQNameEncryptionTarget(EncryptionTarget.BODY_QNAME);
target.setContentOnly(true);
binding.addTargetBinding(target);
bodyEncrypted = true;
}
}
Iterator tv = encryptParts.getTargets();
while(tv.hasNext()){
Header ht = (Header)tv.next();
if(!seenEncryptedParts(ht)){
EncryptionTarget target = etCreator.newQNameEncryptionTarget(new QName(ht.getURI(),ht.getLocalName()));
target.isSOAPHeadersOnly(true);
binding.addTargetBinding(target);
}
}
if(encryptParts.hasBody() && !bodyEncrypted){
EncryptionTarget target = etCreator.newQNameEncryptionTarget(EncryptionTarget.BODY_QNAME);
target.setContentOnly(true);
binding.addTargetBinding(target);
bodyEncrypted = true;
}
if(encryptParts.hasAttachments() && !encryptAttachments){
EncryptionTarget target = etCreator.newURIEncryptionTarget(MessageConstants.PROCESS_ALL_ATTACHMENTS);
target.setContentOnly(true);
etCreator.addAttachmentTransform(target, MessageConstants.SWA11_ATTACHMENT_CIPHERTEXT_TRANSFORM);
binding.addTargetBinding(target);
encryptAttachments = true;
}
}