use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class UserCertStoreTest method testPlatformKeyStoreSourceStore.
/**
* Test store creation from platform key stores.
*/
@Test
public void testPlatformKeyStoreSourceStore() {
try {
DefaultSet<PlatformKeyStore> platformKeyStores = PlatformKeyStore.getDefaultSet();
for (PlatformKeyStore platformKeyStore : platformKeyStores) {
UserCertStore importStore = UserCertStore.createFromPlatformKeyStore(platformKeyStore, NoPassword.getInstance());
traverseStore(importStore.getEntries());
}
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertOptionsController method generateEntry.
void generateEntry(CertGenerator generator, GenerateCertRequest generateRequest, String alias) throws IOException {
UserCertStore store = this.storeParam.get();
store.generateEntry(generator, generateRequest, PasswordDialog.enterPassword(this), PasswordDialog.enterNewPassword(this), alias);
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertOptionsController method initCertificateNames.
private void initCertificateNames() {
UserCertStore store = this.storeParam.get();
UserCertStoreEntryId entryId = store.generateEntryId(CertOptionsI18N.formatSTR_TEXT_ALIASHINT());
this.ctlAliasInput.setText(entryId.getAlias());
String serial = CertOptionsTemplates.defaultSerial();
this.ctlDNInput.setText(CertOptionsTemplates.defaultDNInput(entryId.getAlias(), Check.notNull(store.storeName()), serial));
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertImportController method validateAndReloadDirectorySource.
private void validateAndReloadDirectorySource() {
try {
Path directorySource = validateDirectorySourceInput();
getExecutorService().submit(new ReloadTask<Path>(directorySource) {
@Override
protected UserCertStore createStore(Path params) throws IOException {
List<Path> files;
try (Stream<Path> filesStream = Files.walk(params)) {
files = filesStream.filter(Files::isRegularFile).collect(Collectors.toList());
}
return UserCertStore.createFromFiles(files, PasswordDialog.enterPassword(CertImportController.this));
}
});
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
}
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class CertImportController method validateAndReloadURLSource.
private void validateAndReloadURLSource() {
try {
URL urlSource = validateURLSourceInput();
getExecutorService().submit(new ReloadTask<URL>(urlSource) {
@Override
protected UserCertStore createStore(URL params) throws IOException {
return UserCertStore.createFromURL(params, PasswordDialog.enterPassword(CertImportController.this));
}
});
} catch (ValidationException e) {
ValidationAlerts.error(e).showAndWait();
}
}
Aggregations