- @Test
- public void testCertLifeCycle() throws IOException, GeneralSecurityException, SQLException, InterruptedException {
- String[] key1 = generateCSR("/CN=testmail@example.com");
- Certificate c = new Certificate(1, "/CN=testmail@example.com", "sha256", key1[1]);
- final PrivateKey pk = PemKey.parsePEMPrivateKey(key1[0]);
+ @Test
+ public void testClientCertLoginStates() throws IOException, GeneralSecurityException, SQLException, InterruptedException {
+ KeyPair kp = generateKeypair();
+ String key1 = generatePEMCSR(kp, "CN=testmail@example.com");
+ Certificate c = new Certificate(1, "/CN=testmail@example.com", "sha256", key1, CSRType.CSR);
+ final PrivateKey pk = kp.getPrivate();
+ c.issue().waitFor(60000);
+ final X509Certificate ce = c.cert();
+ assertNotNull(login(pk, ce));
+ }