Package org.apache.ws.security.common

Examples of org.apache.ws.security.common.CustomHandler.receive()


        messageContext = new java.util.TreeMap<String, Object>();
        messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, this);
        reqData.setMsgContext(messageContext);
        reqData.setUsername("");
       
        handler.receive(WSConstants.SIGN, reqData);
       
        secEngine.processSecurityHeader(doc, null, this, null, crypto);
    }
   
   
View Full Code Here


        java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
        config.put(WSHandlerConstants.SIG_PROP_FILE, "wss40.properties");
        reqData.setMsgContext(config);
       
        CustomHandler handler = new CustomHandler();
        handler.receive(action, reqData);
       
        WSSecurityEngine securityEngine = new WSSecurityEngine();
        Element securityHeader = WSSecurityUtil.getSecurityHeader(doc, "");
        return securityEngine.processSecurityHeader(securityHeader, reqData);
    }
View Full Code Here

            fail ("An error was expected on verifying the signature");
        } catch (Exception ex) {
            // expected
        }
       
        handler.receive(WSConstants.UT_SIGN, reqData);
       
        WSSecurityEngine wss226SecurityEngine = new WSSecurityEngine();
        wss226SecurityEngine.setWssConfig(reqData.getWssConfig());
        wss226SecurityEngine.processSecurityHeader(doc, null, callbackHandler, null);
    }
View Full Code Here

        messageContext = new java.util.TreeMap<String, Object>();
        messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, this);
        reqData.setMsgContext(messageContext);
        reqData.setUsername("");
       
        handler.receive(WSConstants.SIGN, reqData);
       
        secEngine.processSecurityHeader(doc, null, this, null, crypto);
    }
   
   
View Full Code Here

        // It should pass even on a different password type, as we haven't set the
        // processing to be strict
        //
        config.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
        reqData.setMsgContext(config);
        handler.receive(WSConstants.UT, reqData);
        WSSecurityEngine secEngine = new WSSecurityEngine();
        secEngine.setWssConfig(reqData.getWssConfig());
        secEngine.processSecurityHeader(doc, null, callbackHandler, null);
       
        //
View Full Code Here

        //
        // It should fail on strict password type processing
        //
        config.put(WSHandlerConstants.PASSWORD_TYPE_STRICT, "true");
        reqData.setMsgContext(config);
        handler.receive(WSConstants.UT, reqData);
        try {
            secEngine.processSecurityHeader(doc, null, callbackHandler, null);
            fail("Expected failure on the wrong password type");
        } catch (WSSecurityException ex) {
            // expected
View Full Code Here

            fail("An error was expected on verifying the signature");
        } catch (Exception ex) {
            // expected
        }
       
        handler.receive(WSConstants.UT_SIGN, reqData);
       
        WSSecurityEngine wss226SecurityEngine = new WSSecurityEngine();
        wss226SecurityEngine.setWssConfig(reqData.getWssConfig());
        wss226SecurityEngine.processSecurityHeader(doc, null, callbackHandler, null);
    }
View Full Code Here

        messageContext = new java.util.TreeMap<String, Object>();
        messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, this);
        reqData.setMsgContext(messageContext);
        reqData.setUsername("");
       
        handler.receive(WSConstants.SIGN, reqData);
       
        secEngine.processSecurityHeader(doc, null, this, null, crypto);
    }
   
   
View Full Code Here

        // It should pass even on a different password type, as we haven't set the
        // processing to be strict
        //
        config.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_DIGEST);
        reqData.setMsgContext(config);
        handler.receive(WSConstants.UT, reqData);
        WSSecurityEngine secEngine = new WSSecurityEngine();
        secEngine.setWssConfig(reqData.getWssConfig());
        secEngine.processSecurityHeader(doc, null, callbackHandler, null);
       
        //
View Full Code Here

        //
        // It should fail on strict password type processing
        //
        config.put(WSHandlerConstants.PASSWORD_TYPE_STRICT, "true");
        reqData.setMsgContext(config);
        handler.receive(WSConstants.UT, reqData);
        try {
            secEngine.processSecurityHeader(doc, null, callbackHandler, null);
            fail("Expected failure on the wrong password type");
        } catch (WSSecurityException ex) {
            // expected
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.