@Test public void createSimpleContainer() throws Exception { URL trdm090Resource = CreateContainerTest.class.getClassLoader().getResource(TRDM090_SUBMIT_TENDER_SAMPLE_XML); assertNotNull( trdm090Resource, "Unable to locate " + TRDM090_SUBMIT_TENDER_SAMPLE_XML + " in class path"); File trdm090SampleFile = new File(trdm090Resource.toURI()); URL keystoreUrl = CreateContainerTest.class.getClassLoader().getResource(VEFA_INNLEVERING_JKS); assertNotNull(keystoreUrl, "Unable to locate the keystore " + VEFA_INNLEVERING_JKS); File keyStoreFile = new File(keystoreUrl.toURI()); assertTrue(keyStoreFile.canRead(), "Keystore " + VEFA_INNLEVERING_JKS + " not readable"); File archiveOutputFile = new File(System.getProperty("java.io.tmpdir"), "vefa-sample.asice"); AsicWriterFactory asicWriterFactory = AsicWriterFactory.newFactory(); asicWriterFactory .newContainer(archiveOutputFile) .add(trdm090SampleFile) .setRootEntryName(trdm090SampleFile.getName()) .sign( keyStoreFile, KeyStoreUtil.getKeyStorePassword(), KeyStoreUtil.getPrivateKeyPassord()); log.debug("Created ASiC archive in " + archiveOutputFile); }