@@ -74,8 +74,7 @@ def encrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id,
74
74
client = kms_v1 .KeyManagementServiceClient ()
75
75
76
76
# The resource name of the CryptoKey.
77
- name = client .crypto_key_path_path (project_id , location_id , key_ring_id ,
78
- crypto_key_id )
77
+ name = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
79
78
80
79
# Use the KMS API to encrypt the data.
81
80
response = client .encrypt (name , plaintext )
@@ -94,8 +93,7 @@ def decrypt_symmetric(project_id, location_id, key_ring_id, crypto_key_id,
94
93
client = kms_v1 .KeyManagementServiceClient ()
95
94
96
95
# The resource name of the CryptoKey.
97
- name = client .crypto_key_path_path (project_id , location_id , key_ring_id ,
98
- crypto_key_id )
96
+ name = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
99
97
# Use the KMS API to decrypt the data.
100
98
response = client .decrypt (name , ciphertext )
101
99
return response .plaintext
@@ -219,8 +217,7 @@ def add_member_to_crypto_key_policy(
219
217
client = kms_v1 .KeyManagementServiceClient ()
220
218
221
219
# The resource name of the CryptoKey.
222
- resource = client .crypto_key_path_path (project_id , location_id ,
223
- key_ring_id , crypto_key_id )
220
+ resource = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
224
221
# Get the current IAM policy.
225
222
policy = client .get_iam_policy (resource )
226
223
@@ -282,8 +279,8 @@ def remove_member_from_crypto_key_policy(
282
279
client = kms_v1 .KeyManagementServiceClient ()
283
280
284
281
# The resource name of the CryptoKey.
285
- resource = client .crypto_key_path_path (project_id , location_id ,
286
- key_ring_id , crypto_key_id )
282
+ resource = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
283
+
287
284
# Get the current IAM policy.
288
285
policy = client .get_iam_policy (resource )
289
286
@@ -365,8 +362,7 @@ def get_crypto_key_policy(project_id, location_id, key_ring_id, crypto_key_id):
365
362
client = kms_v1 .KeyManagementServiceClient ()
366
363
367
364
# The resource name of the CryptoKey.
368
- resource = client .crypto_key_path_path (project_id , location_id ,
369
- key_ring_id , crypto_key_id )
365
+ resource = client .crypto_key_path (project_id , location_id , key_ring_id , crypto_key_id )
370
366
371
367
# Get the current IAM policy.
372
368
policy = client .get_iam_policy (resource )
0 commit comments