Examples of FailedCheckException


Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

      STRTransform.setSecurityStore(store);

      try
      {
         if (! xmlSig.checkSignatureValue(signature.getPublicKey()))
            throw new FailedCheckException("Signature is invalid.");
        
         SignatureKeysAssociation.saveKey(signature.getPublicKey());
      }
      catch (XMLSignatureException e)
      {
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

         }
      }

      if (rejectExpires)
      {
         throw new FailedCheckException("Expired message.");
      }

   }
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

   {
      QName name = target.getName();

      Element element = Util.findElement(message.getDocumentElement(), name);
      if (element == null)
         throw new FailedCheckException("Required QName was not present: " + name);

      String id = Util.getWsuId(element);

      if (id == null)
         throw new FailedCheckException("Required element did not contain a wsu:id.");

      Collection<String> result = new ArrayList<String>(1);
      result.add(id);

      return result;
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

      for (Target target : targets)
      {
          Collection<String> ids = resolveTarget(message, target);
          if (! processedIds.containsAll(ids))
             throw new FailedCheckException("Required elements for encryption and or signing are not all present.");
      }
   }
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

  
   public void process(Document message, SecurityHeader header, Collection<String> processedIds) throws WSSecurityException
   {
      Timestamp stamp = header.getTimestamp();
      if (stamp == null)
         throw new FailedCheckException("Required timestamp not present.");

      // If there is no maxAge specified then we are done
      if (maxAge == null)
         return;

      int max = Integer.parseInt(maxAge);

      Calendar expired = (Calendar)stamp.getCreated().clone();
      expired.add(Calendar.SECOND, max);

      if (! Calendar.getInstance().before(expired))
         throw new FailedCheckException("Timestamp of message is too old.");
   }
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

         cipher.init(XMLCipher.DECRYPT_MODE, key);
         cipher.doFinal(element.getOwnerDocument(), element);
      }
      catch (XMLEncryptionException e)
      {
         throw new FailedCheckException("Decryption was invalid.");
      }
      catch (Exception e)
      {
         throw new WSSecurityException("Could not decrypt element: " + e.getMessage(), e);
      }
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

         cipher.init(XMLCipher.DECRYPT_MODE, key);
         cipher.doFinal(element.getOwnerDocument(), element);
      }
      catch (XMLEncryptionException e)
      {
         throw new FailedCheckException("Decryption was invalid.");
      }
      catch (Exception e)
      {
         throw new WSSecurityException("Could not decrypt element: " + e.getMessage(), e);
      }
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

  
   public void process(Document message, SecurityHeader header, Collection<String> processedIds) throws WSSecurityException
   {
      Timestamp stamp = header.getTimestamp();
      if (stamp == null)
         throw new FailedCheckException("Required timestamp not present.");

      // If there is no maxAge specified then we are done
      if (maxAge == null)
         return;

      int max = Integer.parseInt(maxAge);

      Calendar expired = (Calendar)stamp.getCreated().clone();
      expired.add(Calendar.SECOND, max);

      if (! Calendar.getInstance().before(expired))
         throw new FailedCheckException("Timestamp of message is too old.");
   }
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

      STRTransform.setSecurityStore(store);

      try
      {
         if (! xmlSig.checkSignatureValue(signature.getPublicKey()))
            throw new FailedCheckException("Signature is invalid.");
        
         SignatureKeysAssociation.saveKey(signature.getPublicKey());
      }
      catch (XMLSignatureException e)
      {
View Full Code Here

Examples of org.jboss.ws.extensions.security.exception.FailedCheckException

      if (created.after(now))
         throw new WSSecurityException("Invalid timestamp, message claimed to be created after now");

      if (expired != null && ! now.before(expired))
         throw new FailedCheckException("Expired message.");
   }
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.