use of de.carne.certmgr.certs.x509.generator.Issuer in project certmgr by hdecarne.
the class UserCertStoreTest method testCreateAndOpenStore.
/**
* Test create/open store operations.
*/
@Test
public void testCreateAndOpenStore() {
Path storeHome = tempPath.get().resolve(NAME_STORE1);
try {
UserCertStore createdStore = UserCertStore.createStore(storeHome);
GenerateCertRequest request1 = generateRequest(createdStore, CertGenerators.DEFAULT, true);
UserCertStoreEntry generated1 = createdStore.generateEntry(CertGenerators.DEFAULT, request1, TestCerts.password(), TestCerts.password(), "TestCert");
DefaultSet<Issuer> issuers1 = CertGenerators.DEFAULT.getIssuers(createdStore, generated1);
GenerateCertRequest request2 = generateRequest(createdStore, CertGenerators.DEFAULT, false);
request2.setIssuer(issuers1.getDefault());
createdStore.generateEntry(CertGenerators.DEFAULT, request1, TestCerts.password(), TestCerts.password(), "TestCert");
Assert.assertEquals(2, createdStore.size());
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
try {
UserCertStore.createStore(storeHome);
Assert.fail("Re-creating store succeeded, but should not");
} catch (FileAlreadyExistsException e) {
Exceptions.ignore(e);
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
try {
UserCertStore openendStore = UserCertStore.openStore(storeHome);
Assert.assertEquals(2, openendStore.size());
} catch (IOException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
use of de.carne.certmgr.certs.x509.generator.Issuer in project certmgr by hdecarne.
the class CertOptionsController method resetSigAlgOptions.
private void resetSigAlgOptions(@Nullable CertGenerator generator) {
KeyPairAlgorithm keyPairAlgorithm = this.ctlKeyAlgOption.getValue();
Issuer issuer = this.ctlIssuerInput.getValue();
resetSigAlgOptions(generator, keyPairAlgorithm, issuer);
}
use of de.carne.certmgr.certs.x509.generator.Issuer in project certmgr by hdecarne.
the class CertOptionsController method resetSigAlgOptions.
private void resetSigAlgOptions(@Nullable KeyPairAlgorithm keyPairAlgorithm) {
CertGenerator generator = this.ctlGeneratorOption.getValue();
Issuer issuer = this.ctlIssuerInput.getValue();
resetSigAlgOptions(generator, keyPairAlgorithm, issuer);
}
Aggregations