boolean isBody = false;
SignedEncryptedParts parts = null;
SignedEncryptedElements elements = null;
ContentEncryptedElements celements = null;
Collection<AssertionInfo> ais = aim.getAssertionInfo(SP12Constants.ENCRYPTED_PARTS);
if (ais != null) {
for (AssertionInfo ai : ais) {
parts = (SignedEncryptedParts)ai.getAssertion();
ai.setAsserted(true);
}
}
ais = aim.getAssertionInfo(SP12Constants.ENCRYPTED_ELEMENTS);
if (ais != null) {
for (AssertionInfo ai : ais) {
elements = (SignedEncryptedElements)ai.getAssertion();
ai.setAsserted(true);
}
}
ais = aim.getAssertionInfo(SP12Constants.CONTENT_ENCRYPTED_ELEMENTS);
if (ais != null) {
for (AssertionInfo ai : ais) {
celements = (ContentEncryptedElements)ai.getAssertion();
ai.setAsserted(true);
}
}
List<WSEncryptionPart> signedParts = new ArrayList<WSEncryptionPart>();
if (parts != null) {
isBody = parts.isBody();
for (Header head : parts.getHeaders()) {
WSEncryptionPart wep = new WSEncryptionPart(head.getName(),
head.getNamespace(),
"Element");
signedParts.add(wep);
}
}
// REVISIT consider catching exceptions and unassert failed assertions or
// to process and assert them one at a time. Additionally, a found list
// should be applied to all operations that involve adding anything to
// the encrypted list to prevent duplication / errors in encryption.
return getPartsAndElements(false,
isBody,
signedParts,
elements == null ? null : elements.getXPathExpressions(),
elements == null ? null : elements.getDeclaredNamespaces(),
celements == null ? null : celements.getXPathExpressions(),
celements == null ? null : celements.getDeclaredNamespaces());
}