Package org.apache.ws.security.policy.model

Examples of org.apache.ws.security.policy.model.PolicyEngineData


   

    public PolicyEngineData commitPolicyEngineData() {
        if (pedStackPointer > 2) {
            pedStackPointer--;
            PolicyEngineData ped = (PolicyEngineData) pedStack.get(pedStackPointer);
            return ped;
        } else if(pedStackPointer == 2) {
            RootPolicyEngineData rootData = (RootPolicyEngineData)this.pedStack.get(0);
            rootData.addTopLevelPED(readCurrentPolicyEngineData());
            pedStackPointer--;
View Full Code Here


       
        /*
         * Now get the initial PolicyEngineData, initialize it and put it onto
         * the PED stack.
         */
        PolicyEngineData ped = new RootPolicyEngineData();
        ped.initializeWithDefaults();
       
        /*
         * Now get a context and push the top level token onto the token stack.
         * The top level token is a special token that acts as anchor to start
         * parsing.
 
View Full Code Here

   
    public static void build(ArrayList topLevelPeds) throws WSSPolicyException {
        Iterator topLevelPEDIterator = topLevelPeds.iterator();
        WSS4JConfig config = new WSS4JConfig();
        while (topLevelPEDIterator.hasNext()) {
            PolicyEngineData ped = (PolicyEngineData) topLevelPEDIterator.next();
            if(ped instanceof Binding) {
                if(ped instanceof SymmetricBinding) {
                    processSymmetricPolicyBinding((SymmetricBinding)ped, config);
                } else {
                    processAsymmetricPolicyBinding((AsymmetricBinding)ped, config);
View Full Code Here

            assertEquals("Incrrect number of PolicyEngineData", 4, peds.size());
           
            Iterator pedIter = peds.iterator();
            boolean asymmBindingfound = false, wss11found = false, signedPartsFound = false, encryptedPartsFound = false;
            while (pedIter.hasNext()) {
                PolicyEngineData ped = (PolicyEngineData) pedIter.next();
                if(ped instanceof AsymmetricBinding) {
                    asymmBindingfound = true;
                    AsymmetricBinding symmetricBinding = (AsymmetricBinding)ped;
                    assertEquals("Incorrect layout",Constants.LAYOUT_STRICT ,symmetricBinding.getLayout().getValue());
                } else if(ped instanceof Wss11) {
View Full Code Here

            assertEquals("Incrrect number of PolicyEngineData", 4, peds.size());
           
            Iterator pedIter = peds.iterator();
            boolean symmBindingfound = false, wss11found = false, signedPartsFound = false, encryptedPartsFound = false;
            while (pedIter.hasNext()) {
                PolicyEngineData ped = (PolicyEngineData) pedIter.next();
                if(ped instanceof SymmetricBinding) {
                    symmBindingfound = true;
                    SymmetricBinding symmetricBinding = (SymmetricBinding)ped;
                    assertEquals("Incorrect layout",Constants.LAYOUT_STRICT ,symmetricBinding.getLayout().getValue());
                } else if(ped instanceof Wss11) {
View Full Code Here

       
        /*
         * Now get the initial PolicyEngineData, initialize it and put it onto
         * the PED stack.
         */
        PolicyEngineData ped = new RootPolicyEngineData();
        ped.initializeWithDefaults();
       
        /*
         * Now get a context and push the top level token onto the token stack.
         * The top level token is a special token that acts as anchor to start
         * parsing.
 
View Full Code Here

    public static WSS4JPolicyData build(ArrayList topLevelPeds)
            throws WSSPolicyException {
        Iterator topLevelPEDIterator = topLevelPeds.iterator();
        WSS4JPolicyData wpd = new WSS4JPolicyData();
        while (topLevelPEDIterator.hasNext()) {
            PolicyEngineData ped = (PolicyEngineData) topLevelPEDIterator
                    .next();
            if (ped instanceof Binding) {
                if (ped instanceof SymmetricBinding) {
                    processSymmetricPolicyBinding((SymmetricBinding) ped, wpd);
                } else {
                    processAsymmetricPolicyBinding((AsymmetricBinding) ped, wpd);
                }
                /*
                 * Don't change the order of Wss11 / Wss10 instance checks
                 * because Wss11 extends Wss10 - thus first check Wss11.
                 */
            } else if (ped instanceof Wss11) {
                processWSS11((Wss11) ped, wpd);
            } else if (ped instanceof Wss10) {
                processWSS10((Wss10) ped, wpd);
            } else if (ped instanceof SignedEncryptedElements) {
                processSignedEncryptedElements((SignedEncryptedElements) ped,
                        wpd);
            } else if (ped instanceof SignedEncryptedParts) {
                processSignedEncryptedParts((SignedEncryptedParts) ped, wpd);
            } else if (ped instanceof SupportingToken) {
                processSupportingToken((SupportingToken) ped, wpd);
            } else {
                System.out.println("Unknown top level PED found: "
                        + ped.getClass().getName());
            }
        }
        return wpd;
    }
View Full Code Here

     * @param wpd
     *            The WSS4J data to initialize
     */
    private static void symmetricBinding(SymmetricBinding binding,
            WSS4JPolicyData wpd) throws WSSPolicyException {
        PolicyEngineData ped = binding.getProtectionToken();
        AlgorithmSuite suite = binding.getAlgorithmSuite();
        if (ped != null) {
            wpd.setProtectionToken(
                    ((ProtectionToken) ped).getProtectionToken(), suite);
        } else {
            ped = binding.getEncryptionToken();
            PolicyEngineData ped1 = binding.getSignatureToken();
            if (ped == null && ped1 == null) {
                // this is an error - throw something
            }
            wpd.setEncryptionToken(
                    ((EncryptionToken) ped).getEncryptionToken(), suite);
View Full Code Here

     * @param wpd
     *            The WSS4J data to initialize
     */
    private static void asymmetricBinding(AsymmetricBinding binding,
            WSS4JPolicyData wpd) throws WSSPolicyException {
        PolicyEngineData ped = binding.getRecipientToken();
        PolicyEngineData ped1 = binding.getInitiatorToken();
        if (ped == null && ped1 == null) {
            // this is an error - throw something
        }
        AlgorithmSuite suite = binding.getAlgorithmSuite();
        wpd
View Full Code Here

      if (!initializedSignedParts) {
        try {
          initializeSignedParts(spt);
                    SignedEncryptedParts parts = (SignedEncryptedParts) spc
                            .readCurrentPolicyEngineData();
                    PolicyEngineData parent = spc
                            .readPreviousPolicyEngineData();
                    if (parent instanceof SupportingToken) {
                        // Parent is a supporting token
                        ((SupportingToken) parent).setSignedParts(parts);
                    }
View Full Code Here

TOP

Related Classes of org.apache.ws.security.policy.model.PolicyEngineData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.