X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fclub%2Fwpia%2Fgigi%2FTestCertificate.java;h=53b6509d38e0cecbe66524f5410c0f451d198e43;hb=19dfeb8cc6ffa3f469e2b27fcedccc56b776c693;hp=d791bfd0ee84654ac3a88769530b7befd203ba29;hpb=10e752c710c50035de036a79bc26fbedc7c8a460;p=gigi.git diff --git a/tests/club/wpia/gigi/TestCertificate.java b/tests/club/wpia/gigi/TestCertificate.java index d791bfd0..53b6509d 100644 --- a/tests/club/wpia/gigi/TestCertificate.java +++ b/tests/club/wpia/gigi/TestCertificate.java @@ -11,6 +11,7 @@ import java.sql.SQLException; import java.util.Collection; import java.util.List; +import org.hamcrest.CoreMatchers; import org.junit.Test; import club.wpia.gigi.dbObjects.Certificate; @@ -93,6 +94,15 @@ public class TestCertificate extends ManagedTest { } } + @Test + public void testCertCreateSHA384() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException { + KeyPair kp = generateKeypair(); + String key = generatePEMCSR(kp, "CN=testmail@example.com"); + Certificate c = new Certificate(u, u, Certificate.buildDN("CN", "testmail@example.com"), Digest.SHA384, key, CSRType.CSR, getClientProfile()); + await(c.issue(null, "2y", u)); + assertThat(c.cert().getSigAlgName().toLowerCase(), CoreMatchers.containsString("sha384")); + } + @Test public void testCertLifeCycle() throws IOException, GeneralSecurityException, SQLException, InterruptedException, GigiApiException { KeyPair kp = generateKeypair();