X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Forg%2Fcacert%2Fgigi%2FTestCertificate.java;h=9a8955e03439b89b1dd9f9d46ce8b329717020d3;hp=d8553e1f6c17340da38c2bbbe35602615ec1bad8;hb=dc10b875c132eb7840a6b9827ec93916076d34f7;hpb=b47144d6f3bf6b6eb1ec477de9d2af38256f074f diff --git a/tests/org/cacert/gigi/TestCertificate.java b/tests/org/cacert/gigi/TestCertificate.java index d8553e1f..9a8955e0 100644 --- a/tests/org/cacert/gigi/TestCertificate.java +++ b/tests/org/cacert/gigi/TestCertificate.java @@ -31,9 +31,9 @@ public class TestCertificate extends ManagedTest { public void testClientCertLoginStates() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException { KeyPair kp = generateKeypair(); String key1 = generatePEMCSR(kp, "CN=testmail@example.com"); - Certificate c = new Certificate(u, Certificate.buildDN("CN", "testmail@example.com"), "sha256", key1, CSRType.CSR, CertificateProfile.getById(1)); + Certificate c = new Certificate(u, u, Certificate.buildDN("CN", "testmail@example.com"), "sha256", key1, CSRType.CSR, CertificateProfile.getById(1)); final PrivateKey pk = kp.getPrivate(); - c.issue(null, "2y").waitFor(60000); + c.issue(null, "2y", u).waitFor(60000); final X509Certificate ce = c.cert(); assertNotNull(login(pk, ce)); } @@ -42,11 +42,11 @@ public class TestCertificate extends ManagedTest { public void testSANs() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException { KeyPair kp = generateKeypair(); String key = generatePEMCSR(kp, "CN=testmail@example.com"); - Certificate c = new Certificate(u, Certificate.buildDN("CN", "testmail@example.com"), "sha256", key, CSRType.CSR, CertificateProfile.getById(1),// + Certificate c = new Certificate(u, u, Certificate.buildDN("CN", "testmail@example.com"), "sha256", key, CSRType.CSR, CertificateProfile.getById(1),// new SubjectAlternateName(SANType.EMAIL, "testmail@example.com"), new SubjectAlternateName(SANType.DNS, "testmail.example.com")); testFails(CertificateStatus.DRAFT, c); - c.issue(null, "2y").waitFor(60000); + c.issue(null, "2y", u).waitFor(60000); X509Certificate cert = c.cert(); Collection> sans = cert.getSubjectAlternativeNames(); assertEquals(2, sans.size()); @@ -93,11 +93,11 @@ public class TestCertificate extends ManagedTest { public void testCertLifeCycle() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException { KeyPair kp = generateKeypair(); String key = generatePEMCSR(kp, "CN=testmail@example.com"); - Certificate c = new Certificate(u, Certificate.buildDN("CN", "testmail@example.com"), "sha256", key, CSRType.CSR, CertificateProfile.getById(1)); + Certificate c = new Certificate(u, u, Certificate.buildDN("CN", "testmail@example.com"), "sha256", key, CSRType.CSR, CertificateProfile.getById(1)); final PrivateKey pk = kp.getPrivate(); testFails(CertificateStatus.DRAFT, c); - c.issue(null, "2y").waitFor(60000); + c.issue(null, "2y", u).waitFor(60000); testFails(CertificateStatus.ISSUED, c); X509Certificate cert = c.cert(); @@ -121,7 +121,7 @@ public class TestCertificate extends ManagedTest { } if (status != CertificateStatus.DRAFT) { try { - c.issue(null, "2y"); + c.issue(null, "2y", u); fail(status + " is in invalid state"); } catch (IllegalStateException ise) {