@maxim_mazurok/gapi.client.cloudkms-v1 0.0.20220729
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2722 -0
- package/package.json +20 -0
- package/readme.md +71 -0
- package/tests.ts +705 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/tests.ts
ADDED
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.cloudkms-v1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220729
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://cloudkms.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.cloudkms */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
/** View and manage your keys and secrets stored in Cloud Key Management Service */
|
|
21
|
+
'https://www.googleapis.com/auth/cloudkms',
|
|
22
|
+
];
|
|
23
|
+
const immediate = false;
|
|
24
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
25
|
+
if (authResult && !authResult.error) {
|
|
26
|
+
/** handle successful authorization */
|
|
27
|
+
run();
|
|
28
|
+
} else {
|
|
29
|
+
/** handle authorization error */
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function run() {
|
|
34
|
+
/** Generate random bytes using the Cloud KMS randomness source in the provided location. */
|
|
35
|
+
await gapi.client.cloudkms.projects.locations.generateRandomBytes({
|
|
36
|
+
location: "Test string",
|
|
37
|
+
}, {
|
|
38
|
+
lengthBytes: 42,
|
|
39
|
+
protectionLevel: "Test string",
|
|
40
|
+
});
|
|
41
|
+
/** Gets information about a location. */
|
|
42
|
+
await gapi.client.cloudkms.projects.locations.get({
|
|
43
|
+
name: "Test string",
|
|
44
|
+
});
|
|
45
|
+
/** Lists information about the supported locations for this service. */
|
|
46
|
+
await gapi.client.cloudkms.projects.locations.list({
|
|
47
|
+
filter: "Test string",
|
|
48
|
+
name: "Test string",
|
|
49
|
+
pageSize: 42,
|
|
50
|
+
pageToken: "Test string",
|
|
51
|
+
});
|
|
52
|
+
/** Creates a new EkmConnection in a given Project and Location. */
|
|
53
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.create({
|
|
54
|
+
ekmConnectionId: "Test string",
|
|
55
|
+
parent: "Test string",
|
|
56
|
+
}, {
|
|
57
|
+
createTime: "Test string",
|
|
58
|
+
etag: "Test string",
|
|
59
|
+
name: "Test string",
|
|
60
|
+
serviceResolvers: [
|
|
61
|
+
{
|
|
62
|
+
endpointFilter: "Test string",
|
|
63
|
+
hostname: "Test string",
|
|
64
|
+
serverCertificates: [
|
|
65
|
+
{
|
|
66
|
+
issuer: "Test string",
|
|
67
|
+
notAfterTime: "Test string",
|
|
68
|
+
notBeforeTime: "Test string",
|
|
69
|
+
parsed: true,
|
|
70
|
+
rawDer: "Test string",
|
|
71
|
+
serialNumber: "Test string",
|
|
72
|
+
sha256Fingerprint: "Test string",
|
|
73
|
+
subject: "Test string",
|
|
74
|
+
subjectAlternativeDnsNames: [
|
|
75
|
+
"Test string"
|
|
76
|
+
],
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
serviceDirectoryService: "Test string",
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
});
|
|
83
|
+
/** Returns metadata for a given EkmConnection. */
|
|
84
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.get({
|
|
85
|
+
name: "Test string",
|
|
86
|
+
});
|
|
87
|
+
/** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
|
|
88
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.getIamPolicy({
|
|
89
|
+
"options.requestedPolicyVersion": 42,
|
|
90
|
+
resource: "Test string",
|
|
91
|
+
});
|
|
92
|
+
/** Lists EkmConnections. */
|
|
93
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.list({
|
|
94
|
+
filter: "Test string",
|
|
95
|
+
orderBy: "Test string",
|
|
96
|
+
pageSize: 42,
|
|
97
|
+
pageToken: "Test string",
|
|
98
|
+
parent: "Test string",
|
|
99
|
+
});
|
|
100
|
+
/** Updates an EkmConnection's metadata. */
|
|
101
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.patch({
|
|
102
|
+
name: "Test string",
|
|
103
|
+
updateMask: "Test string",
|
|
104
|
+
}, {
|
|
105
|
+
createTime: "Test string",
|
|
106
|
+
etag: "Test string",
|
|
107
|
+
name: "Test string",
|
|
108
|
+
serviceResolvers: [
|
|
109
|
+
{
|
|
110
|
+
endpointFilter: "Test string",
|
|
111
|
+
hostname: "Test string",
|
|
112
|
+
serverCertificates: [
|
|
113
|
+
{
|
|
114
|
+
issuer: "Test string",
|
|
115
|
+
notAfterTime: "Test string",
|
|
116
|
+
notBeforeTime: "Test string",
|
|
117
|
+
parsed: true,
|
|
118
|
+
rawDer: "Test string",
|
|
119
|
+
serialNumber: "Test string",
|
|
120
|
+
sha256Fingerprint: "Test string",
|
|
121
|
+
subject: "Test string",
|
|
122
|
+
subjectAlternativeDnsNames: [
|
|
123
|
+
"Test string"
|
|
124
|
+
],
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
serviceDirectoryService: "Test string",
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
});
|
|
131
|
+
/** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
|
|
132
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.setIamPolicy({
|
|
133
|
+
resource: "Test string",
|
|
134
|
+
}, {
|
|
135
|
+
policy: {
|
|
136
|
+
auditConfigs: [
|
|
137
|
+
{
|
|
138
|
+
auditLogConfigs: [
|
|
139
|
+
{
|
|
140
|
+
exemptedMembers: [
|
|
141
|
+
"Test string"
|
|
142
|
+
],
|
|
143
|
+
logType: "Test string",
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
service: "Test string",
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
bindings: [
|
|
150
|
+
{
|
|
151
|
+
condition: {
|
|
152
|
+
description: "Test string",
|
|
153
|
+
expression: "Test string",
|
|
154
|
+
location: "Test string",
|
|
155
|
+
title: "Test string",
|
|
156
|
+
},
|
|
157
|
+
members: [
|
|
158
|
+
"Test string"
|
|
159
|
+
],
|
|
160
|
+
role: "Test string",
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
etag: "Test string",
|
|
164
|
+
version: 42,
|
|
165
|
+
},
|
|
166
|
+
updateMask: "Test string",
|
|
167
|
+
});
|
|
168
|
+
/**
|
|
169
|
+
* Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
|
|
170
|
+
* operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
|
171
|
+
*/
|
|
172
|
+
await gapi.client.cloudkms.projects.locations.ekmConnections.testIamPermissions({
|
|
173
|
+
resource: "Test string",
|
|
174
|
+
}, {
|
|
175
|
+
permissions: [
|
|
176
|
+
"Test string"
|
|
177
|
+
],
|
|
178
|
+
});
|
|
179
|
+
/** Create a new KeyRing in a given Project and Location. */
|
|
180
|
+
await gapi.client.cloudkms.projects.locations.keyRings.create({
|
|
181
|
+
keyRingId: "Test string",
|
|
182
|
+
parent: "Test string",
|
|
183
|
+
}, {
|
|
184
|
+
createTime: "Test string",
|
|
185
|
+
name: "Test string",
|
|
186
|
+
});
|
|
187
|
+
/** Returns metadata for a given KeyRing. */
|
|
188
|
+
await gapi.client.cloudkms.projects.locations.keyRings.get({
|
|
189
|
+
name: "Test string",
|
|
190
|
+
});
|
|
191
|
+
/** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
|
|
192
|
+
await gapi.client.cloudkms.projects.locations.keyRings.getIamPolicy({
|
|
193
|
+
"options.requestedPolicyVersion": 42,
|
|
194
|
+
resource: "Test string",
|
|
195
|
+
});
|
|
196
|
+
/** Lists KeyRings. */
|
|
197
|
+
await gapi.client.cloudkms.projects.locations.keyRings.list({
|
|
198
|
+
filter: "Test string",
|
|
199
|
+
orderBy: "Test string",
|
|
200
|
+
pageSize: 42,
|
|
201
|
+
pageToken: "Test string",
|
|
202
|
+
parent: "Test string",
|
|
203
|
+
});
|
|
204
|
+
/** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
|
|
205
|
+
await gapi.client.cloudkms.projects.locations.keyRings.setIamPolicy({
|
|
206
|
+
resource: "Test string",
|
|
207
|
+
}, {
|
|
208
|
+
policy: {
|
|
209
|
+
auditConfigs: [
|
|
210
|
+
{
|
|
211
|
+
auditLogConfigs: [
|
|
212
|
+
{
|
|
213
|
+
exemptedMembers: [
|
|
214
|
+
"Test string"
|
|
215
|
+
],
|
|
216
|
+
logType: "Test string",
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
service: "Test string",
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
bindings: [
|
|
223
|
+
{
|
|
224
|
+
condition: {
|
|
225
|
+
description: "Test string",
|
|
226
|
+
expression: "Test string",
|
|
227
|
+
location: "Test string",
|
|
228
|
+
title: "Test string",
|
|
229
|
+
},
|
|
230
|
+
members: [
|
|
231
|
+
"Test string"
|
|
232
|
+
],
|
|
233
|
+
role: "Test string",
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
etag: "Test string",
|
|
237
|
+
version: 42,
|
|
238
|
+
},
|
|
239
|
+
updateMask: "Test string",
|
|
240
|
+
});
|
|
241
|
+
/**
|
|
242
|
+
* Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
|
|
243
|
+
* operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
|
244
|
+
*/
|
|
245
|
+
await gapi.client.cloudkms.projects.locations.keyRings.testIamPermissions({
|
|
246
|
+
resource: "Test string",
|
|
247
|
+
}, {
|
|
248
|
+
permissions: [
|
|
249
|
+
"Test string"
|
|
250
|
+
],
|
|
251
|
+
});
|
|
252
|
+
/** Create a new CryptoKey within a KeyRing. CryptoKey.purpose and CryptoKey.version_template.algorithm are required. */
|
|
253
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.create({
|
|
254
|
+
cryptoKeyId: "Test string",
|
|
255
|
+
parent: "Test string",
|
|
256
|
+
skipInitialVersionCreation: true,
|
|
257
|
+
}, {
|
|
258
|
+
createTime: "Test string",
|
|
259
|
+
cryptoKeyBackend: "Test string",
|
|
260
|
+
destroyScheduledDuration: "Test string",
|
|
261
|
+
importOnly: true,
|
|
262
|
+
labels: {
|
|
263
|
+
A: "Test string"
|
|
264
|
+
},
|
|
265
|
+
name: "Test string",
|
|
266
|
+
nextRotationTime: "Test string",
|
|
267
|
+
primary: {
|
|
268
|
+
algorithm: "Test string",
|
|
269
|
+
attestation: {
|
|
270
|
+
certChains: {
|
|
271
|
+
caviumCerts: [
|
|
272
|
+
"Test string"
|
|
273
|
+
],
|
|
274
|
+
googleCardCerts: [
|
|
275
|
+
"Test string"
|
|
276
|
+
],
|
|
277
|
+
googlePartitionCerts: [
|
|
278
|
+
"Test string"
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
content: "Test string",
|
|
282
|
+
format: "Test string",
|
|
283
|
+
},
|
|
284
|
+
createTime: "Test string",
|
|
285
|
+
destroyEventTime: "Test string",
|
|
286
|
+
destroyTime: "Test string",
|
|
287
|
+
externalProtectionLevelOptions: {
|
|
288
|
+
ekmConnectionKeyPath: "Test string",
|
|
289
|
+
externalKeyUri: "Test string",
|
|
290
|
+
},
|
|
291
|
+
generateTime: "Test string",
|
|
292
|
+
importFailureReason: "Test string",
|
|
293
|
+
importJob: "Test string",
|
|
294
|
+
importTime: "Test string",
|
|
295
|
+
name: "Test string",
|
|
296
|
+
protectionLevel: "Test string",
|
|
297
|
+
reimportEligible: true,
|
|
298
|
+
state: "Test string",
|
|
299
|
+
},
|
|
300
|
+
purpose: "Test string",
|
|
301
|
+
rotationPeriod: "Test string",
|
|
302
|
+
versionTemplate: {
|
|
303
|
+
algorithm: "Test string",
|
|
304
|
+
protectionLevel: "Test string",
|
|
305
|
+
},
|
|
306
|
+
});
|
|
307
|
+
/** Decrypts data that was protected by Encrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT. */
|
|
308
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.decrypt({
|
|
309
|
+
name: "Test string",
|
|
310
|
+
}, {
|
|
311
|
+
additionalAuthenticatedData: "Test string",
|
|
312
|
+
additionalAuthenticatedDataCrc32c: "Test string",
|
|
313
|
+
ciphertext: "Test string",
|
|
314
|
+
ciphertextCrc32c: "Test string",
|
|
315
|
+
});
|
|
316
|
+
/** Encrypts data, so that it can only be recovered by a call to Decrypt. The CryptoKey.purpose must be ENCRYPT_DECRYPT. */
|
|
317
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.encrypt({
|
|
318
|
+
name: "Test string",
|
|
319
|
+
}, {
|
|
320
|
+
additionalAuthenticatedData: "Test string",
|
|
321
|
+
additionalAuthenticatedDataCrc32c: "Test string",
|
|
322
|
+
plaintext: "Test string",
|
|
323
|
+
plaintextCrc32c: "Test string",
|
|
324
|
+
});
|
|
325
|
+
/** Returns metadata for a given CryptoKey, as well as its primary CryptoKeyVersion. */
|
|
326
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.get({
|
|
327
|
+
name: "Test string",
|
|
328
|
+
});
|
|
329
|
+
/** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
|
|
330
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy({
|
|
331
|
+
"options.requestedPolicyVersion": 42,
|
|
332
|
+
resource: "Test string",
|
|
333
|
+
});
|
|
334
|
+
/** Lists CryptoKeys. */
|
|
335
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.list({
|
|
336
|
+
filter: "Test string",
|
|
337
|
+
orderBy: "Test string",
|
|
338
|
+
pageSize: 42,
|
|
339
|
+
pageToken: "Test string",
|
|
340
|
+
parent: "Test string",
|
|
341
|
+
versionView: "Test string",
|
|
342
|
+
});
|
|
343
|
+
/** Update a CryptoKey. */
|
|
344
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.patch({
|
|
345
|
+
name: "Test string",
|
|
346
|
+
updateMask: "Test string",
|
|
347
|
+
}, {
|
|
348
|
+
createTime: "Test string",
|
|
349
|
+
cryptoKeyBackend: "Test string",
|
|
350
|
+
destroyScheduledDuration: "Test string",
|
|
351
|
+
importOnly: true,
|
|
352
|
+
labels: {
|
|
353
|
+
A: "Test string"
|
|
354
|
+
},
|
|
355
|
+
name: "Test string",
|
|
356
|
+
nextRotationTime: "Test string",
|
|
357
|
+
primary: {
|
|
358
|
+
algorithm: "Test string",
|
|
359
|
+
attestation: {
|
|
360
|
+
certChains: {
|
|
361
|
+
caviumCerts: [
|
|
362
|
+
"Test string"
|
|
363
|
+
],
|
|
364
|
+
googleCardCerts: [
|
|
365
|
+
"Test string"
|
|
366
|
+
],
|
|
367
|
+
googlePartitionCerts: [
|
|
368
|
+
"Test string"
|
|
369
|
+
],
|
|
370
|
+
},
|
|
371
|
+
content: "Test string",
|
|
372
|
+
format: "Test string",
|
|
373
|
+
},
|
|
374
|
+
createTime: "Test string",
|
|
375
|
+
destroyEventTime: "Test string",
|
|
376
|
+
destroyTime: "Test string",
|
|
377
|
+
externalProtectionLevelOptions: {
|
|
378
|
+
ekmConnectionKeyPath: "Test string",
|
|
379
|
+
externalKeyUri: "Test string",
|
|
380
|
+
},
|
|
381
|
+
generateTime: "Test string",
|
|
382
|
+
importFailureReason: "Test string",
|
|
383
|
+
importJob: "Test string",
|
|
384
|
+
importTime: "Test string",
|
|
385
|
+
name: "Test string",
|
|
386
|
+
protectionLevel: "Test string",
|
|
387
|
+
reimportEligible: true,
|
|
388
|
+
state: "Test string",
|
|
389
|
+
},
|
|
390
|
+
purpose: "Test string",
|
|
391
|
+
rotationPeriod: "Test string",
|
|
392
|
+
versionTemplate: {
|
|
393
|
+
algorithm: "Test string",
|
|
394
|
+
protectionLevel: "Test string",
|
|
395
|
+
},
|
|
396
|
+
});
|
|
397
|
+
/** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
|
|
398
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy({
|
|
399
|
+
resource: "Test string",
|
|
400
|
+
}, {
|
|
401
|
+
policy: {
|
|
402
|
+
auditConfigs: [
|
|
403
|
+
{
|
|
404
|
+
auditLogConfigs: [
|
|
405
|
+
{
|
|
406
|
+
exemptedMembers: [
|
|
407
|
+
"Test string"
|
|
408
|
+
],
|
|
409
|
+
logType: "Test string",
|
|
410
|
+
}
|
|
411
|
+
],
|
|
412
|
+
service: "Test string",
|
|
413
|
+
}
|
|
414
|
+
],
|
|
415
|
+
bindings: [
|
|
416
|
+
{
|
|
417
|
+
condition: {
|
|
418
|
+
description: "Test string",
|
|
419
|
+
expression: "Test string",
|
|
420
|
+
location: "Test string",
|
|
421
|
+
title: "Test string",
|
|
422
|
+
},
|
|
423
|
+
members: [
|
|
424
|
+
"Test string"
|
|
425
|
+
],
|
|
426
|
+
role: "Test string",
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
etag: "Test string",
|
|
430
|
+
version: 42,
|
|
431
|
+
},
|
|
432
|
+
updateMask: "Test string",
|
|
433
|
+
});
|
|
434
|
+
/**
|
|
435
|
+
* Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
|
|
436
|
+
* operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
|
437
|
+
*/
|
|
438
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions({
|
|
439
|
+
resource: "Test string",
|
|
440
|
+
}, {
|
|
441
|
+
permissions: [
|
|
442
|
+
"Test string"
|
|
443
|
+
],
|
|
444
|
+
});
|
|
445
|
+
/** Update the version of a CryptoKey that will be used in Encrypt. Returns an error if called on a key whose purpose is not ENCRYPT_DECRYPT. */
|
|
446
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion({
|
|
447
|
+
name: "Test string",
|
|
448
|
+
}, {
|
|
449
|
+
cryptoKeyVersionId: "Test string",
|
|
450
|
+
});
|
|
451
|
+
/** Decrypts data that was encrypted with a public key retrieved from GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_DECRYPT. */
|
|
452
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricDecrypt({
|
|
453
|
+
name: "Test string",
|
|
454
|
+
}, {
|
|
455
|
+
ciphertext: "Test string",
|
|
456
|
+
ciphertextCrc32c: "Test string",
|
|
457
|
+
});
|
|
458
|
+
/** Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN, producing a signature that can be verified with the public key retrieved from GetPublicKey. */
|
|
459
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.asymmetricSign({
|
|
460
|
+
name: "Test string",
|
|
461
|
+
}, {
|
|
462
|
+
data: "Test string",
|
|
463
|
+
dataCrc32c: "Test string",
|
|
464
|
+
digest: {
|
|
465
|
+
sha256: "Test string",
|
|
466
|
+
sha384: "Test string",
|
|
467
|
+
sha512: "Test string",
|
|
468
|
+
},
|
|
469
|
+
digestCrc32c: "Test string",
|
|
470
|
+
});
|
|
471
|
+
/** Create a new CryptoKeyVersion in a CryptoKey. The server will assign the next sequential id. If unset, state will be set to ENABLED. */
|
|
472
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create({
|
|
473
|
+
parent: "Test string",
|
|
474
|
+
}, {
|
|
475
|
+
algorithm: "Test string",
|
|
476
|
+
attestation: {
|
|
477
|
+
certChains: {
|
|
478
|
+
caviumCerts: [
|
|
479
|
+
"Test string"
|
|
480
|
+
],
|
|
481
|
+
googleCardCerts: [
|
|
482
|
+
"Test string"
|
|
483
|
+
],
|
|
484
|
+
googlePartitionCerts: [
|
|
485
|
+
"Test string"
|
|
486
|
+
],
|
|
487
|
+
},
|
|
488
|
+
content: "Test string",
|
|
489
|
+
format: "Test string",
|
|
490
|
+
},
|
|
491
|
+
createTime: "Test string",
|
|
492
|
+
destroyEventTime: "Test string",
|
|
493
|
+
destroyTime: "Test string",
|
|
494
|
+
externalProtectionLevelOptions: {
|
|
495
|
+
ekmConnectionKeyPath: "Test string",
|
|
496
|
+
externalKeyUri: "Test string",
|
|
497
|
+
},
|
|
498
|
+
generateTime: "Test string",
|
|
499
|
+
importFailureReason: "Test string",
|
|
500
|
+
importJob: "Test string",
|
|
501
|
+
importTime: "Test string",
|
|
502
|
+
name: "Test string",
|
|
503
|
+
protectionLevel: "Test string",
|
|
504
|
+
reimportEligible: true,
|
|
505
|
+
state: "Test string",
|
|
506
|
+
});
|
|
507
|
+
/**
|
|
508
|
+
* 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
|
|
509
|
+
* 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
|
|
510
|
+
* reached, RestoreCryptoKeyVersion may be called to reverse the process.
|
|
511
|
+
*/
|
|
512
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy({
|
|
513
|
+
name: "Test string",
|
|
514
|
+
}, {
|
|
515
|
+
});
|
|
516
|
+
/** Returns metadata for a given CryptoKeyVersion. */
|
|
517
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get({
|
|
518
|
+
name: "Test string",
|
|
519
|
+
});
|
|
520
|
+
/** Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT. */
|
|
521
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.getPublicKey({
|
|
522
|
+
name: "Test string",
|
|
523
|
+
});
|
|
524
|
+
/**
|
|
525
|
+
* 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
|
|
526
|
+
* reimported into that version. Otherwise, a new version will be created, and will be assigned the next sequential id within the CryptoKey.
|
|
527
|
+
*/
|
|
528
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.import({
|
|
529
|
+
parent: "Test string",
|
|
530
|
+
}, {
|
|
531
|
+
algorithm: "Test string",
|
|
532
|
+
cryptoKeyVersion: "Test string",
|
|
533
|
+
importJob: "Test string",
|
|
534
|
+
rsaAesWrappedKey: "Test string",
|
|
535
|
+
wrappedKey: "Test string",
|
|
536
|
+
});
|
|
537
|
+
/** Lists CryptoKeyVersions. */
|
|
538
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list({
|
|
539
|
+
filter: "Test string",
|
|
540
|
+
orderBy: "Test string",
|
|
541
|
+
pageSize: 42,
|
|
542
|
+
pageToken: "Test string",
|
|
543
|
+
parent: "Test string",
|
|
544
|
+
view: "Test string",
|
|
545
|
+
});
|
|
546
|
+
/** Signs data using a CryptoKeyVersion with CryptoKey.purpose MAC, producing a tag that can be verified by another source with the same key. */
|
|
547
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.macSign({
|
|
548
|
+
name: "Test string",
|
|
549
|
+
}, {
|
|
550
|
+
data: "Test string",
|
|
551
|
+
dataCrc32c: "Test string",
|
|
552
|
+
});
|
|
553
|
+
/** Verifies MAC tag using a CryptoKeyVersion with CryptoKey.purpose MAC, and returns a response that indicates whether or not the verification was successful. */
|
|
554
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.macVerify({
|
|
555
|
+
name: "Test string",
|
|
556
|
+
}, {
|
|
557
|
+
data: "Test string",
|
|
558
|
+
dataCrc32c: "Test string",
|
|
559
|
+
mac: "Test string",
|
|
560
|
+
macCrc32c: "Test string",
|
|
561
|
+
});
|
|
562
|
+
/**
|
|
563
|
+
* Update a CryptoKeyVersion's metadata. state may be changed between ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other
|
|
564
|
+
* states.
|
|
565
|
+
*/
|
|
566
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch({
|
|
567
|
+
name: "Test string",
|
|
568
|
+
updateMask: "Test string",
|
|
569
|
+
}, {
|
|
570
|
+
algorithm: "Test string",
|
|
571
|
+
attestation: {
|
|
572
|
+
certChains: {
|
|
573
|
+
caviumCerts: [
|
|
574
|
+
"Test string"
|
|
575
|
+
],
|
|
576
|
+
googleCardCerts: [
|
|
577
|
+
"Test string"
|
|
578
|
+
],
|
|
579
|
+
googlePartitionCerts: [
|
|
580
|
+
"Test string"
|
|
581
|
+
],
|
|
582
|
+
},
|
|
583
|
+
content: "Test string",
|
|
584
|
+
format: "Test string",
|
|
585
|
+
},
|
|
586
|
+
createTime: "Test string",
|
|
587
|
+
destroyEventTime: "Test string",
|
|
588
|
+
destroyTime: "Test string",
|
|
589
|
+
externalProtectionLevelOptions: {
|
|
590
|
+
ekmConnectionKeyPath: "Test string",
|
|
591
|
+
externalKeyUri: "Test string",
|
|
592
|
+
},
|
|
593
|
+
generateTime: "Test string",
|
|
594
|
+
importFailureReason: "Test string",
|
|
595
|
+
importJob: "Test string",
|
|
596
|
+
importTime: "Test string",
|
|
597
|
+
name: "Test string",
|
|
598
|
+
protectionLevel: "Test string",
|
|
599
|
+
reimportEligible: true,
|
|
600
|
+
state: "Test string",
|
|
601
|
+
});
|
|
602
|
+
/** 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. */
|
|
603
|
+
await gapi.client.cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore({
|
|
604
|
+
name: "Test string",
|
|
605
|
+
}, {
|
|
606
|
+
});
|
|
607
|
+
/** Create a new ImportJob within a KeyRing. ImportJob.import_method is required. */
|
|
608
|
+
await gapi.client.cloudkms.projects.locations.keyRings.importJobs.create({
|
|
609
|
+
importJobId: "Test string",
|
|
610
|
+
parent: "Test string",
|
|
611
|
+
}, {
|
|
612
|
+
attestation: {
|
|
613
|
+
certChains: {
|
|
614
|
+
caviumCerts: [
|
|
615
|
+
"Test string"
|
|
616
|
+
],
|
|
617
|
+
googleCardCerts: [
|
|
618
|
+
"Test string"
|
|
619
|
+
],
|
|
620
|
+
googlePartitionCerts: [
|
|
621
|
+
"Test string"
|
|
622
|
+
],
|
|
623
|
+
},
|
|
624
|
+
content: "Test string",
|
|
625
|
+
format: "Test string",
|
|
626
|
+
},
|
|
627
|
+
createTime: "Test string",
|
|
628
|
+
expireEventTime: "Test string",
|
|
629
|
+
expireTime: "Test string",
|
|
630
|
+
generateTime: "Test string",
|
|
631
|
+
importMethod: "Test string",
|
|
632
|
+
name: "Test string",
|
|
633
|
+
protectionLevel: "Test string",
|
|
634
|
+
publicKey: {
|
|
635
|
+
pem: "Test string",
|
|
636
|
+
},
|
|
637
|
+
state: "Test string",
|
|
638
|
+
});
|
|
639
|
+
/** Returns metadata for a given ImportJob. */
|
|
640
|
+
await gapi.client.cloudkms.projects.locations.keyRings.importJobs.get({
|
|
641
|
+
name: "Test string",
|
|
642
|
+
});
|
|
643
|
+
/** Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set. */
|
|
644
|
+
await gapi.client.cloudkms.projects.locations.keyRings.importJobs.getIamPolicy({
|
|
645
|
+
"options.requestedPolicyVersion": 42,
|
|
646
|
+
resource: "Test string",
|
|
647
|
+
});
|
|
648
|
+
/** Lists ImportJobs. */
|
|
649
|
+
await gapi.client.cloudkms.projects.locations.keyRings.importJobs.list({
|
|
650
|
+
filter: "Test string",
|
|
651
|
+
orderBy: "Test string",
|
|
652
|
+
pageSize: 42,
|
|
653
|
+
pageToken: "Test string",
|
|
654
|
+
parent: "Test string",
|
|
655
|
+
});
|
|
656
|
+
/** Sets the access control policy on the specified resource. Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. */
|
|
657
|
+
await gapi.client.cloudkms.projects.locations.keyRings.importJobs.setIamPolicy({
|
|
658
|
+
resource: "Test string",
|
|
659
|
+
}, {
|
|
660
|
+
policy: {
|
|
661
|
+
auditConfigs: [
|
|
662
|
+
{
|
|
663
|
+
auditLogConfigs: [
|
|
664
|
+
{
|
|
665
|
+
exemptedMembers: [
|
|
666
|
+
"Test string"
|
|
667
|
+
],
|
|
668
|
+
logType: "Test string",
|
|
669
|
+
}
|
|
670
|
+
],
|
|
671
|
+
service: "Test string",
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
bindings: [
|
|
675
|
+
{
|
|
676
|
+
condition: {
|
|
677
|
+
description: "Test string",
|
|
678
|
+
expression: "Test string",
|
|
679
|
+
location: "Test string",
|
|
680
|
+
title: "Test string",
|
|
681
|
+
},
|
|
682
|
+
members: [
|
|
683
|
+
"Test string"
|
|
684
|
+
],
|
|
685
|
+
role: "Test string",
|
|
686
|
+
}
|
|
687
|
+
],
|
|
688
|
+
etag: "Test string",
|
|
689
|
+
version: 42,
|
|
690
|
+
},
|
|
691
|
+
updateMask: "Test string",
|
|
692
|
+
});
|
|
693
|
+
/**
|
|
694
|
+
* Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This
|
|
695
|
+
* operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
|
|
696
|
+
*/
|
|
697
|
+
await gapi.client.cloudkms.projects.locations.keyRings.importJobs.testIamPermissions({
|
|
698
|
+
resource: "Test string",
|
|
699
|
+
}, {
|
|
700
|
+
permissions: [
|
|
701
|
+
"Test string"
|
|
702
|
+
],
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
});
|