Package org.jboss.ws.extensions.security

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


   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

/*     */   public X509IssuerSerial(Element element) throws WSSecurityException
/*     */   {
/*  63 */     this.doc = element.getOwnerDocument();
/*     */
/*  65 */     if (!"X509Data".equals(element.getLocalName())) {
/*  66 */       throw new InvalidSecurityHeaderException("Invalid message, invalid local name on a X509Data element");
/*     */     }
/*  68 */     element = Util.getFirstChildElement(element);
/*  69 */     if (element == null) {
/*  70 */       throw new InvalidSecurityHeaderException("X509DataElement empty");
/*     */     }
/*  72 */     if (!element.getLocalName().equals("X509IssuerSerial")) {
/*  73 */       throw new InvalidSecurityHeaderException("Only X509IssuerSerial is supported for an X509Data element");
/*     */     }
/*  75 */     element = Util.getFirstChildElement(element);
/*  76 */     if (element == null) {
/*  77 */       throw new InvalidSecurityHeaderException("X509IssuerSerial empty");
/*     */     }
/*     */
/*  80 */     while (element != null)
/*     */     {
/*  82 */       String name = element.getLocalName();
/*  83 */       if (name.equals("X509IssuerName"))
/*  84 */         this.issuer = XMLUtils.getFullTextChildrenFromElement(element);
/*  85 */       else if (name.equals("X509SerialNumber")) {
/*  86 */         this.serial = XMLUtils.getFullTextChildrenFromElement(element);
/*     */       }
/*  88 */       element = Util.getNextSiblingElement(element);
/*     */     }
/*     */
/*  91 */     if (this.serial == null) {
/*  92 */       throw new InvalidSecurityHeaderException("X509SerialNumber missing from X509IssuerSerial");
/*     */     }
/*  94 */     if (this.issuer == null)
/*  95 */       throw new InvalidSecurityHeaderException("X509IssuerName missing from X509IssuerSerial");
/*     */   }
View Full Code Here

/*     */
/*     */   private String getEncryptionAlgorithm(Element element) throws WSSecurityException
/*     */   {
/* 136 */     element = Util.findElement(element, "EncryptionMethod", "http://www.w3.org/2001/04/xmlenc#");
/* 137 */     if (element == null) {
/* 138 */       throw new InvalidSecurityHeaderException("Encrypted element corrupted, no encryption method");
/*     */     }
/* 140 */     String alg = element.getAttribute("Algorithm");
/* 141 */     if ((alg == null) || (alg.length() == 0)) {
/* 142 */       throw new InvalidSecurityHeaderException("Encrypted element corrupted, no algorithm specified");
/*     */     }
/* 144 */     return alg;
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.ws.extensions.security.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.