Package org.apache.wss4j.dom.handler

Examples of org.apache.wss4j.dom.handler.RequestData


    }

    @org.junit.Test
    public void testEncryptedKeyRefAndDuplicatedEncDataInWsseHeader() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(false);
        TestMessageTransformer.duplicateEncryptedDataInWsseHeader(encryptedSignedDoc.getDocumentElement(), false);
View Full Code Here


    }
   
    @org.junit.Test
    public void testEncryptedKeyRefAndDuplicatedEncDataInWsseWrapperHeader() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(false);
        TestMessageTransformer.duplicateEncryptedDataInWsseWrapperHeader(encryptedSignedDoc.getDocumentElement(), false);
View Full Code Here

    }
   
    @org.junit.Test
    public void testEncryptedKeyRefAndDuplicatedEncDataInExternalWrapperElement() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(false);
        TestMessageTransformer.duplicateEncryptedDataInExternalWrapperElement(encryptedSignedDoc.getDocumentElement(), false);
View Full Code Here

    }
   
    @org.junit.Test
    public void testReferenceListAndDuplicatedEncDataInWsseHeader() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(false);
        TestMessageTransformer.duplicateEncryptedDataInWsseHeader(encryptedSignedDoc.getDocumentElement(), true);
View Full Code Here

    }
   
    @org.junit.Test
    public void testReferenceListAndDuplicatedEncDataInWsseWrapperHeader() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(false);
        TestMessageTransformer.duplicateEncryptedDataInWsseWrapperHeader(encryptedSignedDoc.getDocumentElement(), true);
View Full Code Here

    }
   
    @org.junit.Test
    public void testReferenceListAndDuplicatedEncDataInExternalWrapperElement() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(false);
        TestMessageTransformer.duplicateEncryptedDataInExternalWrapperElement(encryptedSignedDoc.getDocumentElement(), true);
View Full Code Here

    }
   
    @org.junit.Test
    public void testAdditionalEncryptedDataWithEmbeddedEncryptedKeyInWsseHeader() throws Exception {
        Document encryptedSignedDoc = getRequestDocument();
        RequestData reqData = getRequestData(true);
        verify(encryptedSignedDoc, reqData);
       
        encryptedSignedDoc = getRequestDocument();
        reqData = getRequestData(true);
        Element newEncData = TestMessageTransformer.addEncryptedDataWithEmbeddedEncryptedKeyInWsseHeader(encryptedSignedDoc.getDocumentElement());
View Full Code Here

        assertTrue(e.getMessage().contains(mex));
        assertEquals(WSSecurityException.ErrorCode.FAILED_CHECK, e.getErrorCode());
    }
   
    private RequestData getRequestData(boolean reqSignedEncData) throws WSSecurityException {
        RequestData reqData = new RequestData();
        Map<String, Object> messageContext = new TreeMap<String, Object>();
        messageContext = new java.util.TreeMap<String, Object>();
        messageContext.put(WSHandlerConstants.REQUIRE_SIGNED_ENCRYPTED_DATA_ELEMENTS, Boolean.toString(reqSignedEncData));
        reqData.setMsgContext(messageContext);
        CustomHandler handler = new CustomHandler();
        handler.receive(WSSecurityUtil.decodeAction("Encrypt Signature"), reqData);
        reqData.setCallbackHandler(callbackHandler);
        reqData.setSigVerCrypto(crypto);
        reqData.setDecCrypto(crypto);
        return reqData;
    }
View Full Code Here

            newEngine.processSecurityHeader(doc, null, callbackHandler, null);
            fail("Expected failure as it is not BSP compliant");
        } catch (WSSecurityException ex) {
            // expected
        }
        RequestData data = new RequestData();
        data.setCallbackHandler(callbackHandler);
        data.setIgnoredBSPRules(Collections.singletonList(BSPRule.R4201));
        newEngine.processSecurityHeader(doc, "", data);
    }
View Full Code Here

    @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);
       
        HandlerAction action = new HandlerAction(WSConstants.UT);
        handler.send(
            doc,
            reqData,
View Full Code Here

TOP

Related Classes of org.apache.wss4j.dom.handler.RequestData

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.