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)
{
}
}
/**
* 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();
}