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