private void collectPolicies() { for (AssertionSet assertionSet : effectivePolicy) { for (PolicyAssertion assertion : assertionSet) { if (PolicyUtil.isSignedParts(assertion, spVersion)) { signedParts.add((SignedParts) assertion); } else if (PolicyUtil.isEncryptParts(assertion, spVersion)) { encryptedParts.add((EncryptedParts) assertion); } else if (PolicyUtil.isSignedElements(assertion, spVersion)) { signedElements.add((SignedElements) assertion); } else if (PolicyUtil.isEncryptedElements(assertion, spVersion)) { encryptedElements.add((EncryptedElements) assertion); } else if (PolicyUtil.isWSS10(assertion, spVersion)) { wssAssertion = assertion; } else if (PolicyUtil.isWSS11(assertion, spVersion)) { wssAssertion = assertion; } else if (PolicyUtil.isTrust10(assertion, spVersion)) { trust10 = (Trust10) assertion; } else if (PolicyUtil.isTrust13(assertion, spVersion)) { trust13 = (Trust13) assertion; } else if (PolicyUtil.isBinding(assertion, spVersion)) { _binding = (Binding) assertion; } else if (PolicyUtil.isRequiredElements(assertion, spVersion)) { reqElements.add((RequiredElements) assertion); } } } }
private void processNonBindingAssertions(BindingProcessor bindingProcessor) throws PolicyException { for (AssertionSet assertionSet : effectivePolicy) { for (PolicyAssertion assertion : assertionSet) { if (PolicyUtil.isBinding(assertion, spVersion)) { continue; } else if (!ignoreST && shouldAddST() && PolicyUtil.isSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((SupportingTokens) assertion); } else if (!ignoreST && shouldAddST() && PolicyUtil.isSignedSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((SignedSupportingTokens) assertion); } else if (!ignoreST && shouldAddST() && PolicyUtil.isEndorsedSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((EndorsingSupportingTokens) assertion); } else if (!ignoreST && shouldAddST() && PolicyUtil.isSignedEndorsingSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((SignedEndorsingSupportingTokens) assertion); } else if (!ignoreST && shouldAddST() && PolicyUtil.isSignedEncryptedSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((SignedEncryptedSupportingTokens) assertion); isIssuedTokenAsEncryptedSupportingToken( bindingProcessor.isIssuedTokenAsEncryptedSupportingToken()); } else if (!ignoreST && shouldAddST() && PolicyUtil.isEncryptedSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((EncryptedSupportingTokens) assertion); isIssuedTokenAsEncryptedSupportingToken( bindingProcessor.isIssuedTokenAsEncryptedSupportingToken()); } else if (!ignoreST && shouldAddST() && PolicyUtil.isEndorsingEncryptedSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens((EndorsingEncryptedSupportingTokens) assertion); isIssuedTokenAsEncryptedSupportingToken( bindingProcessor.isIssuedTokenAsEncryptedSupportingToken()); } else if (!ignoreST && shouldAddST() && PolicyUtil.isSignedEndorsingEncryptedSupportingToken(assertion, spVersion)) { bindingProcessor.processSupportingTokens( (SignedEndorsingEncryptedSupportingTokens) assertion); isIssuedTokenAsEncryptedSupportingToken( bindingProcessor.isIssuedTokenAsEncryptedSupportingToken()); } else if (PolicyUtil.isWSS10(assertion, spVersion)) { wssAssertion = assertion; } else if (PolicyUtil.isWSS11(assertion, spVersion)) { wssAssertion = assertion; } else if (PolicyUtil.isTrust10(assertion, spVersion)) { trust10 = (Trust10) assertion; } else if (PolicyUtil.isTrust13(assertion, spVersion)) { trust13 = (Trust13) assertion; } } } }