Search in sources :

Example 1 with PlatformKeyStore

use of de.carne.certmgr.certs.security.PlatformKeyStore 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());
    }
}
Also used : PlatformKeyStore(de.carne.certmgr.certs.security.PlatformKeyStore) IOException(java.io.IOException) UserCertStore(de.carne.certmgr.certs.UserCertStore) Test(org.junit.Test)

Example 2 with PlatformKeyStore

use of de.carne.certmgr.certs.security.PlatformKeyStore in project certmgr by hdecarne.

the class PlatformKeyStoreTest method testGetDefaultSet.

/**
 * Test the key store provisioning.
 */
@Test
public void testGetDefaultSet() {
    Set<PlatformKeyStore> platformKeyStores = PlatformKeyStore.getDefaultSet();
    System.out.println("Platform key stores:");
    for (PlatformKeyStore platformKeyStore : platformKeyStores) {
        System.out.println(platformKeyStore);
    }
}
Also used : PlatformKeyStore(de.carne.certmgr.certs.security.PlatformKeyStore) Test(org.junit.Test)

Example 3 with PlatformKeyStore

use of de.carne.certmgr.certs.security.PlatformKeyStore in project certmgr by hdecarne.

the class CertImportController method validateAndReloadPlatformSource.

private void validateAndReloadPlatformSource() {
    try {
        PlatformKeyStore platformSource = validatePlatformSourceInput();
        getExecutorService().submit(new ReloadTask<PlatformKeyStore>(platformSource) {

            @Override
            protected UserCertStore createStore(PlatformKeyStore params) throws IOException {
                return UserCertStore.createFromPlatformKeyStore(params, PasswordDialog.enterPassword(CertImportController.this));
            }
        });
    } catch (ValidationException e) {
        ValidationAlerts.error(e).showAndWait();
    }
}
Also used : PlatformKeyStore(de.carne.certmgr.certs.security.PlatformKeyStore) ValidationException(de.carne.jfx.util.validation.ValidationException) IOException(java.io.IOException) UserCertStore(de.carne.certmgr.certs.UserCertStore)

Aggregations

PlatformKeyStore (de.carne.certmgr.certs.security.PlatformKeyStore)3 UserCertStore (de.carne.certmgr.certs.UserCertStore)2 IOException (java.io.IOException)2 Test (org.junit.Test)2 ValidationException (de.carne.jfx.util.validation.ValidationException)1