Java Code Examples for org.apache.xml.security.utils.ElementProxy

The following examples show how to use org.apache.xml.security.utils.ElementProxy. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: xades4j   Source File: Init.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
static void initXMLSec()
{
    org.apache.xml.security.Init.init();
    try
    {
        ElementProxy.setDefaultPrefix(Constants.SignatureSpecNS, "ds");
        ElementProxy.setDefaultPrefix(QualifyingProperty.XADES_XMLNS, "xades");
        ElementProxy.setDefaultPrefix(QualifyingProperty.XADESV141_XMLNS, "xades141");
    } catch (XMLSecurityException ex)
    {
    }
}
 
Example 2
/**
 * Dynamically initialise the library by registering the default
 * algorithms/implementations
 */
private static void dynamicInit() {
	//
	// Load the Resource Bundle - the default is the English resource bundle.
	// To load another resource bundle, call I18n.init(...) before calling this
	// method.
	//
	I18n.init("en", "US");

	if (LOG.isDebugEnabled()) {
		LOG.debug("Registering default algorithms");
	}
	try {
		//
		// Bind the default prefixes
		//
		ElementProxy.registerDefaultPrefixes();
	} catch (XMLSecurityException ex) {
		LOG.error(ex.getMessage(), ex);
	}

	//
	// Set the default Transforms
	//
	Transform.registerDefaultAlgorithms();

	//
	// Set the default signature algorithms
	//
	SignatureAlgorithm.registerDefaultAlgorithms();

	//
	// Set the default JCE algorithms
	//
	JCEMapper.registerDefaultAlgorithms();

	//
	// Set the default c14n algorithms
	//
	Canonicalizer.registerDefaultAlgorithms();

	//
	// Register the default resolvers (custom)
	//
	registerDefaultResolvers();

	//
	// Register the default key resolvers
	//
	KeyResolver.registerDefaultResolvers();
}