Search in sources :

Example 1 with FetchCertificateAuthorityCsrResponse

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

the class SnippetsIT method fetchPemCSR.

// Fetch CSR of the given CA.
public static String fetchPemCSR(String pool_Id, String caName) throws IOException {
    try (CertificateAuthorityServiceClient certificateAuthorityServiceClient = CertificateAuthorityServiceClient.create()) {
        String caParent = CertificateAuthorityName.of(PROJECT_ID, LOCATION, pool_Id, caName).toString();
        FetchCertificateAuthorityCsrResponse response = certificateAuthorityServiceClient.fetchCertificateAuthorityCsr(caParent);
        return response.getPemCsr();
    }
}
Also used : CertificateAuthorityServiceClient(com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient) ByteString(com.google.protobuf.ByteString) FetchCertificateAuthorityCsrResponse(com.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse)

Aggregations

CertificateAuthorityServiceClient (com.google.cloud.security.privateca.v1.CertificateAuthorityServiceClient)1 FetchCertificateAuthorityCsrResponse (com.google.cloud.security.privateca.v1.FetchCertificateAuthorityCsrResponse)1 ByteString (com.google.protobuf.ByteString)1