File: cloudkms_v1.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.html

package info (click to toggle)
python-googleapi 2.182.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 533,852 kB
  • sloc: python: 11,076; javascript: 249; sh: 114; makefile: 59
file content (897 lines) | stat: -rw-r--r-- 100,089 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="cloudkms_v1.html">Cloud Key Management Service (KMS) API</a> . <a href="cloudkms_v1.projects.html">projects</a> . <a href="cloudkms_v1.projects.locations.html">locations</a> . <a href="cloudkms_v1.projects.locations.keyRings.html">keyRings</a> . <a href="cloudkms_v1.projects.locations.keyRings.cryptoKeys.html">cryptoKeys</a> . <a href="cloudkms_v1.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.html">cryptoKeyVersions</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#asymmetricDecrypt">asymmetricDecrypt(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.</p>
<p class="toc_element">
  <code><a href="#asymmetricSign">asymmetricSign(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey.</p>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED.</p>
<p class="toc_element">
  <code><a href="#decapsulate">decapsulate(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Decapsulates data that was encapsulated with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose KEY_ENCAPSULATION.</p>
<p class="toc_element">
  <code><a href="#destroy">destroy(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED, and destroy_time will be set to the time destroy_scheduled_duration in the future. At that time, the state will automatically change to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.</p>
<p class="toc_element">
  <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
<p class="firstline">Returns metadata for a given CryptoKeyVersion.</p>
<p class="toc_element">
  <code><a href="#getPublicKey">getPublicKey(name, publicKeyFormat=None, x__xgafv=None)</a></code></p>
<p class="firstline">Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.</p>
<p class="toc_element">
  <code><a href="#import_">import_(parent, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Import wrapped key material into a CryptoKeyVersion. All requests must specify a CryptoKey. If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey.</p>
<p class="toc_element">
  <code><a href="#list">list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, view=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists CryptoKeyVersions.</p>
<p class="toc_element">
  <code><a href="#list_next">list_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#macSign">macSign(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.</p>
<p class="toc_element">
  <code><a href="#macVerify">macVerify(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.</p>
<p class="toc_element">
  <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
<p class="firstline">Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.</p>
<p class="toc_element">
  <code><a href="#rawDecrypt">rawDecrypt(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.</p>
<p class="toc_element">
  <code><a href="#rawEncrypt">rawEncrypt(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Encrypts data using portable cryptographic primitives. Most users should choose Encrypt and Decrypt rather than their raw counterparts. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.</p>
<p class="toc_element">
  <code><a href="#restore">restore(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state. Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be cleared.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="asymmetricDecrypt">asymmetricDecrypt(name, body=None, x__xgafv=None)</code>
  <pre>Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for decryption. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.AsymmetricDecrypt.
  &quot;ciphertext&quot;: &quot;A String&quot;, # Required. The data encrypted with the named CryptoKeyVersion&#x27;s public key using OAEP.
  &quot;ciphertextCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the AsymmetricDecryptRequest.ciphertext. If specified, KeyManagementService will verify the integrity of the received AsymmetricDecryptRequest.ciphertext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(AsymmetricDecryptRequest.ciphertext) is equal to AsymmetricDecryptRequest.ciphertext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.AsymmetricDecrypt.
  &quot;plaintext&quot;: &quot;A String&quot;, # The decrypted data originally encrypted with the matching public key.
  &quot;plaintextCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned AsymmetricDecryptResponse.plaintext. An integrity check of AsymmetricDecryptResponse.plaintext can be performed by computing the CRC32C checksum of AsymmetricDecryptResponse.plaintext and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used in decryption.
  &quot;verifiedCiphertextCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether AsymmetricDecryptRequest.ciphertext_crc32c was received by KeyManagementService and used for the integrity verification of the ciphertext. A false value of this field indicates either that AsymmetricDecryptRequest.ciphertext_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set AsymmetricDecryptRequest.ciphertext_crc32c but this field is still false, discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="asymmetricSign">asymmetricSign(name, body=None, x__xgafv=None)</code>
  <pre>Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for signing. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.AsymmetricSign.
  &quot;data&quot;: &quot;A String&quot;, # Optional. The data to sign. It can&#x27;t be supplied if AsymmetricSignRequest.digest is supplied.
  &quot;dataCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the AsymmetricSignRequest.data. If specified, KeyManagementService will verify the integrity of the received AsymmetricSignRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(AsymmetricSignRequest.data) is equal to AsymmetricSignRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;digest&quot;: { # A Digest holds a cryptographic message digest. # Optional. The digest of the data to sign. The digest must be produced with the same digest algorithm as specified by the key version&#x27;s algorithm. This field may not be supplied if AsymmetricSignRequest.data is supplied.
    &quot;sha256&quot;: &quot;A String&quot;, # A message digest produced with the SHA-256 algorithm.
    &quot;sha384&quot;: &quot;A String&quot;, # A message digest produced with the SHA-384 algorithm.
    &quot;sha512&quot;: &quot;A String&quot;, # A message digest produced with the SHA-512 algorithm.
  },
  &quot;digestCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the AsymmetricSignRequest.digest. If specified, KeyManagementService will verify the integrity of the received AsymmetricSignRequest.digest using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(AsymmetricSignRequest.digest) is equal to AsymmetricSignRequest.digest_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.AsymmetricSign.
  &quot;name&quot;: &quot;A String&quot;, # The resource name of the CryptoKeyVersion used for signing. Check this field to verify that the intended resource was used for signing.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used for signing.
  &quot;signature&quot;: &quot;A String&quot;, # The created signature.
  &quot;signatureCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned AsymmetricSignResponse.signature. An integrity check of AsymmetricSignResponse.signature can be performed by computing the CRC32C checksum of AsymmetricSignResponse.signature and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;verifiedDataCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether AsymmetricSignRequest.data_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that AsymmetricSignRequest.data_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set AsymmetricSignRequest.data_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedDigestCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether AsymmetricSignRequest.digest_crc32c was received by KeyManagementService and used for the integrity verification of the digest. A false value of this field indicates either that AsymmetricSignRequest.digest_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set AsymmetricSignRequest.digest_crc32c but this field is still false, discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
  <pre>Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED.

Args:
  parent: string, Required. The name of the CryptoKey associated with the CryptoKeyVersions. (required)
  body: object, The request body.
    The object takes the form of:

{ # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}</pre>
</div>

<div class="method">
    <code class="details" id="decapsulate">decapsulate(name, body=None, x__xgafv=None)</code>
  <pre>Decapsulates data that was encapsulated with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose KEY_ENCAPSULATION.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for decapsulation. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.Decapsulate.
  &quot;ciphertext&quot;: &quot;A String&quot;, # Required. The ciphertext produced from encapsulation with the named CryptoKeyVersion public key(s).
  &quot;ciphertextCrc32c&quot;: &quot;A String&quot;, # Optional. A CRC32C checksum of the DecapsulateRequest.ciphertext. If specified, KeyManagementService will verify the integrity of the received DecapsulateRequest.ciphertext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(DecapsulateRequest.ciphertext) is equal to DecapsulateRequest.ciphertext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.Decapsulate.
  &quot;name&quot;: &quot;A String&quot;, # The resource name of the CryptoKeyVersion used for decapsulation. Check this field to verify that the intended resource was used for decapsulation.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used in decapsulation.
  &quot;sharedSecret&quot;: &quot;A String&quot;, # The decapsulated shared_secret originally encapsulated with the matching public key.
  &quot;sharedSecretCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned DecapsulateResponse.shared_secret. An integrity check of DecapsulateResponse.shared_secret can be performed by computing the CRC32C checksum of DecapsulateResponse.shared_secret and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: receiving this response message indicates that KeyManagementService is able to successfully decrypt the ciphertext. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;verifiedCiphertextCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether DecapsulateRequest.ciphertext_crc32c was received by KeyManagementService and used for the integrity verification of the ciphertext. A false value of this field indicates either that DecapsulateRequest.ciphertext_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set DecapsulateRequest.ciphertext_crc32c but this field is still false, discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="destroy">destroy(name, body=None, x__xgafv=None)</code>
  <pre>Schedule a CryptoKeyVersion for destruction. Upon calling this method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED, and destroy_time will be set to the time destroy_scheduled_duration in the future. At that time, the state will automatically change to DESTROYED, and the key material will be irrevocably destroyed. Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to reverse the process.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to destroy. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.DestroyCryptoKeyVersion.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}</pre>
</div>

<div class="method">
    <code class="details" id="get">get(name, x__xgafv=None)</code>
  <pre>Returns metadata for a given CryptoKeyVersion.

Args:
  name: string, Required. The name of the CryptoKeyVersion to get. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}</pre>
</div>

<div class="method">
    <code class="details" id="getPublicKey">getPublicKey(name, publicKeyFormat=None, x__xgafv=None)</code>
  <pre>Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.

Args:
  name: string, Required. The name of the CryptoKeyVersion public key to get. (required)
  publicKeyFormat: string, Optional. The PublicKey format specified by the user. This field is required for PQC algorithms. If specified, the public key will be exported through the public_key field in the requested format. Otherwise, the pem field will be populated for non-PQC algorithms, and an error will be returned for PQC algorithms.
    Allowed values
      PUBLIC_KEY_FORMAT_UNSPECIFIED - If the public_key_format field is not specified: - For PQC algorithms, an error will be returned. - For non-PQC algorithms, the default format is PEM, and the field pem will be populated. Otherwise, the public key will be exported through the public_key field in the requested format.
      PEM - The returned public key will be encoded in PEM format. See the [RFC7468](https://tools.ietf.org/html/rfc7468) sections for [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual Encoding of Subject Public Key Info] (https://tools.ietf.org/html/rfc7468#section-13) for more information.
      DER - The returned public key will be encoded in DER format (the PrivateKeyInfo structure from RFC 5208).
      NIST_PQC - This is supported only for PQC algorithms. The key material is returned in the format defined by NIST PQC standards (FIPS 203, FIPS 204, and FIPS 205).
      XWING_RAW_BYTES - The returned public key is in raw bytes format defined in its standard https://datatracker.ietf.org/doc/draft-connolly-cfrg-xwing-kem.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # The public keys for a given CryptoKeyVersion. Obtained via GetPublicKey.
  &quot;algorithm&quot;: &quot;A String&quot;, # The Algorithm associated with this key.
  &quot;name&quot;: &quot;A String&quot;, # The name of the CryptoKeyVersion public key. Provided here for verification. NOTE: This field is in Beta.
  &quot;pem&quot;: &quot;A String&quot;, # The public key, encoded in PEM format. For more information, see the [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and [Textual Encoding of Subject Public Key Info] (https://tools.ietf.org/html/rfc7468#section-13).
  &quot;pemCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned PublicKey.pem. An integrity check of PublicKey.pem can be performed by computing the CRC32C checksum of PublicKey.pem and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed `2^32-1`, and can be safely downconverted to uint32 in languages that support this type. NOTE: This field is in Beta.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion public key.
  &quot;publicKey&quot;: { # Data with integrity verification field. # This field contains the public key (with integrity verification), formatted according to the public_key_format field.
    &quot;crc32cChecksum&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned ChecksummedData.data. An integrity check of ChecksummedData.data can be performed by computing the CRC32C checksum of ChecksummedData.data and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed `2^32-1`, and can be safely downconverted to uint32 in languages that support this type.
    &quot;data&quot;: &quot;A String&quot;, # Raw Data.
  },
  &quot;publicKeyFormat&quot;: &quot;A String&quot;, # The PublicKey format specified by the customer through the public_key_format field.
}</pre>
</div>

<div class="method">
    <code class="details" id="import_">import_(parent, body=None, x__xgafv=None)</code>
  <pre>Import wrapped key material into a CryptoKeyVersion. All requests must specify a CryptoKey. If a CryptoKeyVersion is additionally specified in the request, key material will be reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey.

Args:
  parent: string, Required. The name of the CryptoKey to be imported into. The create permission is only required on this key when creating a new CryptoKeyVersion. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.ImportCryptoKeyVersion.
  &quot;algorithm&quot;: &quot;A String&quot;, # Required. The algorithm of the key being imported. This does not need to match the version_template of the CryptoKey this version imports into.
  &quot;cryptoKeyVersion&quot;: &quot;A String&quot;, # Optional. The optional name of an existing CryptoKeyVersion to target for an import operation. If this field is not present, a new CryptoKeyVersion containing the supplied key material is created. If this field is present, the supplied key material is imported into the existing CryptoKeyVersion. To import into an existing CryptoKeyVersion, the CryptoKeyVersion must be a child of ImportCryptoKeyVersionRequest.parent, have been previously created via ImportCryptoKeyVersion, and be in DESTROYED or IMPORT_FAILED state. The key material and algorithm must match the previous CryptoKeyVersion exactly if the CryptoKeyVersion has ever contained key material.
  &quot;importJob&quot;: &quot;A String&quot;, # Required. The name of the ImportJob that was used to wrap this key material.
  &quot;rsaAesWrappedKey&quot;: &quot;A String&quot;, # Optional. This field has the same meaning as wrapped_key. Prefer to use that field in new work. Either that field or this field (but not both) must be specified.
  &quot;wrappedKey&quot;: &quot;A String&quot;, # Optional. The wrapped key material to import. Before wrapping, key material must be formatted. If importing symmetric key material, the expected key material format is plain bytes. If importing asymmetric key material, the expected key material format is PKCS#8-encoded DER (the PrivateKeyInfo structure from RFC 5208). When wrapping with import methods (RSA_OAEP_3072_SHA1_AES_256 or RSA_OAEP_4096_SHA1_AES_256 or RSA_OAEP_3072_SHA256_AES_256 or RSA_OAEP_4096_SHA256_AES_256), this field must contain the concatenation of: 1. An ephemeral AES-256 wrapping key wrapped with the public_key using RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty label. 2. The formatted key to be imported, wrapped with the ephemeral AES-256 key using AES-KWP (RFC 5649). This format is the same as the format produced by PKCS#11 mechanism CKM_RSA_AES_KEY_WRAP. When wrapping with import methods (RSA_OAEP_3072_SHA256 or RSA_OAEP_4096_SHA256), this field must contain the formatted key to be imported, wrapped with the public_key using RSAES-OAEP with SHA-256, MGF1 with SHA-256, and an empty label.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}</pre>
</div>

<div class="method">
    <code class="details" id="list">list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, view=None, x__xgafv=None)</code>
  <pre>Lists CryptoKeyVersions.

Args:
  parent: string, Required. The resource name of the CryptoKey to list, in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*`. (required)
  filter: string, Optional. Only include resources that match the filter in the response. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  orderBy: string, Optional. Specify how the results should be sorted. If not specified, the results will be sorted in the default order. For more information, see [Sorting and filtering list results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  pageSize: integer, Optional. Optional limit on the number of CryptoKeyVersions to include in the response. Further CryptoKeyVersions can subsequently be obtained by including the ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default.
  pageToken: string, Optional. Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token.
  view: string, The fields to include in the response.
    Allowed values
      CRYPTO_KEY_VERSION_VIEW_UNSPECIFIED - Default view for each CryptoKeyVersion. Does not include the attestation field.
      FULL - Provides all fields in each CryptoKeyVersion, including the attestation.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.ListCryptoKeyVersions.
  &quot;cryptoKeyVersions&quot;: [ # The list of CryptoKeyVersions.
    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
      &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
      &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
        &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
          &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
            &quot;A String&quot;,
          ],
          &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
            &quot;A String&quot;,
          ],
          &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
            &quot;A String&quot;,
          ],
        },
        &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
        &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
      },
      &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
      &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
      &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
      &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
      &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
        &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
        &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
      },
      &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
      &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
      &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
      &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
      &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
      &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
      &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
      &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
      &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
    },
  ],
  &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve next page of results. Pass this value in ListCryptoKeyVersionsRequest.page_token to retrieve the next page of results.
  &quot;totalSize&quot;: 42, # The total number of CryptoKeyVersions that matched the query. This field is not populated if ListCryptoKeyVersionsRequest.filter is applied.
}</pre>
</div>

<div class="method">
    <code class="details" id="list_next">list_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="macSign">macSign(name, body=None, x__xgafv=None)</code>
  <pre>Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for signing. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.MacSign.
  &quot;data&quot;: &quot;A String&quot;, # Required. The data to sign. The MAC tag is computed over this data field based on the specific algorithm.
  &quot;dataCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the MacSignRequest.data. If specified, KeyManagementService will verify the integrity of the received MacSignRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacSignRequest.data) is equal to MacSignRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.MacSign.
  &quot;mac&quot;: &quot;A String&quot;, # The created signature.
  &quot;macCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned MacSignResponse.mac. An integrity check of MacSignResponse.mac can be performed by computing the CRC32C checksum of MacSignResponse.mac and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;name&quot;: &quot;A String&quot;, # The resource name of the CryptoKeyVersion used for signing. Check this field to verify that the intended resource was used for signing.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used for signing.
  &quot;verifiedDataCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether MacSignRequest.data_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that MacSignRequest.data_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set MacSignRequest.data_crc32c but this field is still false, discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="macVerify">macVerify(name, body=None, x__xgafv=None)</code>
  <pre>Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for verification. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.MacVerify.
  &quot;data&quot;: &quot;A String&quot;, # Required. The data used previously as a MacSignRequest.data to generate the MAC tag.
  &quot;dataCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the MacVerifyRequest.data. If specified, KeyManagementService will verify the integrity of the received MacVerifyRequest.data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacVerifyRequest.data) is equal to MacVerifyRequest.data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;mac&quot;: &quot;A String&quot;, # Required. The signature to verify.
  &quot;macCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the MacVerifyRequest.mac. If specified, KeyManagementService will verify the integrity of the received MacVerifyRequest.mac using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(MacVerifyRequest.mac) is equal to MacVerifyRequest.mac_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.MacVerify.
  &quot;name&quot;: &quot;A String&quot;, # The resource name of the CryptoKeyVersion used for verification. Check this field to verify that the intended resource was used for verification.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used for verification.
  &quot;success&quot;: True or False, # This field indicates whether or not the verification operation for MacVerifyRequest.mac over MacVerifyRequest.data was successful.
  &quot;verifiedDataCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether MacVerifyRequest.data_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that MacVerifyRequest.data_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set MacVerifyRequest.data_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedMacCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether MacVerifyRequest.mac_crc32c was received by KeyManagementService and used for the integrity verification of the data. A false value of this field indicates either that MacVerifyRequest.mac_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set MacVerifyRequest.mac_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedSuccessIntegrity&quot;: True or False, # Integrity verification field. This value is used for the integrity verification of [MacVerifyResponse.success]. If the value of this field contradicts the value of [MacVerifyResponse.success], discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
  <pre>Update a CryptoKeyVersion&#x27;s metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other states.

Args:
  name: string, Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. (required)
  body: object, The request body.
    The object takes the form of:

{ # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}

  updateMask: string, Required. List of fields to be updated in this request.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}</pre>
</div>

<div class="method">
    <code class="details" id="rawDecrypt">rawDecrypt(name, body=None, x__xgafv=None)</code>
  <pre>Decrypts data that was originally encrypted using a raw cryptographic mechanism. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for decryption. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.RawDecrypt.
  &quot;additionalAuthenticatedData&quot;: &quot;A String&quot;, # Optional. Optional data that must match the data originally supplied in RawEncryptRequest.additional_authenticated_data.
  &quot;additionalAuthenticatedDataCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the RawDecryptRequest.additional_authenticated_data. If specified, KeyManagementService will verify the integrity of the received additional_authenticated_data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(additional_authenticated_data) is equal to additional_authenticated_data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;ciphertext&quot;: &quot;A String&quot;, # Required. The encrypted data originally returned in RawEncryptResponse.ciphertext.
  &quot;ciphertextCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the RawDecryptRequest.ciphertext. If specified, KeyManagementService will verify the integrity of the received ciphertext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(ciphertext) is equal to ciphertext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;initializationVector&quot;: &quot;A String&quot;, # Required. The initialization vector (IV) used during encryption, which must match the data originally provided in RawEncryptResponse.initialization_vector.
  &quot;initializationVectorCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the RawDecryptRequest.initialization_vector. If specified, KeyManagementService will verify the integrity of the received initialization_vector using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;tagLength&quot;: 42, # The length of the authentication tag that is appended to the end of the ciphertext. If unspecified (0), the default value for the key&#x27;s algorithm will be used (for AES-GCM, the default value is 16).
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.RawDecrypt.
  &quot;plaintext&quot;: &quot;A String&quot;, # The decrypted data.
  &quot;plaintextCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned RawDecryptResponse.plaintext. An integrity check of plaintext can be performed by computing the CRC32C checksum of plaintext and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: receiving this response message indicates that KeyManagementService is able to successfully decrypt the ciphertext. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used in decryption.
  &quot;verifiedAdditionalAuthenticatedDataCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether RawDecryptRequest.additional_authenticated_data_crc32c was received by KeyManagementService and used for the integrity verification of additional_authenticated_data. A false value of this field indicates either that // RawDecryptRequest.additional_authenticated_data_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set RawDecryptRequest.additional_authenticated_data_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedCiphertextCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether RawDecryptRequest.ciphertext_crc32c was received by KeyManagementService and used for the integrity verification of the ciphertext. A false value of this field indicates either that RawDecryptRequest.ciphertext_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set RawDecryptRequest.ciphertext_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedInitializationVectorCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether RawDecryptRequest.initialization_vector_crc32c was received by KeyManagementService and used for the integrity verification of initialization_vector. A false value of this field indicates either that RawDecryptRequest.initialization_vector_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set RawDecryptRequest.initialization_vector_crc32c but this field is still false, discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="rawEncrypt">rawEncrypt(name, body=None, x__xgafv=None)</code>
  <pre>Encrypts data using portable cryptographic primitives. Most users should choose Encrypt and Decrypt rather than their raw counterparts. The CryptoKey.purpose must be RAW_ENCRYPT_DECRYPT.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to use for encryption. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.RawEncrypt.
  &quot;additionalAuthenticatedData&quot;: &quot;A String&quot;, # Optional. Optional data that, if specified, must also be provided during decryption through RawDecryptRequest.additional_authenticated_data. This field may only be used in conjunction with an algorithm that accepts additional authenticated data (for example, AES-GCM). The maximum size depends on the key version&#x27;s protection_level. For SOFTWARE keys, the plaintext must be no larger than 64KiB. For HSM keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB.
  &quot;additionalAuthenticatedDataCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the RawEncryptRequest.additional_authenticated_data. If specified, KeyManagementService will verify the integrity of the received additional_authenticated_data using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(additional_authenticated_data) is equal to additional_authenticated_data_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;initializationVector&quot;: &quot;A String&quot;, # Optional. A customer-supplied initialization vector that will be used for encryption. If it is not provided for AES-CBC and AES-CTR, one will be generated. It will be returned in RawEncryptResponse.initialization_vector.
  &quot;initializationVectorCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the RawEncryptRequest.initialization_vector. If specified, KeyManagementService will verify the integrity of the received initialization_vector using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(initialization_vector) is equal to initialization_vector_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;plaintext&quot;: &quot;A String&quot;, # Required. The data to encrypt. Must be no larger than 64KiB. The maximum size depends on the key version&#x27;s protection_level. For SOFTWARE keys, the plaintext must be no larger than 64KiB. For HSM keys, the combined length of the plaintext and additional_authenticated_data fields must be no larger than 8KiB.
  &quot;plaintextCrc32c&quot;: &quot;A String&quot;, # Optional. An optional CRC32C checksum of the RawEncryptRequest.plaintext. If specified, KeyManagementService will verify the integrity of the received plaintext using this checksum. KeyManagementService will report an error if the checksum verification fails. If you receive a checksum error, your client should verify that CRC32C(plaintext) is equal to plaintext_crc32c, and if so, perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyManagementService.RawEncrypt.
  &quot;ciphertext&quot;: &quot;A String&quot;, # The encrypted data. In the case of AES-GCM, the authentication tag is the tag_length bytes at the end of this field.
  &quot;ciphertextCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned RawEncryptResponse.ciphertext. An integrity check of ciphertext can be performed by computing the CRC32C checksum of ciphertext and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;initializationVector&quot;: &quot;A String&quot;, # The initialization vector (IV) generated by the service during encryption. This value must be stored and provided in RawDecryptRequest.initialization_vector at decryption time.
  &quot;initializationVectorCrc32c&quot;: &quot;A String&quot;, # Integrity verification field. A CRC32C checksum of the returned RawEncryptResponse.initialization_vector. An integrity check of initialization_vector can be performed by computing the CRC32C checksum of initialization_vector and comparing your results to this field. Discard the response in case of non-matching checksum values, and perform a limited number of retries. A persistent mismatch may indicate an issue in your computation of the CRC32C checksum. Note: This field is defined as int64 for reasons of compatibility across different languages. However, it is a non-negative integer, which will never exceed 2^32-1, and can be safely downconverted to uint32 in languages that support this type.
  &quot;name&quot;: &quot;A String&quot;, # The resource name of the CryptoKeyVersion used in encryption. Check this field to verify that the intended resource was used for encryption.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # The ProtectionLevel of the CryptoKeyVersion used in encryption.
  &quot;tagLength&quot;: 42, # The length of the authentication tag that is appended to the end of the ciphertext.
  &quot;verifiedAdditionalAuthenticatedDataCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether RawEncryptRequest.additional_authenticated_data_crc32c was received by KeyManagementService and used for the integrity verification of additional_authenticated_data. A false value of this field indicates either that // RawEncryptRequest.additional_authenticated_data_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set RawEncryptRequest.additional_authenticated_data_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedInitializationVectorCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether RawEncryptRequest.initialization_vector_crc32c was received by KeyManagementService and used for the integrity verification of initialization_vector. A false value of this field indicates either that RawEncryptRequest.initialization_vector_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set RawEncryptRequest.initialization_vector_crc32c but this field is still false, discard the response and perform a limited number of retries.
  &quot;verifiedPlaintextCrc32c&quot;: True or False, # Integrity verification field. A flag indicating whether RawEncryptRequest.plaintext_crc32c was received by KeyManagementService and used for the integrity verification of the plaintext. A false value of this field indicates either that RawEncryptRequest.plaintext_crc32c was left unset or that it was not delivered to KeyManagementService. If you&#x27;ve set RawEncryptRequest.plaintext_crc32c but this field is still false, discard the response and perform a limited number of retries.
}</pre>
</div>

<div class="method">
    <code class="details" id="restore">restore(name, body=None, x__xgafv=None)</code>
  <pre>Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state. Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and destroy_time will be cleared.

Args:
  name: string, Required. The resource name of the CryptoKeyVersion to restore. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for KeyManagementService.RestoreCryptoKeyVersion.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A CryptoKeyVersion represents an individual cryptographic key, and the associated key material. An ENABLED version can be used for cryptographic operations. For security reasons, the raw cryptographic key material represented by a CryptoKeyVersion can never be viewed or exported. It can only be used to encrypt, decrypt, or sign data when an authorized user or application invokes Cloud KMS.
  &quot;algorithm&quot;: &quot;A String&quot;, # Output only. The CryptoKeyVersionAlgorithm that this CryptoKeyVersion supports.
  &quot;attestation&quot;: { # Contains an HSM-generated attestation about a key operation. For more information, see [Verifying attestations] (https://cloud.google.com/kms/docs/attest-key). # Output only. Statement that was generated and signed by the HSM at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only provided for key versions with protection_level HSM.
    &quot;certChains&quot;: { # Certificate chains needed to verify the attestation. Certificates in chains are PEM-encoded and are ordered based on https://tools.ietf.org/html/rfc5246#section-7.4.2. # Output only. The certificate chains needed to validate the attestation
      &quot;caviumCerts&quot;: [ # Cavium certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googleCardCerts&quot;: [ # Google card certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
      &quot;googlePartitionCerts&quot;: [ # Google partition certificate chain corresponding to the attestation.
        &quot;A String&quot;,
      ],
    },
    &quot;content&quot;: &quot;A String&quot;, # Output only. The attestation data provided by the HSM when the key operation was performed.
    &quot;format&quot;: &quot;A String&quot;, # Output only. The format of the attestation data.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion was created.
  &quot;destroyEventTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was destroyed. Only present if state is DESTROYED.
  &quot;destroyTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material is scheduled for destruction. Only present if state is DESTROY_SCHEDULED.
  &quot;externalDestructionFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent external destruction failure. Only present if state is EXTERNAL_DESTRUCTION_FAILED.
  &quot;externalProtectionLevelOptions&quot;: { # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels. # ExternalProtectionLevelOptions stores a group of additional fields for configuring a CryptoKeyVersion that are specific to the EXTERNAL protection level and EXTERNAL_VPC protection levels.
    &quot;ekmConnectionKeyPath&quot;: &quot;A String&quot;, # The path to the external key material on the EKM when using EkmConnection e.g., &quot;v0/my/key&quot;. Set this field instead of external_key_uri when using an EkmConnection.
    &quot;externalKeyUri&quot;: &quot;A String&quot;, # The URI for an external resource that this CryptoKeyVersion represents.
  },
  &quot;generateTime&quot;: &quot;A String&quot;, # Output only. The time this CryptoKeyVersion&#x27;s key material was generated.
  &quot;generationFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent generation failure. Only present if state is GENERATION_FAILED.
  &quot;importFailureReason&quot;: &quot;A String&quot;, # Output only. The root cause of the most recent import failure. Only present if state is IMPORT_FAILED.
  &quot;importJob&quot;: &quot;A String&quot;, # Output only. The name of the ImportJob used in the most recent import of this CryptoKeyVersion. Only present if the underlying key material was imported.
  &quot;importTime&quot;: &quot;A String&quot;, # Output only. The time at which this CryptoKeyVersion&#x27;s key material was most recently imported.
  &quot;name&quot;: &quot;A String&quot;, # Output only. The resource name for this CryptoKeyVersion in the format `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
  &quot;protectionLevel&quot;: &quot;A String&quot;, # Output only. The ProtectionLevel describing how crypto operations are performed with this CryptoKeyVersion.
  &quot;reimportEligible&quot;: True or False, # Output only. Whether or not this key version is eligible for reimport, by being specified as a target in ImportCryptoKeyVersionRequest.crypto_key_version.
  &quot;state&quot;: &quot;A String&quot;, # The current state of the CryptoKeyVersion.
}</pre>
</div>

</body></html>