List of usage examples for javax.xml.crypto NoSuchMechanismException NoSuchMechanismException
public NoSuchMechanismException(Throwable cause)
From source file:Main.java
/** * @throws NoSuchMechanismException/* w w w .ja va 2s . c om*/ */ static XMLSignatureFactory getDOMInstance() { try { return XMLSignatureFactory.getInstance("DOM"); } catch (NoSuchMechanismException nsme) { Provider provider; try { Class<?> clazz = Class.forName("org.jcp.xml.dsig.internal.dom.XMLDSigRI"); provider = (Provider) clazz.newInstance(); } catch (Exception e) { throw new NoSuchMechanismException(e); } return XMLSignatureFactory.getInstance("DOM", provider); } }