Package org.apache.ws.security

Examples of org.apache.ws.security.WSSecurityEngine.processSecurityHeader()


        WSSecurityEngine secEngine = new WSSecurityEngine();
        RequestData data = new RequestData();
        data.setSigCrypto(sigVerCrypto);
        data.setSamlAlgorithmSuite(algorithmSuite);
       
        return secEngine.processSecurityHeader(securityHeader, data);
    }


}
View Full Code Here


        data.setCallbackHandler(secretKeyCallbackHandler);
       
        data.setAlgorithmSuite(algorithmSuite);
       
        algorithmSuite.addEncryptionMethod(WSConstants.AES_128);
        secEngine.processSecurityHeader(securityHeader, data);
       
        algorithmSuite.setMinimumSymmetricKeyLength(256);
        try {
            secEngine.processSecurityHeader(securityHeader, data);
            fail("Expected failure as a 128 bit key is not allowed");
View Full Code Here

        algorithmSuite.addEncryptionMethod(WSConstants.AES_128);
        secEngine.processSecurityHeader(securityHeader, data);
       
        algorithmSuite.setMinimumSymmetricKeyLength(256);
        try {
            secEngine.processSecurityHeader(securityHeader, data);
            fail("Expected failure as a 128 bit key is not allowed");
        } catch (WSSecurityException ex) {
            // expected
        }
       
View Full Code Here

        }
       
        algorithmSuite.setMinimumSymmetricKeyLength(64);
        algorithmSuite.setMaximumSymmetricKeyLength(120);
        try {
            secEngine.processSecurityHeader(securityHeader, data);
            fail("Expected failure as a 128 bit key is not allowed");
        } catch (WSSecurityException ex) {
            // expected
        }
    }
View Full Code Here

       
        data.setAlgorithmSuite(algorithmSuite);
       
        data.setCallbackHandler(new KeystoreCallbackHandler());
       
        return secEngine.processSecurityHeader(securityHeader, data);
    }

}
View Full Code Here

        WSSecurityEngine newEngine = new WSSecurityEngine();
        WSSConfig config = WSSConfig.getNewInstance();
        config.setWsiBSPCompliant(false);
        newEngine.setWssConfig(config);
        List<WSSecurityEngineResult> results =
            newEngine.processSecurityHeader(encryptedDoc, null, keystoreCallbackHandler, crypto);
       
        WSSecurityEngineResult actionResult =
                WSSecurityUtil.fetchActionResult(results, WSConstants.ENCR);
        assertNotNull(actionResult.get(WSSecurityEngineResult.TAG_X509_CERTIFICATE));
        assertNotNull(actionResult.get(WSSecurityEngineResult.TAG_X509_REFERENCE_TYPE));
View Full Code Here

       
        // Now turn on BSP spec compliance
        config.setWsiBSPCompliant(true);
        newEngine.setWssConfig(config);
        try {
            newEngine.processSecurityHeader(encryptedDoc, null, keystoreCallbackHandler, crypto);
            fail("Failure expected on a bad ValueType attribute");
        } catch (WSSecurityException ex) {
            // expected
        }
View Full Code Here

        // Turn off BSP compliance
        WSSecurityEngine newEngine = new WSSecurityEngine();
        WSSConfig wssConfig = WSSConfig.getNewInstance();
        wssConfig.setWsiBSPCompliant(false);
        newEngine.setWssConfig(wssConfig);
        newEngine.processSecurityHeader(encryptedDoc, null, keystoreCallbackHandler, crypto);
       
        // Now turn on BSP compliance
        wssConfig.setWsiBSPCompliant(true);
        newEngine.setWssConfig(wssConfig);
        try {
View Full Code Here

       
        // Now turn on BSP compliance
        wssConfig.setWsiBSPCompliant(true);
        newEngine.setWssConfig(wssConfig);
        try {
            newEngine.processSecurityHeader(encryptedDoc, null, keystoreCallbackHandler, crypto);
            fail("Failure expected on a bad attribute type");
        } catch (WSSecurityException ex) {
            assertTrue(ex.getMessage().contains("bad attribute"));
        }
    }
View Full Code Here

        }
        assertTrue(outputString.indexOf("counter_port_type") == -1 ? true : false);
       
        WSSecurityEngine newEngine = new WSSecurityEngine();
        List<WSSecurityEngineResult> results =
            newEngine.processSecurityHeader(encryptedDoc, null, keystoreCallbackHandler, crypto);
       
        WSSecurityEngineResult actionResult =
                WSSecurityUtil.fetchActionResult(results, WSConstants.ENCR);
        assertNotNull(actionResult);
    }
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.