@@ -36,36 +36,36 @@ public static void main(String[] args)
36
36
37
37
// location: For a list of locations, see:
38
38
// https://cloud.google.com/certificate-authority-service/docs/locations
39
- // pool_Id : Set a unique id for the CA pool.
39
+ // poolId : Set a unique id for the CA pool.
40
40
// subordinateCaName: The CA to be activated.
41
- // pemCACertificate : The signed certificate, obtained by signing the CSR.
41
+ // pemCaCertificate : The signed certificate, obtained by signing the CSR.
42
42
String project = "your-project-id" ;
43
43
String location = "ca-location" ;
44
- String pool_Id = "ca-pool-id" ;
44
+ String poolId = "ca-pool-id" ;
45
45
String subordinateCaName = "subordinate-certificate-authority-name" ;
46
- String pemCACertificate =
46
+ String pemCaCertificate =
47
47
"-----BEGIN CERTIFICATE-----\n " + "sample-pem-certificate\n " + "-----END CERTIFICATE-----" ;
48
48
49
49
// certificateAuthorityName: The name of the certificate authority which signed the CSR.
50
50
// If an external CA (CA not present in Google Cloud) was used for signing,
51
51
// then use the CA's issuerCertificateChain.
52
52
String certificateAuthorityName = "certificate-authority-name" ;
53
53
54
- activateSubordinateCA (
55
- project , location , pool_Id , certificateAuthorityName , subordinateCaName , pemCACertificate );
54
+ activateSubordinateCa (
55
+ project , location , poolId , certificateAuthorityName , subordinateCaName , pemCaCertificate );
56
56
}
57
57
58
58
// Activate a subordinate CA.
59
59
// *Prerequisite*: Get the CSR of the subordinate CA signed by another CA. Pass in the signed
60
60
// certificate and (issuer CA's name or the issuer CA's Certificate chain).
61
61
// *Post*: After activating the subordinate CA, it should be enabled before issuing certificates.
62
- public static void activateSubordinateCA (
62
+ public static void activateSubordinateCa (
63
63
String project ,
64
64
String location ,
65
- String pool_Id ,
65
+ String poolId ,
66
66
String certificateAuthorityName ,
67
67
String subordinateCaName ,
68
- String pemCACertificate )
68
+ String pemCaCertificate )
69
69
throws ExecutionException , InterruptedException , IOException {
70
70
// Initialize client that will be used to send requests. This client only needs to be created
71
71
// once, and can be reused for multiple requests. After completing all of your requests, call
@@ -75,14 +75,14 @@ public static void activateSubordinateCA(
75
75
CertificateAuthorityServiceClient .create ()) {
76
76
// Subordinate CA parent.
77
77
String subordinateCaParent =
78
- CertificateAuthorityName .of (project , location , pool_Id , subordinateCaName ).toString ();
78
+ CertificateAuthorityName .of (project , location , poolId , subordinateCaName ).toString ();
79
79
80
80
// Construct the "Activate CA Request".
81
81
ActivateCertificateAuthorityRequest activateCertificateAuthorityRequest =
82
82
ActivateCertificateAuthorityRequest .newBuilder ()
83
83
.setName (subordinateCaParent )
84
84
// The signed certificate.
85
- .setPemCaCertificate (pemCACertificate )
85
+ .setPemCaCertificate (pemCaCertificate )
86
86
.setSubordinateConfig (
87
87
SubordinateConfig .newBuilder ()
88
88
// Follow one of the below methods:
@@ -91,7 +91,7 @@ public static void activateSubordinateCA(
91
91
// Name.
92
92
.setCertificateAuthority (
93
93
CertificateAuthorityName .of (
94
- project , location , pool_Id , certificateAuthorityName )
94
+ project , location , poolId , certificateAuthorityName )
95
95
.toString ())
96
96
97
97
// Method 2: If issuer CA is external to Google Cloud, set the issuer's
0 commit comments