use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class WSSecurityPolicyExamples21xTestCase method test2121.
/**
* 2.1.2.1 UsernameToken as supporting token
*
* @throws Exception
*/
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test2121() throws Exception {
Service service = Service.create(new URL("https", baseURL.getHost(), (baseURL.getPort() - 8080 + 8443), "/jaxws-samples-wsse-policy-oasis-21x/SecurityService2121?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService2121Port"), ServiceIface.class);
setupWsse(proxy, false);
assertTrue(proxy.sayHello().equals("Hello - UsernameToken as supporting token"));
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class WSSecurityPolicyExamples21xTestCase method test2112.
/**
* 2.1.1.2 UsernameToken without password
*
* @throws Exception
*/
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test2112() throws Exception {
Service service = Service.create(new URL(baseURL + "/SecurityService2112?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService2112Port"), ServiceIface.class);
setupWsse(proxy, false);
assertTrue(proxy.sayHello().equals("Hello - UsernameToken without password"));
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class WSSecurityPolicyExamples21xTestCase method test2113.
/**
* 2.1.1.3 UsernameToken with timestamp, nonce and password hash
*
* @throws Exception
*/
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test2113() throws Exception {
Service service = Service.create(new URL(baseURL + "/SecurityService2113?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService2113Port"), ServiceIface.class);
setupWsse(proxy, true);
assertTrue(proxy.sayHello().equals("Hello - UsernameToken with timestamp, nonce and password hash"));
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class WSSecurityPolicyExamples21xTestCase method test213.
/**
* 2.1.3 (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign, Encrypt
*
* @throws Exception
*/
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test213() throws Exception {
Service service = Service.create(new URL(baseURL + "/SecurityService213?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService213Port"), ServiceIface.class);
setupWsse(proxy, true);
assertTrue(proxy.sayHello().equals("Hello - (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign, Encrypt"));
}
use of org.jboss.wsf.test.WrapThreadContextClassLoader in project jbossws-cxf by jbossws.
the class WSSecurityPolicyExamples22xTestCase method test224.
/**
* 2.2.4 (WSS1.1) Mutual Authentication with X.509 Certificates, Sign, Encrypt
*
* Client and server X509 certificates are used for client and server authorization respectively. Request is signed using K, then
* encrypted using K, K is ephemeral key protected for server's certificate. Signature corresponding to K is signed using client certificate.
* Response is signed using K, encrypted using K, encrypted key K is not included in response. Alternatively, derived keys can be used for
* each of the encryption and signature operations by simply adding an sp:RequireDerivedKeys assertion.
*
* @throws Exception
*/
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test224() throws Exception {
Service service = Service.create(new URL(baseURL + "SecurityService224?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService224Port"), ServiceIface.class);
setupWsse(proxy, false);
try {
assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
} catch (Exception e) {
throw CryptoCheckHelper.checkAndWrapException(e);
}
}
Aggregations