Package org.apache.xml.security.signature

Examples of org.apache.xml.security.signature.XMLSignatureException


     * @param secureRandom
     * @throws XMLSignatureException
     */
    protected void engineInitSign(Key secretKey, SecureRandom secureRandom)
        throws XMLSignatureException {
        throw new XMLSignatureException("algorithms.CannotUseSecureRandomOnMAC");
    }
View Full Code Here


     */
    protected void engineUpdate(byte[] input) throws XMLSignatureException {
        try {
            this.macAlgorithm.update(input);
        } catch (IllegalStateException ex) {
            throw new XMLSignatureException("empty", ex);
        }
    }
View Full Code Here

     */
    protected void engineUpdate(byte input) throws XMLSignatureException {
        try {
            this.macAlgorithm.update(input);
        } catch (IllegalStateException ex) {
            throw new XMLSignatureException("empty", ex);
        }
    }
View Full Code Here

     */
    protected void engineUpdate(byte buf[], int offset, int len) throws XMLSignatureException {
        try {
            this.macAlgorithm.update(buf, offset, len);
        } catch (IllegalStateException ex) {
            throw new XMLSignatureException("empty", ex);
        }
    }
View Full Code Here

            (SignatureAlgorithmSpi) Class.forName(implementingClass)
               .newInstance();
      } catch (ClassNotFoundException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      } catch (IllegalAccessException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      } catch (InstantiationException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      } catch (NullPointerException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      }
   }
View Full Code Here

         this._signatureAlgorithm
            .engineGetContextFromElement(this._constructionElement);
      } catch (ClassNotFoundException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      } catch (IllegalAccessException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      } catch (InstantiationException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      } catch (NullPointerException ex) {
         Object exArgs[] = { algorithmURI, ex.getMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs,
                                         ex);
      }
   }
View Full Code Here

                                        algorithmID.getProviderId());
      } catch (java.security.NoSuchAlgorithmException ex) {
         Object[] exArgs = { algorithmID.getAlgorithmID(),
                             ex.getLocalizedMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs);
      } catch (java.security.NoSuchProviderException ex) {
         Object[] exArgs = { algorithmID.getProviderId(),
                             ex.getLocalizedMessage() };

         throw new XMLSignatureException("algorithms.NoSuchAlgorithm", exArgs);
      }

      return new MessageDigestAlgorithm(doc, md, algorithmURI);
   }
View Full Code Here

                                            Constants.getSignatureSpecNSprefix()
                                            + ":" + elementName);

      /* bigInteger must be positive */
      if (bigInteger.signum() != 1) {
         throw new XMLSignatureException("signature.Util.BignumNonPositive");
      }

      byte byteRepresentation[] = bigInteger.toByteArray();

      while (byteRepresentation[0] == 0) {
View Full Code Here

   public static BigInteger getBigintFromElement(Element element)
           throws XMLSignatureException {

      try {
         if (element.getChildNodes().getLength() != 1) {
            throw new XMLSignatureException("signature.Util.TooManyChilds");
         }

         Node child = element.getFirstChild();

         if ((child == null) || (child.getNodeType() != Node.TEXT_NODE)) {
            throw new XMLSignatureException("signature.Util.NonTextNode");
         }

         Text text = (Text) child;
         String textData = text.getData();
         byte magnitude[] =
            org.apache.xml.security.utils.Base64.decode(textData);
         int signum = 1;
         BigInteger bigInteger = new BigInteger(signum, magnitude);

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

   public static byte[] getBytesFromElement(Element element)
           throws XMLSignatureException {

      try {
         if (element.getChildNodes().getLength() != 1) {
            throw new XMLSignatureException("signature.Util.TooManyChilds");
         }

         Node child = element.getFirstChild();

         if ((child == null) || (child.getNodeType() != Node.TEXT_NODE)) {
            throw new XMLSignatureException("signature.Util.NonTextNode");
         }

         Text text = (Text) child;
         String textData = text.getData();
         byte bytes[] = org.apache.xml.security.utils.Base64.decode(textData);

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

TOP

Related Classes of org.apache.xml.security.signature.XMLSignatureException

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.