Examples of XMLSecurityException


Examples of org.apache.xml.security.exceptions.XMLSecurityException

            transforms = new Transforms(el, this.baseURI);
            transforms.setSecureValidation(secureValidation);
            if (secureValidation && transforms.getLength() > MAXIMUM_TRANSFORM_COUNT) {
                Object exArgs[] = { transforms.getLength(), MAXIMUM_TRANSFORM_COUNT };
               
                throw new XMLSecurityException("signature.tooManyTransforms", exArgs);
            }
            el = XMLUtils.getNextElement(el.getNextSibling());
        }
        digestMethodElem = el;
        digestValueElement = XMLUtils.getNextElement(digestMethodElem.getNextSibling());
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

     */
    public byte[] getDigestValue() throws Base64DecodingException, XMLSecurityException {
        if (digestValueElement == null) {
            // The required element is not in the XML!
            Object[] exArgs ={ Constants._TAG_DIGESTVALUE, Constants.SignatureSpecNS };
            throw new XMLSecurityException(
                "signature.Verification.NoSignatureElement", exArgs
            );
        }
        return Base64.decode(digestValueElement);
    }
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

     * @throws XMLSecurityException
     */
    private void validateReference(Element referentElement) throws XMLSecurityException {
        if (!XMLUtils.elementIsInSignatureSpace(referentElement, Constants._TAG_KEYINFO)) {
            Object exArgs[] = { new QName(referentElement.getNamespaceURI(), referentElement.getLocalName()) };
            throw new XMLSecurityException("KeyInfoReferenceResolver.InvalidReferentElement.WrongType", exArgs);
        }

        KeyInfo referent = new KeyInfo(referentElement, "");
        if (referent.containsKeyInfoReference()) {
            if (secureValidation) {
                throw new XMLSecurityException("KeyInfoReferenceResolver.InvalidReferentElement.ReferenceWithSecure");
            } else {
                // Don't support chains of references at this time. If do support in the future, this is where the code
                // would go to validate that don't have a cycle, resulting in an infinite loop. This may be unrealistic
                // to implement, and/or very expensive given remote URI references.
                throw new XMLSecurityException("KeyInfoReferenceResolver.InvalidReferentElement.ReferenceWithoutSecure");
            }
        }

    }
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

            return new Transforms(transformsElem, this._baseURI);
         }

         return null;
      } catch (XMLSignatureException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

      super(doc);

      try {
         this.addBase64Text(x509certificate.getEncoded());
      } catch (java.security.cert.CertificateEncodingException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

            return cert;
         }

         return null;
      } catch (CertificateException ex) {
         throw new XMLSecurityException("empty", ex);
      }
   }
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

    */
   public void setElement(Element element, String BaseURI)
           throws XMLSecurityException {

      if (element == null) {
         throw new XMLSecurityException("ElementProxy.nullElement");
      }
      if (log.isDebugEnabled()) {
      }
     
      if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

           throws XMLSecurityException {

      this();

      if (element == null) {
         throw new XMLSecurityException("ElementProxy.nullElement");
      }
     
      if (log.isDebugEnabled()) {
        log.debug("setElement(\"" + element.getTagName() + "\", \"" + BaseURI
                + "\")");
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

      String namespaceIS = this._constructionElement.getNamespaceURI();
      if ( !localnameSHOULDBE.equals(localnameIS) ||
        !namespaceSHOULDBE.equals(namespaceIS)) {     
         Object exArgs[] = { namespaceIS +":"+ localnameIS,
           namespaceSHOULDBE +":"+ localnameSHOULDBE};
         throw new XMLSecurityException("xml.WrongElement", exArgs);
      }
   }
View Full Code Here

Examples of org.apache.xml.security.exceptions.XMLSecurityException

           throws XMLSecurityException {

      String ns;

      if ((prefix == null) || (prefix.length() == 0)) {
       throw new XMLSecurityException("defaultNamespaceCannotBeSetHere");
      } else if (prefix.equals("xmlns")) {
        throw new XMLSecurityException("defaultNamespaceCannotBeSetHere");
      } else if (prefix.startsWith("xmlns:")) {
         ns = prefix;//"xmlns:" + prefix.substring("xmlns:".length());
      } else {
         ns = "xmlns:" + prefix;
      }

     

      Attr a = this._constructionElement.getAttributeNodeNS(Constants.NamespaceSpecNS, ns);

      if (a != null) {
       if (!a.getNodeValue().equals(uri)) {
         Object exArgs[] = { ns,
                             this._constructionElement.getAttributeNS(null,
                                                                      ns) };

         throw new XMLSecurityException("namespacePrefixAlreadyUsedByOtherURI",
                                        exArgs);
       }
       return;
      }
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.