}
}
// for policy verification, replace target uris with qnames for signature and encryption targets
try {
MessagePolicy inferredMessagePolicy = context.getInferredSecurityPolicy();
for (int i = 0; i < inferredMessagePolicy.size(); i++) {
WSSPolicy wssPolicy = (WSSPolicy) inferredMessagePolicy.get(i);
if (PolicyTypeUtil.signaturePolicy(wssPolicy)) {
SignaturePolicy.FeatureBinding fb = (SignaturePolicy.FeatureBinding) wssPolicy.getFeatureBinding();
ArrayList targets = fb.getTargetBindings();
// replace uri target types with qname target types
modifyTargets(targets);
} else if (PolicyTypeUtil.encryptionPolicy(wssPolicy)) {
EncryptionPolicy.FeatureBinding fb = (EncryptionPolicy.FeatureBinding) wssPolicy.getFeatureBinding();
ArrayList targets = fb.getTargetBindings();
// replace uri target types with qname target types
modifyTargets(targets);
}
}
} catch (Exception ex) {
throw new XWSSecurityException(ex);
}
if (scCancel) {
boolean securedBody = false;
boolean allHeaders = false;
try {
MessagePolicy mp = context.getInferredSecurityPolicy();
for (int i = 0; i < mp.size(); i++) {
WSSPolicy wp = (WSSPolicy) mp.get(i);
if (PolicyTypeUtil.encryptionPolicy(wp)) {
EncryptionPolicy ep = (EncryptionPolicy) wp;
ArrayList list = ((EncryptionPolicy.FeatureBinding) ep.getFeatureBinding()).getTargetBindings();
for (int ei = 0; ei < list.size(); ei++) {
EncryptionTarget et = (EncryptionTarget) list.get(ei);