Package org.jboss.ws.extensions.security.exception

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


      boolean fault = message.getSOAPBody().getFault() != null;
      if (secHeaderElement == null)
      {
         if (hasRequirements(config, fault))
            throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
      }

      try
      {
         if (secHeaderElement != null)
View Full Code Here


         // This is ok, we always allow faults to be received because WS-Security does not encrypt faults
         if (message.getSOAPBody().getFault() != null)
            return;

         if (hasRequirements(config))
            throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
      }

      try
      {
         if (secHeaderElement != null)
View Full Code Here

   private String getEncryptionAlgorithm(Element element) throws WSSecurityException
   {
      element = Util.findElement(element, "EncryptionMethod", Constants.XML_ENCRYPTION_NS);
      if (element == null)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");

      String alg = element.getAttribute("Algorithm");
      if (alg == null || alg.length() == 0)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");

      return alg;
   }
View Full Code Here

   private String getEncryptionAlgorithm(Element element) throws WSSecurityException
   {
      element = Util.findElement(element, "EncryptionMethod", Constants.XML_ENCRYPTION_NS);
      if (element == null)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");

      String alg = element.getAttribute("Algorithm");
      if (alg == null || alg.length() == 0)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");

      return alg;
   }
View Full Code Here

   public X509IssuerSerial(Element element) throws WSSecurityException
   {
      this.doc = element.getOwnerDocument();

      if (! "X509Data".equals(element.getLocalName()))
         throw new InvalidSecurityHeaderException("Invalid message, invalid local name on a X509Data element");

      element = Util.getFirstChildElement(element);
      if (element == null)
         throw new InvalidSecurityHeaderException("X509DataElement empty");

      if (! element.getLocalName().equals("X509IssuerSerial"))
         throw new InvalidSecurityHeaderException("Only X509IssuerSerial is supported for an X509Data element");

      element = Util.getFirstChildElement(element);
      if (element == null)
         throw new InvalidSecurityHeaderException("X509IssuerSerial empty");


      while (element != null)
      {
         String name = element.getLocalName();
         if (name.equals("X509IssuerName"))
            issuer = XMLUtils.getFullTextChildrenFromElement(element);
         else if (name.equals("X509SerialNumber"))
            serial = XMLUtils.getFullTextChildrenFromElement(element);

         element = Util.getNextSiblingElement(element);
      }

      if (serial == null)
         throw new InvalidSecurityHeaderException("X509SerialNumber missing from X509IssuerSerial");

      if (issuer == null)
         throw new InvalidSecurityHeaderException("X509IssuerName missing from X509IssuerSerial");
   }
View Full Code Here

         // This is ok, we always allow faults to be received because WS-Security does not encrypt faults
         if (message.getSOAPBody().getFault() != null)
            return;

         if (hasRequirements(config))
            throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));
      }

      try
      {
         if (secHeaderElement != null)
View Full Code Here

   private String getEncryptionAlgorithm(Element element) throws WSSecurityException
   {
      element = Util.findElement(element, "EncryptionMethod", Constants.XML_ENCRYPTION_NS);
      if (element == null)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");

      String alg = element.getAttribute("Algorithm");
      if (alg == null || alg.length() == 0)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");

      return alg;
   }
View Full Code Here

   public X509IssuerSerial(Element element) throws WSSecurityException
   {
      this.doc = element.getOwnerDocument();

      if (! "X509Data".equals(element.getLocalName()))
         throw new InvalidSecurityHeaderException("Invalid message, invalid local name on a X509Data element");

      element = Util.getFirstChildElement(element);
      if (element == null)
         throw new InvalidSecurityHeaderException("X509DataElement empty");

      if (! element.getLocalName().equals("X509IssuerSerial"))
         throw new InvalidSecurityHeaderException("Only X509IssuerSerial is supported for an X509Data element");

      element = Util.getFirstChildElement(element);
      if (element == null)
         throw new InvalidSecurityHeaderException("X509IssuerSerial empty");


      while (element != null)
      {
         String name = element.getLocalName();
         if (name.equals("X509IssuerName"))
            issuer = XMLUtils.getFullTextChildrenFromElement(element);
         else if (name.equals("X509SerialNumber"))
            serial = XMLUtils.getFullTextChildrenFromElement(element);

         element = Util.getNextSiblingElement(element);
      }

      if (serial == null)
         throw new InvalidSecurityHeaderException("X509SerialNumber missing from X509IssuerSerial");

      if (issuer == null)
         throw new InvalidSecurityHeaderException("X509IssuerName missing from X509IssuerSerial");
   }
View Full Code Here

         // This is ok, we always allow faults to be received because WS-Security does not encrypt faults
         if (message.getSOAPBody().getFault() != null)
            return;

         if (hasRequirements(config))
            throw convertToFault(new InvalidSecurityHeaderException("This service requires <wsse:Security>, which is missing."));

         return;
      }

      try
View Full Code Here

   private String getEncryptionAlgorithm(Element element) throws WSSecurityException
   {
      element = Util.findElement(element, "EncryptionMethod", Constants.XML_ENCRYPTION_NS);
      if (element == null)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");

      String alg = element.getAttribute("Algorithm");
      if (alg == null || alg.length() == 0)
         throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");

      return alg;
   }
View Full Code Here

TOP

Related Classes of org.jboss.ws.extensions.security.exception.InvalidSecurityHeaderException

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.