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

The following examples show how to use org.apache.xml.security.utils.ElementProxy. 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 File: Init.java    From xades4j with 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
Source File: SantuarioInitializer.java    From dss with GNU Lesser General Public License v2.1 4 votes vote down vote up
/**
 * 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();
}