RevocationHelper extends AbstractHelper { private RevocationHelper(String revocationStoragePrefix, String revocationResourcesPrefix) throws URISyntaxException { log.info("RevocationHelper : create instance - storage prefix : " + revocationStoragePrefix + " - resouces prefix : " + revocationResourcesPrefix); try { AbceConfigurationImpl configuration = this.setupStorageFilesForConfiguration(revocationStoragePrefix, CryptoEngine.IDEMIX); Injector injector = Guice.createInjector(ProductionModuleFactory .newModule(configuration, CryptoEngine.IDEMIX)); this.engine = injector.getInstance(RevocationAbcEngine.class); this.revocationProxyAuthority = injector.getInstance(RevocationProxyAuthority.class); this.keyManager = injector.getInstance(KeyManager.class); log.fine("keymanager : " + this.keyManager); } catch (Exception e) { log.log(Level.SEVERE, "Init Failed", e); throw new IllegalStateException("Could not setup issuer !", e); } } private  RevocationHelper(String revocationStoragePrefix, String revocationResourcesPrefix); static synchronized boolean isInit(); static synchronized void resetInstance(); static synchronized RevocationHelper getInstance(); static synchronized RevocationHelper initInstance(String revocationStoragePrefix,
      String revocationResourcesPrefix, SystemParameters systemParameters,
      RevocationReferences... revocationReferences); static synchronized RevocationHelper initInstance(String revocationStoragePrefix,
      String revocationResourcesPrefix, SystemParameters systemParameters,
      List<IssuerParameters> issuerParamsList, List<CredentialSpecification> credSpecList,
      RevocationReferences... revocationReferences); static synchronized RevocationHelper XXXinitInstancXe(String revocationStoragePrefix,
      String[] issuerParamsResourceList, String[] credSpecResourceList,
      String systemParametersResource, String[] revocationAuthorityResourceList); static synchronized RevocationAuthorityParameters setupParameters(
      URI revocationTechnology, int keyLength, URI uid, Reference revocationInfoReference,
      Reference nonRevocationEvidenceReference, Reference nonRevocationUpdateReference,
      String revocationResourcesPrefix); public RevocationAbcEngine engine; public RevocationProxyAuthority revocationProxyAuthority; }
@Test public void testRevocationHelper() throws Exception { String fileStoragePrefix = null; if (new File("target").exists()) { fileStoragePrefix = "target/revocation-test/"; } else { fileStoragePrefix = "service-helper/target/revocation-test/"; } IssuanceHelper.initInstance(1024, fileStoragePrefix, fileStoragePrefix, new SpecAndPolicy[] {universityIdemix}, new ArrayList<RevocationAuthorityParameters>()); URI revocationInfoReference = URI.create("http: URI nonRevocationEvidenceReference = URI.create("http: URI nonRevocationUpdateReference = URI.create("http: RevocationReferences revocationReferences = new RevocationReferences(patrasRevocationAuthority, revocationInfoReference, nonRevocationEvidenceReference, nonRevocationUpdateReference); String systemParametersResource = fileStoragePrefix + RevocationHelper.SYSTEM_PARAMS_XML_NAME; SystemParameters systemParameters = FileSystem.loadXmlFromResource(systemParametersResource); List<IssuerParameters> issuerParamsList = FileSystem.findAndLoadXmlResourcesInDir(fileStoragePrefix, "issuer_params"); String[] credSpecResourceList = {"/eu/abc4trust/sampleXml/patras/credentialSpecificationPatrasUniversityWithRevocation.xml"}; List<CredentialSpecification> credSpecList = FileSystem.loadXmlListFromResources(credSpecResourceList); System.out.println("============================================="); RevocationHelper.initInstance(fileStoragePrefix, fileStoragePrefix, systemParameters, issuerParamsList, credSpecList, revocationReferences); String[] revocationAuthorityParameters_resources = FileSystem.findFilesInDir(fileStoragePrefix, "revocation_authority"); System.out.println("revocationAuthorityParameters_resources : " + revocationAuthorityParameters_resources); System.out.println("revocationAuthorityParameters_resources : " + revocationAuthorityParameters_resources[0]); RevocationAuthorityParameters revocationAuthorityParameters = (RevocationAuthorityParameters) FileSystem .loadXmlFromResource(revocationAuthorityParameters_resources[0]); Assert.assertNotNull("RevocationInfoReference - should have been assigned", revocationAuthorityParameters.getRevocationInfoReference()); Assert.assertNotNull("NonRevocationEvidenceReference - should have been assigned", revocationAuthorityParameters.getNonRevocationEvidenceReference()); Assert.assertNotNull("RevocationEvidenceUpdateReference - should have been assigned", revocationAuthorityParameters.getNonRevocationEvidenceUpdateReference()); System.out.println("revocationAuthorityParameters_resources : " + XmlUtils.toXml(of.createRevocationAuthorityParameters(revocationAuthorityParameters), false)); System.out.println("revocationAuthorityParameters_resources : " + XmlUtils.toXml(of.createRevocationAuthorityParameters(revocationAuthorityParameters), true)); }