Package org.jboss.resteasy.util

Examples of org.jboss.resteasy.util.ParameterParser


   }

   public DKIMSignature(String headerValue)
   {
      this.headerValue = headerValue;
      ParameterParser parser = new ParameterParser();
      attributes = parser.parse(headerValue, ';');
      extractAttributes();
   }
View Full Code Here


      if (Arrays.equals(bh, enclosedBh) == false)
      {
         throw new SignatureException("Body hashes do not match.");
      }
      updateSignatureWithHeader(headers, verifier);
      ParameterParser parser = new ParameterParser();
      String strippedHeader = parser.setAttribute(headerValue.toCharArray(), 0, headerValue.length(), ';', "b", "");
      verifier.update(strippedHeader.getBytes());
      if (verifier.verify(getSignature()) == false)
      {
         throw new SignatureException("Failed to verify signature.");
      }
View Full Code Here

         signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());

         byte[] sig = {0x0f, 0x03};
         String encodedBadSig = Base64.encodeBytes(sig);

         ParameterParser parser = new ParameterParser();
         String s = signature.toString();
         String header = parser.setAttribute(s.toCharArray(), 0, s.length(), ';', "b", encodedBadSig);

         signature.setSignature(sig);
         return Response.ok("hello world").header(DKIMSignature.DKIM_SIGNATURE, header).build();
      }
View Full Code Here

   }

   public DKIMSignature(String headerValue)
   {
      this.headerValue = headerValue;
      ParameterParser parser = new ParameterParser();
      attributes = parser.parse(headerValue, ';');
      extractAttributes();
   }
View Full Code Here

         {
            throw new SignatureException("Body hashes do not match.");
         }
      }
      MultivaluedMap<String, String> verifiedHeaders = updateSignatureWithHeader(headers, verifier);
      ParameterParser parser = new ParameterParser();
      String strippedHeader = parser.setAttribute(headerValue.toCharArray(), 0, headerValue.length(), ';', "b", "");
      verifier.update(strippedHeader.getBytes());
      if (verifier.verify(getSignature()) == false)
      {
         throw new SignatureException("Failed to verify signature.");
      }
View Full Code Here

   @Test
   public void testSetAttribute() throws Exception
   {
      String header = "v=1   ;z=33333   ;b=xxxxxxx";
      ParameterParser parser = new ParameterParser();
      String output = parser.setAttribute(header.toCharArray(), 0, header.length(), ';', "b", "");
      System.out.println("<" + output + ">");
      Assert.assertEquals("v=1   ;z=33333   ;b=", output);
   }
View Full Code Here

   @Test
   public void testSetAttribute2() throws Exception
   {
      String header = "v=1   ;z=33333   ;b=xxxxxxx   ;   foo=bar   ";
      ParameterParser parser = new ParameterParser();
      String output = parser.setAttribute(header.toCharArray(), 0, header.length(), ';', "b", "");
      System.out.println("<" + output + ">");
      Assert.assertEquals("v=1   ;z=33333   ;b=;   foo=bar   ", output);
   }
View Full Code Here

         signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());

         byte[] sig = {0x0f, 0x03};
         String encodedBadSig = Base64.encodeBytes(sig);

         ParameterParser parser = new ParameterParser();
         String s = signature.toString();
         String header = parser.setAttribute(s.toCharArray(), 0, s.length(), ';', "b", encodedBadSig);

         signature.setSignature(sig);
         return Response.ok("hello world").header(DKIMSignature.DKIM_SIGNATURE, header).build();
      }
View Full Code Here

         Attributes attrs1 = dnsContext.getAttributes(alias, new String[]{"TXT"});
         javax.naming.directory.Attribute txtrecord = attrs1.get("txt");
         String record = txtrecord.get().toString();
         if (log.isDebugEnabled()) log.debug(">>>> DNS found record: " + record);
         ParameterParser parser = new ParameterParser();
         parser.setLowerCaseNames(true);
         Map<String, String> keyEntry = parser.parse(record, ';');
         String type = keyEntry.get("k");
         if (type != null && !type.toLowerCase().equals("rsa"))
            throw new RuntimeException("Unsupported key type: " + type);
         String pem = keyEntry.get("p");
         if (pem == null)
View Full Code Here

         signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());

         byte[] sig = {0x0f, 0x03};
         String encodedBadSig = Base64.encodeBytes(sig);

         ParameterParser parser = new ParameterParser();
         String s = signature.toString();
         String header = parser.setAttribute(s.toCharArray(), 0, s.length(), ';', "b", encodedBadSig);

         signature.setSignature(sig);
         return Response.ok("hello world").header(DKIMSignature.DKIM_SIGNATURE, header).build();
      }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.util.ParameterParser

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.