Examples of CustomHandler


Examples of org.apache.ws.security.common.CustomHandler

        final java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(Integer.valueOf(WSConstants.ENCR));
        actions.add(Integer.valueOf(WSConstants.SIGN));
        actions.add(Integer.valueOf(WSConstants.TS));
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.send(
            action,
            doc,
            reqData,
            actions,
            true
View Full Code Here

Examples of org.apache.ws.security.common.CustomHandler

    /**
     * Test that adds a UserNameToken via WSHandler
     */
    @org.junit.Test
    public void testUsernameTokenWSHandler() throws Exception {
        CustomHandler handler = new CustomHandler();
        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
       
        RequestData reqData = new RequestData();
        java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
        config.put("password", "verySecret");
        config.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
        reqData.setUsername("wernerd");
        reqData.setMsgContext(config);
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(Integer.valueOf(WSConstants.UT));
       
        handler.send(WSConstants.UT, doc, reqData, actions, true);
       
        if (LOG.isDebugEnabled()) {
            LOG.debug("Username Token via WSHandler");
            String outputString =
                org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
View Full Code Here

Examples of org.apache.ws.security.common.CustomHandler

    /**
     * Test that adds a UserNameToken with no password via WSHandler
     */
    @org.junit.Test
    public void testUsernameTokenWSHandlerNoPassword() throws Exception {
        CustomHandler handler = new CustomHandler();
        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
       
        RequestData reqData = new RequestData();
        java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
        config.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_NONE);
        reqData.setUsername("wernerd");
        reqData.setMsgContext(config);
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(Integer.valueOf(WSConstants.UT));
       
        handler.send(WSConstants.UT, doc, reqData, actions, true);
       
        if (LOG.isDebugEnabled()) {
            LOG.debug("Username Token via WSHandler");
            String outputString =
                org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
View Full Code Here

Examples of org.apache.ws.security.common.CustomHandler

    /**
     * Test that adds a UserNameToken with an empty password via WSHandler
     */
    @org.junit.Test
    public void testUsernameTokenWSHandlerEmptyPassword() throws Exception {
        CustomHandler handler = new CustomHandler();
        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
       
        RequestData reqData = new RequestData();
        java.util.Map<String, Object> config = new java.util.TreeMap<String, Object>();
        config.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
        config.put(WSHandlerConstants.PW_CALLBACK_REF, this);
        reqData.setUsername("emptyuser");
        reqData.setMsgContext(config);
       
        java.util.List<Integer> actions = new java.util.ArrayList<Integer>();
        actions.add(Integer.valueOf(WSConstants.UT));
       
        handler.send(WSConstants.UT, doc, reqData, actions, true);
       
        if (LOG.isDebugEnabled()) {
            LOG.debug("Username Token with an empty password via WSHandler");
            String outputString =
                org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
View Full Code Here

Examples of org.apache.wss4j.dom.common.CustomHandler

        messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, keystoreCallbackHandler);
        reqData.setMsgContext(messageContext);
        reqData.setUsername("wss40rev");
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.send(
            doc,
            reqData,
            Collections.singletonList(new HandlerAction(WSConstants.ENCR)),
            true
        );
View Full Code Here

Examples of org.apache.wss4j.dom.common.CustomHandler

        messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, keystoreCallbackHandler);
        reqData.setMsgContext(messageContext);
        reqData.setUsername("wss40rev");
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        handler.setOption(WSHandlerConstants.ENABLE_REVOCATION, "true");
        try {
            handler.send(
                doc,
                reqData,
                Collections.singletonList(new HandlerAction(WSConstants.ENCR)),
                true
            );
View Full Code Here

Examples of org.apache.wss4j.dom.common.CustomHandler

        SignatureActionToken actionToken = new SignatureActionToken();
        actionToken.setUser("wss40");
        actionToken.setCryptoProperties("wss40.properties");
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        List<HandlerAction> actions = new ArrayList<HandlerAction>();
        actions.add(new HandlerAction(WSConstants.SIGN, actionToken));
        handler.send(
            doc,
            reqData,
            actions,
            true
        );
View Full Code Here

Examples of org.apache.wss4j.dom.common.CustomHandler

        actionToken.setKeyIdentifierId(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);
        actionToken.setKey(keyData);
        actionToken.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        List<HandlerAction> actions = new ArrayList<HandlerAction>();
        actions.add(new HandlerAction(WSConstants.SIGN, actionToken));
        handler.send(
            doc,
            reqData,
            actions,
            true
        );
View Full Code Here

Examples of org.apache.wss4j.dom.common.CustomHandler

        WSEncryptionPart encP =
            new WSEncryptionPart("Timestamp", WSConstants.WSU_NS, "");
        actionToken2.setParts(Collections.singletonList(encP));
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        List<HandlerAction> actions = new ArrayList<HandlerAction>();
        actions.add(new HandlerAction(WSConstants.SIGN, actionToken));
        actions.add(new HandlerAction(WSConstants.SIGN, actionToken2));
        actions.add(new HandlerAction(WSConstants.TS, null));
        handler.send(
            doc,
            reqData,
            actions,
            true
        );
View Full Code Here

Examples of org.apache.wss4j.dom.common.CustomHandler

        WSEncryptionPart encP =
            new WSEncryptionPart("Timestamp", WSConstants.WSU_NS, "");
        actionToken2.setParts(Collections.singletonList(encP));
       
        final Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
        CustomHandler handler = new CustomHandler();
        List<HandlerAction> actions = new ArrayList<HandlerAction>();
        actions.add(new HandlerAction(WSConstants.SIGN, actionToken));
        actions.add(new HandlerAction(WSConstants.SIGN, actionToken2));
        actions.add(new HandlerAction(WSConstants.TS, null));
        handler.send(
            doc,
            reqData,
            actions,
            true
        );
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.