package com.fsenablers.security; import java.io.BufferedReader; import java.io.FileReader; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import org.xml.sax.InputSource; import org.apache.xml.security.utils.Constants; import org.apache.xml.security.utils.XMLUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; //import org.xml.sax.InputSource; public class SAML { public static void verify( String srcFile ) { System.out.println( "Verify: " + srcFile ); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = null; try { db = dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block e.printStackTrace(); } db.setErrorHandler(new IgnoreAllErrorHandler()); try { Document doc = db.parse( new InputSource( new BufferedReader( new FileReader( srcFile )))); Element nscontext = XMLUtils.createDSctx(doc, "ds", Constants.SignatureSpecNS); } catch( Exception e ) { } } /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub if( args.length == 0 ) { System.out.println( "No Command" ); } else { if( args[0].equalsIgnoreCase( "VERIFY" ) && args.length > 1 ) { verify( args[1] ); } } } }