Package org.jboss.resteasy.security.smime

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


   {
      @GET
      @Produces("application/pkcs7-signature")
      public SignedOutput get()
      {
         SignedOutput output = new SignedOutput("hello world", "text/plain");
         output.setCertificate(cert);
         output.setPrivateKey(privateKey);
         return output;
      }
View Full Code Here


      @GET
      @Path("text")
      @Produces("text/plain")
      public SignedOutput getText()
      {
         SignedOutput output = new SignedOutput("hello world", "text/plain");
         output.setCertificate(cert);
         output.setPrivateKey(privateKey);
         return output;
      }
View Full Code Here

   public static class EncryptedSignedResource
   {
      @GET
      public EnvelopedOutput get()
      {
         SignedOutput signed = new SignedOutput("hello world", "text/plain");
         signed.setCertificate(cert);
         signed.setPrivateKey(privateKey);

         EnvelopedOutput output = new EnvelopedOutput(signed, "multipart/signed");
         output.setCertificate(cert);
         return output;
      }
View Full Code Here

   public void testSignedPost() throws Exception
   {
      WebTarget target = client.target("http://localhost:9095/smime/signed");
      Customer cust = new Customer();
      cust.setName("Bill");
      SignedOutput output = new SignedOutput(cust, "application/xml");
      output.setPrivateKey(privateKey);
      output.setCertificate(cert);
      Response res = target.request().post(Entity.entity(output, "multipart/signed"));
      Assert.assertEquals(204, res.getStatus());
      res.close();
   }
View Full Code Here

   public void testEncryptedSignedPost() throws Exception
   {
      WebTarget target = client.target("http://localhost:9095/smime/encrypted/signed");
      Customer cust = new Customer();
      cust.setName("Bill");
      SignedOutput signed = new SignedOutput(cust, "application/xml");
      signed.setPrivateKey(privateKey);
      signed.setCertificate(cert);
      EnvelopedOutput output = new EnvelopedOutput(signed, "multipart/signed");
      output.setCertificate(cert);
      Response res = target.request().post(Entity.entity(output, "application/pkcs7-mime"));
      Assert.assertEquals(204, res.getStatus());
      res.close();
View Full Code Here

   @Test
   public void testEncryptedSignedInput() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/smime/encrypted/signed"));
      SignedOutput signed = new SignedOutput("input", "text/plain");
      signed.setPrivateKey(privateKey);
      signed.setCertificate(cert);
      EnvelopedOutput output = new EnvelopedOutput(signed, "multipart/signed");
      output.setCertificate(cert);
      ClientResponse res = request.body("*/*", output).post();
      Assert.assertEquals(204, res.getStatus());
   }
View Full Code Here

   @Test
   public void testSignedInput() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/smime/signed"));
      SignedOutput output = new SignedOutput("input", "text/plain");
      output.setCertificate(cert);
      output.setPrivateKey(privateKey);
      ClientResponse res = request.body("multipart/signed", output).post();
      Assert.assertEquals(204, res.getStatus());
   }
View Full Code Here

   @Test
   public void testPKCS7SignedInput() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/smime/pkcs7-signature"));
      SignedOutput output = new SignedOutput("input", "text/plain");
      output.setCertificate(cert);
      output.setPrivateKey(privateKey);
      ClientResponse res = request.body("application/pkcs7-signature", output).post();
      Assert.assertEquals(204, res.getStatus());
   }
View Full Code Here

   {
      @GET
      @Produces("multipart/signed")
      public SignedOutput get()
      {
         SignedOutput output = new SignedOutput("hello world", "text/plain");
         output.setCertificate(cert);
         output.setPrivateKey(privateKey);
         return output;
      }
View Full Code Here

      {
         log.warn("privateKey or certificate not set for this operation");
         throw new WebApplicationException(500);
      }
      Access access = create(auth);
      SignedOutput signed = new SignedOutput(access, "application/json");
      signed.setPrivateKey(privateKey);
      signed.setCertificate(certificate);
      return signed;
   }
View Full Code Here

TOP

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

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.