use of org.apache.cloudstack.framework.ca.Certificate in project cloudstack by apache.
the class RootCAProviderTest method testIssueCertificateWithoutCsr.
@Test
public void testIssueCertificateWithoutCsr() throws NoSuchProviderException, CertificateException, NoSuchAlgorithmException, InvalidKeyException, SignatureException {
final Certificate certificate = provider.issueCertificate(Arrays.asList("domain1.com", "domain2.com"), null, 1);
Assert.assertTrue(certificate != null);
Assert.assertTrue(certificate.getPrivateKey() != null);
Assert.assertEquals(certificate.getCaCertificates().get(0), caCertificate);
Assert.assertEquals(certificate.getClientCertificate().getIssuerDN(), caCertificate.getIssuerDN());
Assert.assertTrue(certificate.getClientCertificate().getNotAfter().before(new DateTime().plusDays(1).toDate()));
certificate.getClientCertificate().verify(caCertificate.getPublicKey());
}
Aggregations