use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class UserCertStoreTest method testFilesSourceStore.
/**
* Test store creation from file list source.
*/
@Test
public void testFilesSourceStore() {
try {
List<Path> files = collectDirectoryFiles(testStorePath.get());
UserCertStore importStore = UserCertStore.createFromFiles(files, TestCerts.password());
Assert.assertNotNull(importStore);
Assert.assertTrue(importStore.size() > 0);
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
use of de.carne.certmgr.certs.UserCertStore in project certmgr by hdecarne.
the class UserCertStoreTest method testServerSourceStore.
/**
* Test store creation from server source.
*/
@Test
public void testServerSourceStore() {
try {
UserCertStore importStore = UserCertStore.createFromServer(Protocol.SSL, TEST_SSL_HOST, TEST_SSL_PORT);
Assert.assertNotNull(importStore);
Assert.assertTrue(importStore.size() > 0);
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
try {
UserCertStore importStore = UserCertStore.createFromServer(Protocol.STARTTLS_SMTP, TEST_SMTP_HOST, TEST_SMTP_PORT);
Assert.assertNotNull(importStore);
Assert.assertTrue(importStore.size() > 0);
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
try {
UserCertStore importStore = UserCertStore.createFromServer(Protocol.STARTTLS_IMAP, TEST_IMAP_HOST, TEST_IMAP_PORT);
Assert.assertNotNull(importStore);
Assert.assertTrue(importStore.size() > 0);
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
try {
UserCertStore importStore = UserCertStore.createFromServer(Protocol.STARTTLS_SMTP, TEST_SSL_HOST, TEST_SSL_PORT);
Assert.assertEquals(0, importStore.size());
} catch (IOException e) {
Assert.fail(e.getMessage());
}
}
Aggregations