use of won.cryptography.service.CertificateService in project webofneeds by researchstudio-sat.
the class TestSigningUtils method generateKeystoreForNodeAndOwner.
/**
* Not a test - but sometimes can be useful for generating test keys.
*
* @throws Exception
*/
// @Test
public void generateKeystoreForNodeAndOwner() throws Exception {
Security.addProvider(new BouncyCastleProvider());
// KeyStoreService storeServiceOnNode = new KeyStoreService(new
// File("node-keys.jks"));
FileBasedKeyStoreService storeServiceOnOwner = new FileBasedKeyStoreService(new File("owner-keys.jks"), "temp");
storeServiceOnOwner.init();
// KeyStoreService storeServiceOnMatcher = new KeyStoreService(new
// File("matcher-keys.jks"));
KeyPairService keyPairService = new KeyPairService();
CertificateService certificateService = new CertificateService();
// addKeyByUris(new String[]{
// "http://rsa021.researchstudio.at:8080/won/resource",
// "http://sat016.researchstudio.at:8080/won/resource",
// "http://localhost:8080/won/resource"},
// keyPairService, certificateService, storeServiceOnNode);
addKeyByUris(new String[] { "http://rsa021.researchstudio.at:8080/owner/rest/keys", "http://sat016.researchstudio.at:8080/owner/rest/keys", "http://localhost:8080/owner/rest/keys" }, keyPairService, certificateService, storeServiceOnOwner);
// addKeyByUris(new String[]{
// "http://sat001.researchstudio.at:8080/matcher/resource",
// "http://localhost:8080/matcher/resource"},
// keyPairService, certificateService, storeServiceOnMatcher);
}
use of won.cryptography.service.CertificateService in project webofneeds by researchstudio-sat.
the class TestSigningUtils method generateTestKeystore.
/**
* Not a test - but sometimes can be useful for generating test keys.
*
* @throws Exception
*/
// @Test
public void generateTestKeystore() throws Exception {
Security.addProvider(new BouncyCastleProvider());
File keysFile = new File("test-keys2.jks");
FileBasedKeyStoreService storeService = new FileBasedKeyStoreService(keysFile, "temp");
storeService.init();
KeyPairService keyPairService = new KeyPairService();
CertificateService certificateService = new CertificateService();
addKeyByUri(atomCertUri, keyPairService, certificateService, storeService);
addKeyByUri(ownerCertUri, keyPairService, certificateService, storeService);
addKeyByUri(nodeCertUri, keyPairService, certificateService, storeService);
}
Aggregations