0 Replies Latest reply on Jun 3, 2013 3:08 AM by amit kumar

    Resteasy encryption using jboss

    amit kumar Newbie

      i have made one web service now i want to encrypt that json data using  rest easy encryption at server side


      in this i generate the certificate by Java keytool command-line interface.







                  public EnvelopedOutput getAllOpenMeetings(@QueryParam("batchsize")

                  int batchSize, @QueryParam("offset")

                  int offset, @Context

                  HttpServletRequest req) {



                    String ipAddress = req.getRemoteAddr();




                    EnvelopedOutput output=null;

                    CustomerBean bean=null;

                    try {

                       bean=new CustomerBean();




                      //certificate generation

                      FileInputStream stream = new FileInputStream("d:/my_keystore.pfx");


                                  KeyStore store = KeyStore.getInstance("pkcs12", "SunJSSE");


                                  store.load(stream, "my_password".toCharArray());


                                  Enumeration<String> aliases = store.aliases();


                                  while (aliases.hasMoreElements()) {




                                  X509Certificate certificate = (X509Certificate)store.getCertificate("my_certificate"); 



                       output = new EnvelopedOutput(bean, MediaType.APPLICATION_XML_TYPE);





                    }  catch (Exception ex) {


                      String result = "Error 500 - Internal Server Error";


      //                throw new WebApplicationException(Response.status(500).entity(result).build());




                    return output;




      but i am not getting output in encrypted form where is the problem please tell me ...


      please help me

      Thank you