Repository navigation
Expand file tree
/
Copy pathImportJob.php
More file actions
447 lines (411 loc) · 20.3 KB
/
Copy pathImportJob.php
File metadata and controls
447 lines (411 loc) · 20.3 KB
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
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/kms/v1/resources.proto
namespace Google\Cloud\Kms\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* An [ImportJob][google.cloud.kms.v1.ImportJob] can be used to create [CryptoKeys][google.cloud.kms.v1.CryptoKey] and
* [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] using pre-existing key material,
* generated outside of Cloud KMS.
* When an [ImportJob][google.cloud.kms.v1.ImportJob] is created, Cloud KMS will generate a "wrapping key",
* which is a public/private key pair. You use the wrapping key to encrypt (also
* known as wrap) the pre-existing key material to protect it during the import
* process. The nature of the wrapping key depends on the choice of
* [import_method][google.cloud.kms.v1.ImportJob.import_method]. When the wrapping key generation
* is complete, the [state][google.cloud.kms.v1.ImportJob.state] will be set to
* [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE] and the [public_key][google.cloud.kms.v1.ImportJob.public_key]
* can be fetched. The fetched public key can then be used to wrap your
* pre-existing key material.
* Once the key material is wrapped, it can be imported into a new
* [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in an existing [CryptoKey][google.cloud.kms.v1.CryptoKey] by calling
* [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion].
* Multiple [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] can be imported with a single
* [ImportJob][google.cloud.kms.v1.ImportJob]. Cloud KMS uses the private key portion of the wrapping key to
* unwrap the key material. Only Cloud KMS has access to the private key.
* An [ImportJob][google.cloud.kms.v1.ImportJob] expires 3 days after it is created. Once expired, Cloud KMS
* will no longer be able to import or unwrap any key material that was wrapped
* with the [ImportJob][google.cloud.kms.v1.ImportJob]'s public key.
* For more information, see
* [Importing a key](https://cloud.google.com/kms/docs/importing-a-key).
*
* Generated from protobuf message <code>google.cloud.kms.v1.ImportJob</code>
*/
class ImportJob extends \Google\Protobuf\Internal\Message
{
/**
* Output only. The resource name for this [ImportJob][google.cloud.kms.v1.ImportJob] in the format
* `projects/*/locations/*/keyRings/*/importJobs/*`.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $name = '';
/**
* Required. Immutable. The wrapping method to be used for incoming key material.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
*/
private $import_method = 0;
/**
* Required. Immutable. The protection level of the [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the
* [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] of the
* [version_template][google.cloud.kms.v1.CryptoKey.version_template] on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you
* attempt to import into.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
*/
private $protection_level = 0;
/**
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] was created.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $create_time = null;
/**
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key material was generated.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $generate_time = null;
/**
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for
* expiration and can no longer be used to import key material.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $expire_time = null;
/**
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] expired. Only present if
* [state][google.cloud.kms.v1.ImportJob.state] is [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $expire_event_time = null;
/**
* Output only. The current state of the [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can
* be used.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $state = 0;
/**
* Output only. The public key with which to wrap key material prior to
* import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is
* [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $public_key = null;
/**
* Output only. Statement that was generated and signed by the key creator
* (for example, an HSM) at key creation time. Use this statement to verify
* attributes of the key as stored on the HSM, independently of Google.
* Only present if the chosen [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a protection
* level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
*
* Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
*/
private $attestation = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $name
* Output only. The resource name for this [ImportJob][google.cloud.kms.v1.ImportJob] in the format
* `projects/*/locations/*/keyRings/*/importJobs/*`.
* @type int $import_method
* Required. Immutable. The wrapping method to be used for incoming key material.
* @type int $protection_level
* Required. Immutable. The protection level of the [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the
* [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] of the
* [version_template][google.cloud.kms.v1.CryptoKey.version_template] on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you
* attempt to import into.
* @type \Google\Protobuf\Timestamp $create_time
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] was created.
* @type \Google\Protobuf\Timestamp $generate_time
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key material was generated.
* @type \Google\Protobuf\Timestamp $expire_time
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for
* expiration and can no longer be used to import key material.
* @type \Google\Protobuf\Timestamp $expire_event_time
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] expired. Only present if
* [state][google.cloud.kms.v1.ImportJob.state] is [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
* @type int $state
* Output only. The current state of the [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can
* be used.
* @type \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey $public_key
* Output only. The public key with which to wrap key material prior to
* import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is
* [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
* @type \Google\Cloud\Kms\V1\KeyOperationAttestation $attestation
* Output only. Statement that was generated and signed by the key creator
* (for example, an HSM) at key creation time. Use this statement to verify
* attributes of the key as stored on the HSM, independently of Google.
* Only present if the chosen [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a protection
* level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce();
parent::__construct($data);
}
/**
* Output only. The resource name for this [ImportJob][google.cloud.kms.v1.ImportJob] in the format
* `projects/*/locations/*/keyRings/*/importJobs/*`.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Output only. The resource name for this [ImportJob][google.cloud.kms.v1.ImportJob] in the format
* `projects/*/locations/*/keyRings/*/importJobs/*`.
*
* Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* Required. Immutable. The wrapping method to be used for incoming key material.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
* @return int
*/
public function getImportMethod()
{
return $this->import_method;
}
/**
* Required. Immutable. The wrapping method to be used for incoming key material.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
* @param int $var
* @return $this
*/
public function setImportMethod($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ImportJob_ImportMethod::class);
$this->import_method = $var;
return $this;
}
/**
* Required. Immutable. The protection level of the [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the
* [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] of the
* [version_template][google.cloud.kms.v1.CryptoKey.version_template] on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you
* attempt to import into.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
* @return int
*/
public function getProtectionLevel()
{
return $this->protection_level;
}
/**
* Required. Immutable. The protection level of the [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the
* [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] of the
* [version_template][google.cloud.kms.v1.CryptoKey.version_template] on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you
* attempt to import into.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
* @param int $var
* @return $this
*/
public function setProtectionLevel($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ProtectionLevel::class);
$this->protection_level = $var;
return $this;
}
/**
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] was created.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return \Google\Protobuf\Timestamp
*/
public function getCreateTime()
{
return $this->create_time;
}
/**
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] was created.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setCreateTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->create_time = $var;
return $this;
}
/**
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key material was generated.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return \Google\Protobuf\Timestamp
*/
public function getGenerateTime()
{
return $this->generate_time;
}
/**
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key material was generated.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setGenerateTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->generate_time = $var;
return $this;
}
/**
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for
* expiration and can no longer be used to import key material.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return \Google\Protobuf\Timestamp
*/
public function getExpireTime()
{
return $this->expire_time;
}
/**
* Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for
* expiration and can no longer be used to import key material.
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setExpireTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->expire_time = $var;
return $this;
}
/**
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] expired. Only present if
* [state][google.cloud.kms.v1.ImportJob.state] is [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return \Google\Protobuf\Timestamp
*/
public function getExpireEventTime()
{
return $this->expire_event_time;
}
/**
* Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] expired. Only present if
* [state][google.cloud.kms.v1.ImportJob.state] is [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
*
* Generated from protobuf field <code>.google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setExpireEventTime($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->expire_event_time = $var;
return $this;
}
/**
* Output only. The current state of the [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can
* be used.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return int
*/
public function getState()
{
return $this->state;
}
/**
* Output only. The current state of the [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can
* be used.
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param int $var
* @return $this
*/
public function setState($var)
{
GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\ImportJob_ImportJobState::class);
$this->state = $var;
return $this;
}
/**
* Output only. The public key with which to wrap key material prior to
* import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is
* [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey
*/
public function getPublicKey()
{
return $this->public_key;
}
/**
* Output only. The public key with which to wrap key material prior to
* import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is
* [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
*
* Generated from protobuf field <code>.google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param \Google\Cloud\Kms\V1\ImportJob\WrappingPublicKey $var
* @return $this
*/
public function setPublicKey($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\ImportJob_WrappingPublicKey::class);
$this->public_key = $var;
return $this;
}
/**
* Output only. Statement that was generated and signed by the key creator
* (for example, an HSM) at key creation time. Use this statement to verify
* attributes of the key as stored on the HSM, independently of Google.
* Only present if the chosen [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a protection
* level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
*
* Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @return \Google\Cloud\Kms\V1\KeyOperationAttestation
*/
public function getAttestation()
{
return $this->attestation;
}
/**
* Output only. Statement that was generated and signed by the key creator
* (for example, an HSM) at key creation time. Use this statement to verify
* attributes of the key as stored on the HSM, independently of Google.
* Only present if the chosen [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a protection
* level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
*
* Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
* @param \Google\Cloud\Kms\V1\KeyOperationAttestation $var
* @return $this
*/
public function setAttestation($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation::class);
$this->attestation = $var;
return $this;
}
}