Search in sources :

Example 6 with CertificateTemplate

use of com.google.cloud.security.privateca.v1.CertificateTemplate in project java-security-private-ca by googleapis.

the class SnippetsIT method testCreateCertificateTemplate.

@Test
public void testCreateCertificateTemplate() throws IOException {
    // Check that the Certificate template has been created as part of the setup.
    try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) {
        String certificateTemplate = certificateAuthorityServiceClient.getCertificateTemplate(CertificateTemplateName.of(PROJECT_ID, LOCATION, CERTIFICATE_TEMPLATE_NAME).toString()).getName();
        assertThat(certificateTemplate).contains(String.format("projects/%s/locations/%s/", PROJECT_ID, LOCATION));
    }
}
Also used : CertificateAuthorityServiceClient(com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient) ByteString(com.google.protobuf.ByteString) Test(org.junit.Test)

Aggregations

CertificateAuthorityServiceClient (com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient)4 CertificateTemplate (com.google.cloud.security.privateca.v1.CertificateTemplate)3 Test (org.junit.Test)3 ListCertificateTemplatesPagedResponse (com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient.ListCertificateTemplatesPagedResponse)2 Operation (com.google.longrunning.Operation)2 AbstractMessage (com.google.protobuf.AbstractMessage)2 ByteString (com.google.protobuf.ByteString)2 CertificateIdentityConstraints (com.google.cloud.security.privateca.v1.CertificateIdentityConstraints)1 CreateCertificateTemplateRequest (com.google.cloud.security.privateca.v1.CreateCertificateTemplateRequest)1 KeyUsage (com.google.cloud.security.privateca.v1.KeyUsage)1 ListCertificateTemplatesRequest (com.google.cloud.security.privateca.v1.ListCertificateTemplatesRequest)1 ListCertificateTemplatesResponse (com.google.cloud.security.privateca.v1.ListCertificateTemplatesResponse)1 UpdateCertificateTemplateRequest (com.google.cloud.security.privateca.v1.UpdateCertificateTemplateRequest)1 CaOptions (com.google.cloud.security.privateca.v1.X509Parameters.CaOptions)1 FieldMask (com.google.protobuf.FieldMask)1 Expr (com.google.type.Expr)1