Package org.jboss.resteasy.security.smime

Examples of org.jboss.resteasy.security.smime.SignedInput


   @Test
   public void testSigned() throws Exception
   {
      WebTarget target = client.target("http://localhost:9095/smime/signed");
      SignedInput input = target.request().get(SignedInput.class);
      Customer cust = (Customer)input.getEntity(Customer.class);
      System.out.println("Signed Message From Server: ");
      System.out.println(cust);
      input.verify(cert);

   }
View Full Code Here


   @Test
   public void testEncryptedAndSignedGet() throws Exception
   {
      WebTarget target = client.target("http://localhost:9095/smime/encrypted/signed");
      EnvelopedInput enveloped = target.request().get(EnvelopedInput.class);
      SignedInput signed = (SignedInput)enveloped.getEntity(SignedInput.class, privateKey, cert);
      Customer cust = (Customer)signed.getEntity(Customer.class);
      System.out.println(cust);
      Assert.assertTrue(signed.verify(cert));
   }
View Full Code Here

   @Test
   public void testSignedOutput2() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/smime/signed"));
      SignedInput signed = request.getTarget(SignedInput.class);
      String output = (String) signed.getEntity(String.class);
      System.out.println(output);
      Assert.assertEquals("hello world", output);
      Assert.assertTrue(signed.verify(cert));
   }
View Full Code Here

   @Test
   public void testEncryptedSignedOutput() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/smime/encrypted/signed"));
      EnvelopedInput enveloped = request.getTarget(EnvelopedInput.class);
      SignedInput signed = (SignedInput) enveloped.getEntity(SignedInput.class, privateKey, cert);
      String output = (String) signed.getEntity(String.class);
      System.out.println(output);
      Assert.assertEquals("hello world", output);
      Assert.assertTrue(signed.verify(cert));
      Assert.assertEquals("hello world", output);
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.security.smime.SignedInput

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.