@Test public void testSign() { String inputFile = XMLSignerTest.class.getResource("/" + INPUT_FILE) .getPath(); String outputFile = new File(inputFile).getParent() + File.separator + OUTPUT_FILE; try { XMLSigner.sign(inputFile, outputFile, REFERENCE_URI); } catch (Exception e) { e.printStackTrace(); Assert.fail("Shouldn't be here."); } }
public void sign(String inputFile, String outputFile, String referenceURI) throws Exception { File ipFile = new File(inputFile); File opFile = new File(outputFile); SecurityUtil.print(ipFile); KeyPair keyPair = KeyStoreManager.getKeyPair(XMLSigner.class .getResource("/" + KEYSTORE).getPath(), STORE_PASSWORD, KEY_PASSWORD, ALIAS); SignatureManager sigMgr = new SignatureManager(keyPair, XMLSigner.class .getResource("/" + CERTIFICATE).getPath(), referenceURI); sigMgr.sign(ipFile, opFile); SecurityUtil.print(opFile); }
XMLSigner { public void sign(String inputFile, String outputFile, String referenceURI) throws Exception { File ipFile = new File(inputFile); File opFile = new File(outputFile); SecurityUtil.print(ipFile); KeyPair keyPair = KeyStoreManager.getKeyPair(XMLSigner.class .getResource("/" + KEYSTORE).getPath(), STORE_PASSWORD, KEY_PASSWORD, ALIAS); SignatureManager sigMgr = new SignatureManager(keyPair, XMLSigner.class .getResource("/" + CERTIFICATE).getPath(), referenceURI); sigMgr.sign(ipFile, opFile); SecurityUtil.print(opFile); } }
XMLSigner { public void sign(String inputFile, String outputFile, String referenceURI) throws Exception { File ipFile = new File(inputFile); File opFile = new File(outputFile); SecurityUtil.print(ipFile); KeyPair keyPair = KeyStoreManager.getKeyPair(XMLSigner.class .getResource("/" + KEYSTORE).getPath(), STORE_PASSWORD, KEY_PASSWORD, ALIAS); SignatureManager sigMgr = new SignatureManager(keyPair, XMLSigner.class .getResource("/" + CERTIFICATE).getPath(), referenceURI); sigMgr.sign(ipFile, opFile); SecurityUtil.print(opFile); }  }
XMLSigner { public void sign(String inputFile, String outputFile, String referenceURI) throws Exception { File ipFile = new File(inputFile); File opFile = new File(outputFile); SecurityUtil.print(ipFile); KeyPair keyPair = KeyStoreManager.getKeyPair(XMLSigner.class .getResource("/" + KEYSTORE).getPath(), STORE_PASSWORD, KEY_PASSWORD, ALIAS); SignatureManager sigMgr = new SignatureManager(keyPair, XMLSigner.class .getResource("/" + CERTIFICATE).getPath(), referenceURI); sigMgr.sign(ipFile, opFile); SecurityUtil.print(opFile); }  void sign(String inputFile, String outputFile, String referenceURI); void validate(String inputFile); }
XMLSigner { public void sign(String inputFile, String outputFile, String referenceURI) throws Exception { File ipFile = new File(inputFile); File opFile = new File(outputFile); SecurityUtil.print(ipFile); KeyPair keyPair = KeyStoreManager.getKeyPair(XMLSigner.class .getResource("/" + KEYSTORE).getPath(), STORE_PASSWORD, KEY_PASSWORD, ALIAS); SignatureManager sigMgr = new SignatureManager(keyPair, XMLSigner.class .getResource("/" + CERTIFICATE).getPath(), referenceURI); sigMgr.sign(ipFile, opFile); SecurityUtil.print(opFile); }  void sign(String inputFile, String outputFile, String referenceURI); void validate(String inputFile);  }