Package javax.xml.crypto.dsig

Examples of javax.xml.crypto.dsig.XMLSignatureException


        return search;
    }

    protected void checkSearchValueOfType(Class<?> cl, Input input) throws Exception { //NOPMD
        if (!cl.isAssignableFrom(input.getOutputNodeSearch().getClass())) {
            throw new XMLSignatureException(String.format(
                    "Wrong configruation: Search value is of class %s, the output node search %s requires class %s.", input
                            .getOutputNodeSearch().getClass().getName(), input.getOutputNodeSearchType(), cl.getName()));
        }

    }
View Full Code Here


    }

    protected void checkStringSarchValueNotEmpty(String searchValue, String outputNodeSearchType) throws Exception { //NOPMD
        if (searchValue.isEmpty()) {
            throw new XMLSignatureException(String.format("Wrong configruation: Value for output node search %s is empty.",
                    outputNodeSearchType));
        }
    }
View Full Code Here

    protected void checkSearchValueNotNull(Input input) throws Exception { //NOPMD
        LOG.debug("Searching for output element with search value '{}' and sarch type {}", input.getOutputNodeSearch(),
                input.getOutputNodeSearchType());
        if (input.getOutputNodeSearch() == null) {
            throw new XMLSignatureException(String.format("Wrong configruation: Value is missing for output node search %s.",
                    input.getOutputNodeSearchType()));
        }
    }
View Full Code Here

    }

    protected void checkStringSarchValueNotEmpty(String searchValue, String outputNodeSearchType) throws Exception { //NOPMD
        if (searchValue.isEmpty()) {
            throw new XMLSignatureException(String.format("Wrong configruation: Value for output node search %s is empty.",
                    outputNodeSearchType));
        }
    }
View Full Code Here

    protected void checkSearchValueNotNull(Input input) throws Exception { //NOPMD
        LOG.debug("Searching for output element with search value '{}' and sarch type {}", input.getOutputNodeSearch(),
                input.getOutputNodeSearchType());
        if (input.getOutputNodeSearch() == null) {
            throw new XMLSignatureException(String.format("Wrong configruation: Value is missing for output node search %s.",
                    input.getOutputNodeSearchType()));
        }
    }
View Full Code Here

                logger.log(Level.FINE, "Digest Algorithm is "+ this.getDigestMethod().getAlgorithm());
                logger.log(Level.FINE, "Mapped Digest Algorithm is "+ algo);
            }
            _md = MessageDigest.getInstance(algo);
        } catch (NoSuchAlgorithmException nsae) {
            throw new XMLSignatureException(nsae);
        }
        dos = new DigesterOutputStream(_md);
        return dos;
    }
View Full Code Here

                }
                _md = MessageDigest.getInstance(algo);
               
            } catch (NoSuchAlgorithmException nsae) {
                logger.log(Level.SEVERE,LogStringsMessages.WSS_1760_DIGEST_INIT_ERROR(),nsae);
                throw new XMLSignatureException(nsae);
            }
        }
        _md.reset();
        DigesterOutputStream dos;
       
        //Boolean cache = (Boolean)context.getProperty("javax.xml.crypto.dsig.cacheReference");
       
        dos = new DigesterOutputStream(_md);
        OutputStream os = new UnsyncBufferedOutputStream(dos);
        Data data = dereferencedData;
        if ( transforms != null ) {
            List<Transform> transformList = ((TransformsType)transforms).getTransform();
            if ( transformList != null ) {
                for (int i = 0, size = transformList.size(); i < size; i++) {
                    Transform transform = (Transform) transformList.get(i);
                    try {
                        if (i < size - 1) {
                            data = transform.transform(data, context);
                        } else {
                            data = transform.transform(data, context, os);
                        }
                    } catch (TransformException te) {
                        logger.log(Level.SEVERE,LogStringsMessages.WSS_1759_TRANSFORM_ERROR(te.getMessage()),te);
                        throw new XMLSignatureException(te);
                    }
                }
            }
        }
       
        try {
            os.flush();
            dos.flush();
        } catch (IOException ex) {
            logger.log(Level.SEVERE,LogStringsMessages.WSS_1761_TRANSFORM_IO_ERROR(),ex);
            throw new XMLSignatureException(ex);
        }
       
        return dos.getDigestValue();
    }
View Full Code Here

        URIDereferencer deref = context.getURIDereferencer();
       
        try {
            data = deref.dereference(this, context);
        } catch (URIReferenceException ure) {
            throw new XMLSignatureException(ure);
        }
        return data;
    }
View Full Code Here

        return search;
    }

    protected void checkSearchValueOfType(Class<?> cl, Input input) throws Exception { //NOPMD
        if (!cl.isAssignableFrom(input.getOutputNodeSearch().getClass())) {
            throw new XMLSignatureException(String.format(
                    "Wrong configruation: Search value is of class %s, the output node search %s requires class %s.", input
                            .getOutputNodeSearch().getClass().getName(), input.getOutputNodeSearchType(), cl.getName()));
        }

    }
View Full Code Here

    }

    protected void checkStringSarchValueNotEmpty(String searchValue, String outputNodeSearchType) throws Exception { //NOPMD
        if (searchValue.isEmpty()) {
            throw new XMLSignatureException(String.format("Wrong configruation: Value for output node search %s is empty.",
                    outputNodeSearchType));
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.crypto.dsig.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.