Package org.jboss.resteasy.security.smime

Examples of org.jboss.resteasy.security.smime.PKCS7SignatureInput.verify()


      String signed = new SkeletonKeyClientBuilder().username("jsmith").password("foobar").idp(target).obtainSignedToken("Skeleton Key");
      System.out.println(signed);
      PKCS7SignatureInput input = new PKCS7SignatureInput(signed);
      input.setCertificate(certificate);
      Assert.assertTrue(input.verify());
      client.close();
   }


   @Test
View Full Code Here


      boolean verify = false;
      try
      {
         input = new PKCS7SignatureInput(header);
         input.setProviders(providers);
         verify = input.verify(certificate);
      }
      catch (Exception e)
      {
         throw new WebApplicationException(403);
      }
View Full Code Here

      signed.setProviders(request.getProviderFactory());

      String output = (String) signed.getEntity(String.class, MediaType.TEXT_PLAIN_TYPE);
      System.out.println(output);
      Assert.assertEquals("hello world", output);
      Assert.assertTrue(signed.verify(cert));
   }


   @Test
   public void testEncryptedOutput() throws Exception
View Full Code Here

         throw new LoginException("Could not get certificate from keyStore");
      }
      try
      {
         PKCS7SignatureInput input = new PKCS7SignatureInput(tokenHeader);
         if (input.verify(certificate) == false) throw new LoginException("Bad Signature");
         access = (Access)input.getEntity(Access.class, MediaType.APPLICATION_JSON_TYPE);

      }
      catch (LoginException le)
      {
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.