service.proto 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.kms.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/kms/v1/resources.proto";
  21. import "google/protobuf/field_mask.proto";
  22. import "google/protobuf/wrappers.proto";
  23. option cc_enable_arenas = true;
  24. option csharp_namespace = "Google.Cloud.Kms.V1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/kms/v1;kms";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "KmsProto";
  28. option java_package = "com.google.cloud.kms.v1";
  29. option php_namespace = "Google\\Cloud\\Kms\\V1";
  30. // Google Cloud Key Management Service
  31. //
  32. // Manages cryptographic keys and operations using those keys. Implements a REST
  33. // model with the following objects:
  34. //
  35. // * [KeyRing][google.cloud.kms.v1.KeyRing]
  36. // * [CryptoKey][google.cloud.kms.v1.CryptoKey]
  37. // * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
  38. // * [ImportJob][google.cloud.kms.v1.ImportJob]
  39. //
  40. // If you are using manual gRPC libraries, see
  41. // [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc).
  42. service KeyManagementService {
  43. option (google.api.default_host) = "cloudkms.googleapis.com";
  44. option (google.api.oauth_scopes) =
  45. "https://www.googleapis.com/auth/cloud-platform,"
  46. "https://www.googleapis.com/auth/cloudkms";
  47. // Lists [KeyRings][google.cloud.kms.v1.KeyRing].
  48. rpc ListKeyRings(ListKeyRingsRequest) returns (ListKeyRingsResponse) {
  49. option (google.api.http) = {
  50. get: "/v1/{parent=projects/*/locations/*}/keyRings"
  51. };
  52. option (google.api.method_signature) = "parent";
  53. }
  54. // Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
  55. rpc ListCryptoKeys(ListCryptoKeysRequest) returns (ListCryptoKeysResponse) {
  56. option (google.api.http) = {
  57. get: "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys"
  58. };
  59. option (google.api.method_signature) = "parent";
  60. }
  61. // Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
  62. rpc ListCryptoKeyVersions(ListCryptoKeyVersionsRequest)
  63. returns (ListCryptoKeyVersionsResponse) {
  64. option (google.api.http) = {
  65. get: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions"
  66. };
  67. option (google.api.method_signature) = "parent";
  68. }
  69. // Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
  70. rpc ListImportJobs(ListImportJobsRequest) returns (ListImportJobsResponse) {
  71. option (google.api.http) = {
  72. get: "/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs"
  73. };
  74. option (google.api.method_signature) = "parent";
  75. }
  76. // Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
  77. rpc GetKeyRing(GetKeyRingRequest) returns (KeyRing) {
  78. option (google.api.http) = {
  79. get: "/v1/{name=projects/*/locations/*/keyRings/*}"
  80. };
  81. option (google.api.method_signature) = "name";
  82. }
  83. // Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as
  84. // well as its [primary][google.cloud.kms.v1.CryptoKey.primary]
  85. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
  86. rpc GetCryptoKey(GetCryptoKeyRequest) returns (CryptoKey) {
  87. option (google.api.http) = {
  88. get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}"
  89. };
  90. option (google.api.method_signature) = "name";
  91. }
  92. // Returns metadata for a given
  93. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
  94. rpc GetCryptoKeyVersion(GetCryptoKeyVersionRequest)
  95. returns (CryptoKeyVersion) {
  96. option (google.api.http) = {
  97. get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}"
  98. };
  99. option (google.api.method_signature) = "name";
  100. }
  101. // Returns the public key for the given
  102. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
  103. // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
  104. // [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN]
  105. // or
  106. // [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
  107. rpc GetPublicKey(GetPublicKeyRequest) returns (PublicKey) {
  108. option (google.api.http) = {
  109. get: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}/publicKey"
  110. };
  111. option (google.api.method_signature) = "name";
  112. }
  113. // Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
  114. rpc GetImportJob(GetImportJobRequest) returns (ImportJob) {
  115. option (google.api.http) = {
  116. get: "/v1/{name=projects/*/locations/*/keyRings/*/importJobs/*}"
  117. };
  118. option (google.api.method_signature) = "name";
  119. }
  120. // Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and
  121. // Location.
  122. rpc CreateKeyRing(CreateKeyRingRequest) returns (KeyRing) {
  123. option (google.api.http) = {
  124. post: "/v1/{parent=projects/*/locations/*}/keyRings"
  125. body: "key_ring"
  126. };
  127. option (google.api.method_signature) = "parent,key_ring_id,key_ring";
  128. }
  129. // Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a
  130. // [KeyRing][google.cloud.kms.v1.KeyRing].
  131. //
  132. // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
  133. // [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]
  134. // are required.
  135. rpc CreateCryptoKey(CreateCryptoKeyRequest) returns (CryptoKey) {
  136. option (google.api.http) = {
  137. post: "/v1/{parent=projects/*/locations/*/keyRings/*}/cryptoKeys"
  138. body: "crypto_key"
  139. };
  140. option (google.api.method_signature) = "parent,crypto_key_id,crypto_key";
  141. }
  142. // Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a
  143. // [CryptoKey][google.cloud.kms.v1.CryptoKey].
  144. //
  145. // The server will assign the next sequential id. If unset,
  146. // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to
  147. // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
  148. rpc CreateCryptoKeyVersion(CreateCryptoKeyVersionRequest)
  149. returns (CryptoKeyVersion) {
  150. option (google.api.http) = {
  151. post: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions"
  152. body: "crypto_key_version"
  153. };
  154. option (google.api.method_signature) = "parent,crypto_key_version";
  155. }
  156. // Import wrapped key material into a
  157. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
  158. //
  159. // All requests must specify a [CryptoKey][google.cloud.kms.v1.CryptoKey]. If
  160. // a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] is additionally
  161. // specified in the request, key material will be reimported into that
  162. // version. Otherwise, a new version will be created, and will be assigned the
  163. // next sequential id within the [CryptoKey][google.cloud.kms.v1.CryptoKey].
  164. rpc ImportCryptoKeyVersion(ImportCryptoKeyVersionRequest)
  165. returns (CryptoKeyVersion) {
  166. option (google.api.http) = {
  167. post: "/v1/{parent=projects/*/locations/*/keyRings/*/cryptoKeys/*}/cryptoKeyVersions:import"
  168. body: "*"
  169. };
  170. }
  171. // Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a
  172. // [KeyRing][google.cloud.kms.v1.KeyRing].
  173. //
  174. // [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is
  175. // required.
  176. rpc CreateImportJob(CreateImportJobRequest) returns (ImportJob) {
  177. option (google.api.http) = {
  178. post: "/v1/{parent=projects/*/locations/*/keyRings/*}/importJobs"
  179. body: "import_job"
  180. };
  181. option (google.api.method_signature) = "parent,import_job_id,import_job";
  182. }
  183. // Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
  184. rpc UpdateCryptoKey(UpdateCryptoKeyRequest) returns (CryptoKey) {
  185. option (google.api.http) = {
  186. patch: "/v1/{crypto_key.name=projects/*/locations/*/keyRings/*/cryptoKeys/*}"
  187. body: "crypto_key"
  188. };
  189. option (google.api.method_signature) = "crypto_key,update_mask";
  190. }
  191. // Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s
  192. // metadata.
  193. //
  194. // [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between
  195. // [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]
  196. // and
  197. // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED]
  198. // using this method. See
  199. // [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion]
  200. // and
  201. // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]
  202. // to move between other states.
  203. rpc UpdateCryptoKeyVersion(UpdateCryptoKeyVersionRequest)
  204. returns (CryptoKeyVersion) {
  205. option (google.api.http) = {
  206. patch: "/v1/{crypto_key_version.name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}"
  207. body: "crypto_key_version"
  208. };
  209. option (google.api.method_signature) = "crypto_key_version,update_mask";
  210. }
  211. // Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that
  212. // will be used in
  213. // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
  214. //
  215. // Returns an error if called on a key whose purpose is not
  216. // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
  217. rpc UpdateCryptoKeyPrimaryVersion(UpdateCryptoKeyPrimaryVersionRequest)
  218. returns (CryptoKey) {
  219. option (google.api.http) = {
  220. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:updatePrimaryVersion"
  221. body: "*"
  222. };
  223. option (google.api.method_signature) = "name,crypto_key_version_id";
  224. }
  225. // Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for
  226. // destruction.
  227. //
  228. // Upon calling this method,
  229. // [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will
  230. // be set to
  231. // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED],
  232. // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will
  233. // be set to the time
  234. // [destroy_scheduled_duration][google.cloud.kms.v1.CryptoKey.destroy_scheduled_duration]
  235. // in the future. At that time, the
  236. // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will automatically
  237. // change to
  238. // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED],
  239. // and the key material will be irrevocably destroyed.
  240. //
  241. // Before the
  242. // [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is
  243. // reached,
  244. // [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion]
  245. // may be called to reverse the process.
  246. rpc DestroyCryptoKeyVersion(DestroyCryptoKeyVersionRequest)
  247. returns (CryptoKeyVersion) {
  248. option (google.api.http) = {
  249. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:destroy"
  250. body: "*"
  251. };
  252. option (google.api.method_signature) = "name";
  253. }
  254. // Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the
  255. // [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]
  256. // state.
  257. //
  258. // Upon restoration of the CryptoKeyVersion,
  259. // [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to
  260. // [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED],
  261. // and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will
  262. // be cleared.
  263. rpc RestoreCryptoKeyVersion(RestoreCryptoKeyVersionRequest)
  264. returns (CryptoKeyVersion) {
  265. option (google.api.http) = {
  266. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:restore"
  267. body: "*"
  268. };
  269. option (google.api.method_signature) = "name";
  270. }
  271. // Encrypts data, so that it can only be recovered by a call to
  272. // [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. The
  273. // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
  274. // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
  275. rpc Encrypt(EncryptRequest) returns (EncryptResponse) {
  276. option (google.api.http) = {
  277. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/**}:encrypt"
  278. body: "*"
  279. };
  280. option (google.api.method_signature) = "name,plaintext";
  281. }
  282. // Decrypts data that was protected by
  283. // [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The
  284. // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
  285. // [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
  286. rpc Decrypt(DecryptRequest) returns (DecryptResponse) {
  287. option (google.api.http) = {
  288. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*}:decrypt"
  289. body: "*"
  290. };
  291. option (google.api.method_signature) = "name,ciphertext";
  292. }
  293. // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
  294. // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
  295. // ASYMMETRIC_SIGN, producing a signature that can be verified with the public
  296. // key retrieved from
  297. // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
  298. rpc AsymmetricSign(AsymmetricSignRequest) returns (AsymmetricSignResponse) {
  299. option (google.api.http) = {
  300. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricSign"
  301. body: "*"
  302. };
  303. option (google.api.method_signature) = "name,digest";
  304. }
  305. // Decrypts data that was encrypted with a public key retrieved from
  306. // [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey]
  307. // corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
  308. // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
  309. // ASYMMETRIC_DECRYPT.
  310. rpc AsymmetricDecrypt(AsymmetricDecryptRequest)
  311. returns (AsymmetricDecryptResponse) {
  312. option (google.api.http) = {
  313. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:asymmetricDecrypt"
  314. body: "*"
  315. };
  316. option (google.api.method_signature) = "name,ciphertext";
  317. }
  318. // Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]
  319. // with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC,
  320. // producing a tag that can be verified by another source with the same key.
  321. rpc MacSign(MacSignRequest) returns (MacSignResponse) {
  322. option (google.api.http) = {
  323. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macSign"
  324. body: "*"
  325. };
  326. option (google.api.method_signature) = "name,data";
  327. }
  328. // Verifies MAC tag using a
  329. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
  330. // [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] MAC, and returns
  331. // a response that indicates whether or not the verification was successful.
  332. rpc MacVerify(MacVerifyRequest) returns (MacVerifyResponse) {
  333. option (google.api.http) = {
  334. post: "/v1/{name=projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*}:macVerify"
  335. body: "*"
  336. };
  337. option (google.api.method_signature) = "name,data,mac";
  338. }
  339. // Generate random bytes using the Cloud KMS randomness source in the provided
  340. // location.
  341. rpc GenerateRandomBytes(GenerateRandomBytesRequest)
  342. returns (GenerateRandomBytesResponse) {
  343. option (google.api.http) = {
  344. post: "/v1/{location=projects/*/locations/*}:generateRandomBytes"
  345. body: "*"
  346. };
  347. option (google.api.method_signature) =
  348. "location,length_bytes,protection_level";
  349. }
  350. }
  351. // Request message for
  352. // [KeyManagementService.ListKeyRings][google.cloud.kms.v1.KeyManagementService.ListKeyRings].
  353. message ListKeyRingsRequest {
  354. // Required. The resource name of the location associated with the
  355. // [KeyRings][google.cloud.kms.v1.KeyRing], in the format
  356. // `projects/*/locations/*`.
  357. string parent = 1 [
  358. (google.api.field_behavior) = REQUIRED,
  359. (google.api.resource_reference) = {
  360. type: "locations.googleapis.com/Location"
  361. }
  362. ];
  363. // Optional. Optional limit on the number of
  364. // [KeyRings][google.cloud.kms.v1.KeyRing] to include in the response. Further
  365. // [KeyRings][google.cloud.kms.v1.KeyRing] can subsequently be obtained by
  366. // including the
  367. // [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token]
  368. // in a subsequent request. If unspecified, the server will pick an
  369. // appropriate default.
  370. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  371. // Optional. Optional pagination token, returned earlier via
  372. // [ListKeyRingsResponse.next_page_token][google.cloud.kms.v1.ListKeyRingsResponse.next_page_token].
  373. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  374. // Optional. Only include resources that match the filter in the response. For
  375. // more information, see
  376. // [Sorting and filtering list
  377. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  378. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  379. // Optional. Specify how the results should be sorted. If not specified, the
  380. // results will be sorted in the default order. For more information, see
  381. // [Sorting and filtering list
  382. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  383. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  384. }
  385. // Request message for
  386. // [KeyManagementService.ListCryptoKeys][google.cloud.kms.v1.KeyManagementService.ListCryptoKeys].
  387. message ListCryptoKeysRequest {
  388. // Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
  389. // to list, in the format `projects/*/locations/*/keyRings/*`.
  390. string parent = 1 [
  391. (google.api.field_behavior) = REQUIRED,
  392. (google.api.resource_reference) = {
  393. type: "cloudkms.googleapis.com/KeyRing"
  394. }
  395. ];
  396. // Optional. Optional limit on the number of
  397. // [CryptoKeys][google.cloud.kms.v1.CryptoKey] to include in the response.
  398. // Further [CryptoKeys][google.cloud.kms.v1.CryptoKey] can subsequently be
  399. // obtained by including the
  400. // [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token]
  401. // in a subsequent request. If unspecified, the server will pick an
  402. // appropriate default.
  403. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  404. // Optional. Optional pagination token, returned earlier via
  405. // [ListCryptoKeysResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeysResponse.next_page_token].
  406. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  407. // The fields of the primary version to include in the response.
  408. CryptoKeyVersion.CryptoKeyVersionView version_view = 4;
  409. // Optional. Only include resources that match the filter in the response. For
  410. // more information, see
  411. // [Sorting and filtering list
  412. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  413. string filter = 5 [(google.api.field_behavior) = OPTIONAL];
  414. // Optional. Specify how the results should be sorted. If not specified, the
  415. // results will be sorted in the default order. For more information, see
  416. // [Sorting and filtering list
  417. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  418. string order_by = 6 [(google.api.field_behavior) = OPTIONAL];
  419. }
  420. // Request message for
  421. // [KeyManagementService.ListCryptoKeyVersions][google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions].
  422. message ListCryptoKeyVersionsRequest {
  423. // Required. The resource name of the
  424. // [CryptoKey][google.cloud.kms.v1.CryptoKey] to list, in the format
  425. // `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
  426. string parent = 1 [
  427. (google.api.field_behavior) = REQUIRED,
  428. (google.api.resource_reference) = {
  429. type: "cloudkms.googleapis.com/CryptoKey"
  430. }
  431. ];
  432. // Optional. Optional limit on the number of
  433. // [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] to include in the
  434. // response. Further [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]
  435. // can subsequently be obtained by including the
  436. // [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token]
  437. // in a subsequent request. If unspecified, the server will pick an
  438. // appropriate default.
  439. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  440. // Optional. Optional pagination token, returned earlier via
  441. // [ListCryptoKeyVersionsResponse.next_page_token][google.cloud.kms.v1.ListCryptoKeyVersionsResponse.next_page_token].
  442. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  443. // The fields to include in the response.
  444. CryptoKeyVersion.CryptoKeyVersionView view = 4;
  445. // Optional. Only include resources that match the filter in the response. For
  446. // more information, see
  447. // [Sorting and filtering list
  448. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  449. string filter = 5 [(google.api.field_behavior) = OPTIONAL];
  450. // Optional. Specify how the results should be sorted. If not specified, the
  451. // results will be sorted in the default order. For more information, see
  452. // [Sorting and filtering list
  453. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  454. string order_by = 6 [(google.api.field_behavior) = OPTIONAL];
  455. }
  456. // Request message for
  457. // [KeyManagementService.ListImportJobs][google.cloud.kms.v1.KeyManagementService.ListImportJobs].
  458. message ListImportJobsRequest {
  459. // Required. The resource name of the [KeyRing][google.cloud.kms.v1.KeyRing]
  460. // to list, in the format `projects/*/locations/*/keyRings/*`.
  461. string parent = 1 [
  462. (google.api.field_behavior) = REQUIRED,
  463. (google.api.resource_reference) = {
  464. type: "cloudkms.googleapis.com/KeyRing"
  465. }
  466. ];
  467. // Optional. Optional limit on the number of
  468. // [ImportJobs][google.cloud.kms.v1.ImportJob] to include in the response.
  469. // Further [ImportJobs][google.cloud.kms.v1.ImportJob] can subsequently be
  470. // obtained by including the
  471. // [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token]
  472. // in a subsequent request. If unspecified, the server will pick an
  473. // appropriate default.
  474. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  475. // Optional. Optional pagination token, returned earlier via
  476. // [ListImportJobsResponse.next_page_token][google.cloud.kms.v1.ListImportJobsResponse.next_page_token].
  477. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  478. // Optional. Only include resources that match the filter in the response. For
  479. // more information, see
  480. // [Sorting and filtering list
  481. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  482. string filter = 4 [(google.api.field_behavior) = OPTIONAL];
  483. // Optional. Specify how the results should be sorted. If not specified, the
  484. // results will be sorted in the default order. For more information, see
  485. // [Sorting and filtering list
  486. // results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  487. string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
  488. }
  489. // Response message for
  490. // [KeyManagementService.ListKeyRings][google.cloud.kms.v1.KeyManagementService.ListKeyRings].
  491. message ListKeyRingsResponse {
  492. // The list of [KeyRings][google.cloud.kms.v1.KeyRing].
  493. repeated KeyRing key_rings = 1;
  494. // A token to retrieve next page of results. Pass this value in
  495. // [ListKeyRingsRequest.page_token][google.cloud.kms.v1.ListKeyRingsRequest.page_token]
  496. // to retrieve the next page of results.
  497. string next_page_token = 2;
  498. // The total number of [KeyRings][google.cloud.kms.v1.KeyRing] that matched
  499. // the query.
  500. int32 total_size = 3;
  501. }
  502. // Response message for
  503. // [KeyManagementService.ListCryptoKeys][google.cloud.kms.v1.KeyManagementService.ListCryptoKeys].
  504. message ListCryptoKeysResponse {
  505. // The list of [CryptoKeys][google.cloud.kms.v1.CryptoKey].
  506. repeated CryptoKey crypto_keys = 1;
  507. // A token to retrieve next page of results. Pass this value in
  508. // [ListCryptoKeysRequest.page_token][google.cloud.kms.v1.ListCryptoKeysRequest.page_token]
  509. // to retrieve the next page of results.
  510. string next_page_token = 2;
  511. // The total number of [CryptoKeys][google.cloud.kms.v1.CryptoKey] that
  512. // matched the query.
  513. int32 total_size = 3;
  514. }
  515. // Response message for
  516. // [KeyManagementService.ListCryptoKeyVersions][google.cloud.kms.v1.KeyManagementService.ListCryptoKeyVersions].
  517. message ListCryptoKeyVersionsResponse {
  518. // The list of [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
  519. repeated CryptoKeyVersion crypto_key_versions = 1;
  520. // A token to retrieve next page of results. Pass this value in
  521. // [ListCryptoKeyVersionsRequest.page_token][google.cloud.kms.v1.ListCryptoKeyVersionsRequest.page_token]
  522. // to retrieve the next page of results.
  523. string next_page_token = 2;
  524. // The total number of
  525. // [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] that matched the
  526. // query.
  527. int32 total_size = 3;
  528. }
  529. // Response message for
  530. // [KeyManagementService.ListImportJobs][google.cloud.kms.v1.KeyManagementService.ListImportJobs].
  531. message ListImportJobsResponse {
  532. // The list of [ImportJobs][google.cloud.kms.v1.ImportJob].
  533. repeated ImportJob import_jobs = 1;
  534. // A token to retrieve next page of results. Pass this value in
  535. // [ListImportJobsRequest.page_token][google.cloud.kms.v1.ListImportJobsRequest.page_token]
  536. // to retrieve the next page of results.
  537. string next_page_token = 2;
  538. // The total number of [ImportJobs][google.cloud.kms.v1.ImportJob] that
  539. // matched the query.
  540. int32 total_size = 3;
  541. }
  542. // Request message for
  543. // [KeyManagementService.GetKeyRing][google.cloud.kms.v1.KeyManagementService.GetKeyRing].
  544. message GetKeyRingRequest {
  545. // Required. The [name][google.cloud.kms.v1.KeyRing.name] of the
  546. // [KeyRing][google.cloud.kms.v1.KeyRing] to get.
  547. string name = 1 [
  548. (google.api.field_behavior) = REQUIRED,
  549. (google.api.resource_reference) = {
  550. type: "cloudkms.googleapis.com/KeyRing"
  551. }
  552. ];
  553. }
  554. // Request message for
  555. // [KeyManagementService.GetCryptoKey][google.cloud.kms.v1.KeyManagementService.GetCryptoKey].
  556. message GetCryptoKeyRequest {
  557. // Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the
  558. // [CryptoKey][google.cloud.kms.v1.CryptoKey] to get.
  559. string name = 1 [
  560. (google.api.field_behavior) = REQUIRED,
  561. (google.api.resource_reference) = {
  562. type: "cloudkms.googleapis.com/CryptoKey"
  563. }
  564. ];
  565. }
  566. // Request message for
  567. // [KeyManagementService.GetCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.GetCryptoKeyVersion].
  568. message GetCryptoKeyVersionRequest {
  569. // Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
  570. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to get.
  571. string name = 1 [
  572. (google.api.field_behavior) = REQUIRED,
  573. (google.api.resource_reference) = {
  574. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  575. }
  576. ];
  577. }
  578. // Request message for
  579. // [KeyManagementService.GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
  580. message GetPublicKeyRequest {
  581. // Required. The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
  582. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key to get.
  583. string name = 1 [
  584. (google.api.field_behavior) = REQUIRED,
  585. (google.api.resource_reference) = {
  586. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  587. }
  588. ];
  589. }
  590. // Request message for
  591. // [KeyManagementService.GetImportJob][google.cloud.kms.v1.KeyManagementService.GetImportJob].
  592. message GetImportJobRequest {
  593. // Required. The [name][google.cloud.kms.v1.ImportJob.name] of the
  594. // [ImportJob][google.cloud.kms.v1.ImportJob] to get.
  595. string name = 1 [
  596. (google.api.field_behavior) = REQUIRED,
  597. (google.api.resource_reference) = {
  598. type: "cloudkms.googleapis.com/ImportJob"
  599. }
  600. ];
  601. }
  602. // Request message for
  603. // [KeyManagementService.CreateKeyRing][google.cloud.kms.v1.KeyManagementService.CreateKeyRing].
  604. message CreateKeyRingRequest {
  605. // Required. The resource name of the location associated with the
  606. // [KeyRings][google.cloud.kms.v1.KeyRing], in the format
  607. // `projects/*/locations/*`.
  608. string parent = 1 [
  609. (google.api.field_behavior) = REQUIRED,
  610. (google.api.resource_reference) = {
  611. type: "locations.googleapis.com/Location"
  612. }
  613. ];
  614. // Required. It must be unique within a location and match the regular
  615. // expression `[a-zA-Z0-9_-]{1,63}`
  616. string key_ring_id = 2 [(google.api.field_behavior) = REQUIRED];
  617. // Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field
  618. // values.
  619. KeyRing key_ring = 3 [(google.api.field_behavior) = REQUIRED];
  620. }
  621. // Request message for
  622. // [KeyManagementService.CreateCryptoKey][google.cloud.kms.v1.KeyManagementService.CreateCryptoKey].
  623. message CreateCryptoKeyRequest {
  624. // Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing
  625. // associated with the [CryptoKeys][google.cloud.kms.v1.CryptoKey].
  626. string parent = 1 [
  627. (google.api.field_behavior) = REQUIRED,
  628. (google.api.resource_reference) = {
  629. type: "cloudkms.googleapis.com/KeyRing"
  630. }
  631. ];
  632. // Required. It must be unique within a KeyRing and match the regular
  633. // expression `[a-zA-Z0-9_-]{1,63}`
  634. string crypto_key_id = 2 [(google.api.field_behavior) = REQUIRED];
  635. // Required. A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field
  636. // values.
  637. CryptoKey crypto_key = 3 [(google.api.field_behavior) = REQUIRED];
  638. // If set to true, the request will create a
  639. // [CryptoKey][google.cloud.kms.v1.CryptoKey] without any
  640. // [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. You must
  641. // manually call
  642. // [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion]
  643. // or
  644. // [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion]
  645. // before you can use this [CryptoKey][google.cloud.kms.v1.CryptoKey].
  646. bool skip_initial_version_creation = 5;
  647. }
  648. // Request message for
  649. // [KeyManagementService.CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion].
  650. message CreateCryptoKeyVersionRequest {
  651. // Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the
  652. // [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with the
  653. // [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
  654. string parent = 1 [
  655. (google.api.field_behavior) = REQUIRED,
  656. (google.api.resource_reference) = {
  657. type: "cloudkms.googleapis.com/CryptoKey"
  658. }
  659. ];
  660. // Required. A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
  661. // initial field values.
  662. CryptoKeyVersion crypto_key_version = 2
  663. [(google.api.field_behavior) = REQUIRED];
  664. }
  665. // Request message for
  666. // [KeyManagementService.ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion].
  667. message ImportCryptoKeyVersionRequest {
  668. // Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the
  669. // [CryptoKey][google.cloud.kms.v1.CryptoKey] to be imported into.
  670. //
  671. // The create permission is only required on this key when creating a new
  672. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
  673. string parent = 1 [
  674. (google.api.field_behavior) = REQUIRED,
  675. (google.api.resource_reference) = {
  676. type: "cloudkms.googleapis.com/CryptoKey"
  677. }
  678. ];
  679. // Optional. The optional [name][google.cloud.kms.v1.CryptoKeyVersion.name] of
  680. // an existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to
  681. // target for an import operation. If this field is not present, a new
  682. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] containing the
  683. // supplied key material is created.
  684. //
  685. // If this field is present, the supplied key material is imported into
  686. // the existing [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. To
  687. // import into an existing
  688. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], the
  689. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] must be a child of
  690. // [ImportCryptoKeyVersionRequest.parent][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.parent],
  691. // have been previously created via [ImportCryptoKeyVersion][], and be in
  692. // [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]
  693. // or
  694. // [IMPORT_FAILED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.IMPORT_FAILED]
  695. // state. The key material and algorithm must match the previous
  696. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] exactly if the
  697. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] has ever contained
  698. // key material.
  699. string crypto_key_version = 6 [
  700. (google.api.field_behavior) = OPTIONAL,
  701. (google.api.resource_reference) = {
  702. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  703. }
  704. ];
  705. // Required. The
  706. // [algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
  707. // of the key being imported. This does not need to match the
  708. // [version_template][google.cloud.kms.v1.CryptoKey.version_template] of the
  709. // [CryptoKey][google.cloud.kms.v1.CryptoKey] this version imports into.
  710. CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2
  711. [(google.api.field_behavior) = REQUIRED];
  712. // Required. The [name][google.cloud.kms.v1.ImportJob.name] of the
  713. // [ImportJob][google.cloud.kms.v1.ImportJob] that was used to wrap this key
  714. // material.
  715. string import_job = 4 [(google.api.field_behavior) = REQUIRED];
  716. // Optional. The wrapped key material to import.
  717. //
  718. // Before wrapping, key material must be formatted. If importing symmetric key
  719. // material, the expected key material format is plain bytes. If importing
  720. // asymmetric key material, the expected key material format is PKCS#8-encoded
  721. // DER (the PrivateKeyInfo structure from RFC 5208).
  722. //
  723. // When wrapping with import methods
  724. // ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256]
  725. // or
  726. // [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256]
  727. // or
  728. // [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256]
  729. // or
  730. // [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]),
  731. //
  732. // this field must contain the concatenation of:
  733. // <ol>
  734. // <li>An ephemeral AES-256 wrapping key wrapped with the
  735. // [public_key][google.cloud.kms.v1.ImportJob.public_key] using
  736. // RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty
  737. // label.
  738. // </li>
  739. // <li>The formatted key to be imported, wrapped with the ephemeral AES-256
  740. // key using AES-KWP (RFC 5649).
  741. // </li>
  742. // </ol>
  743. //
  744. // This format is the same as the format produced by PKCS#11 mechanism
  745. // CKM_RSA_AES_KEY_WRAP.
  746. //
  747. // When wrapping with import methods
  748. // ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256]
  749. // or
  750. // [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]),
  751. //
  752. // this field must contain the formatted key to be imported, wrapped with the
  753. // [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP
  754. // with SHA-256, MGF1 with SHA-256, and an empty label.
  755. bytes wrapped_key = 8 [(google.api.field_behavior) = OPTIONAL];
  756. // This field is legacy. Use the field
  757. // [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]
  758. // instead.
  759. oneof wrapped_key_material {
  760. // Optional. This field has the same meaning as
  761. // [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key].
  762. // Prefer to use that field in new work. Either that field or this field
  763. // (but not both) must be specified.
  764. bytes rsa_aes_wrapped_key = 5 [(google.api.field_behavior) = OPTIONAL];
  765. }
  766. }
  767. // Request message for
  768. // [KeyManagementService.CreateImportJob][google.cloud.kms.v1.KeyManagementService.CreateImportJob].
  769. message CreateImportJobRequest {
  770. // Required. The [name][google.cloud.kms.v1.KeyRing.name] of the
  771. // [KeyRing][google.cloud.kms.v1.KeyRing] associated with the
  772. // [ImportJobs][google.cloud.kms.v1.ImportJob].
  773. string parent = 1 [
  774. (google.api.field_behavior) = REQUIRED,
  775. (google.api.resource_reference) = {
  776. type: "cloudkms.googleapis.com/KeyRing"
  777. }
  778. ];
  779. // Required. It must be unique within a KeyRing and match the regular
  780. // expression `[a-zA-Z0-9_-]{1,63}`
  781. string import_job_id = 2 [(google.api.field_behavior) = REQUIRED];
  782. // Required. An [ImportJob][google.cloud.kms.v1.ImportJob] with initial field
  783. // values.
  784. ImportJob import_job = 3 [(google.api.field_behavior) = REQUIRED];
  785. }
  786. // Request message for
  787. // [KeyManagementService.UpdateCryptoKey][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKey].
  788. message UpdateCryptoKeyRequest {
  789. // Required. [CryptoKey][google.cloud.kms.v1.CryptoKey] with updated values.
  790. CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED];
  791. // Required. List of fields to be updated in this request.
  792. google.protobuf.FieldMask update_mask = 2
  793. [(google.api.field_behavior) = REQUIRED];
  794. }
  795. // Request message for
  796. // [KeyManagementService.UpdateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyVersion].
  797. message UpdateCryptoKeyVersionRequest {
  798. // Required. [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
  799. // updated values.
  800. CryptoKeyVersion crypto_key_version = 1
  801. [(google.api.field_behavior) = REQUIRED];
  802. // Required. List of fields to be updated in this request.
  803. google.protobuf.FieldMask update_mask = 2
  804. [(google.api.field_behavior) = REQUIRED];
  805. }
  806. // Request message for
  807. // [KeyManagementService.UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion].
  808. message UpdateCryptoKeyPrimaryVersionRequest {
  809. // Required. The resource name of the
  810. // [CryptoKey][google.cloud.kms.v1.CryptoKey] to update.
  811. string name = 1 [
  812. (google.api.field_behavior) = REQUIRED,
  813. (google.api.resource_reference) = {
  814. type: "cloudkms.googleapis.com/CryptoKey"
  815. }
  816. ];
  817. // Required. The id of the child
  818. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use as primary.
  819. string crypto_key_version_id = 2 [(google.api.field_behavior) = REQUIRED];
  820. }
  821. // Request message for
  822. // [KeyManagementService.DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion].
  823. message DestroyCryptoKeyVersionRequest {
  824. // Required. The resource name of the
  825. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to destroy.
  826. string name = 1 [
  827. (google.api.field_behavior) = REQUIRED,
  828. (google.api.resource_reference) = {
  829. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  830. }
  831. ];
  832. }
  833. // Request message for
  834. // [KeyManagementService.RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion].
  835. message RestoreCryptoKeyVersionRequest {
  836. // Required. The resource name of the
  837. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to restore.
  838. string name = 1 [
  839. (google.api.field_behavior) = REQUIRED,
  840. (google.api.resource_reference) = {
  841. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  842. }
  843. ];
  844. }
  845. // Request message for
  846. // [KeyManagementService.Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
  847. message EncryptRequest {
  848. // Required. The resource name of the
  849. // [CryptoKey][google.cloud.kms.v1.CryptoKey] or
  850. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
  851. // encryption.
  852. //
  853. // If a [CryptoKey][google.cloud.kms.v1.CryptoKey] is specified, the server
  854. // will use its [primary version][google.cloud.kms.v1.CryptoKey.primary].
  855. string name = 1 [
  856. (google.api.field_behavior) = REQUIRED,
  857. (google.api.resource_reference) = { type: "*" }
  858. ];
  859. // Required. The data to encrypt. Must be no larger than 64KiB.
  860. //
  861. // The maximum size depends on the key version's
  862. // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
  863. // For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
  864. // [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
  865. // [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the
  866. // plaintext must be no larger than 64KiB. For
  867. // [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
  868. // the plaintext and additional_authenticated_data fields must be no larger
  869. // than 8KiB.
  870. bytes plaintext = 2 [(google.api.field_behavior) = REQUIRED];
  871. // Optional. Optional data that, if specified, must also be provided during
  872. // decryption through
  873. // [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
  874. //
  875. // The maximum size depends on the key version's
  876. // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
  877. // For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
  878. // [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
  879. // [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the
  880. // AAD must be no larger than 64KiB. For
  881. // [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
  882. // the plaintext and additional_authenticated_data fields must be no larger
  883. // than 8KiB.
  884. bytes additional_authenticated_data = 3
  885. [(google.api.field_behavior) = OPTIONAL];
  886. // Optional. An optional CRC32C checksum of the
  887. // [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
  888. // If specified,
  889. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  890. // verify the integrity of the received
  891. // [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]
  892. // using this checksum.
  893. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  894. // report an error if the checksum verification fails. If you receive a
  895. // checksum error, your client should verify that
  896. // CRC32C([EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext])
  897. // is equal to
  898. // [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c],
  899. // and if so, perform a limited number of retries. A persistent mismatch may
  900. // indicate an issue in your computation of the CRC32C checksum. Note: This
  901. // field is defined as int64 for reasons of compatibility across different
  902. // languages. However, it is a non-negative integer, which will never exceed
  903. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  904. // this type.
  905. google.protobuf.Int64Value plaintext_crc32c = 7
  906. [(google.api.field_behavior) = OPTIONAL];
  907. // Optional. An optional CRC32C checksum of the
  908. // [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
  909. // If specified,
  910. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  911. // verify the integrity of the received
  912. // [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]
  913. // using this checksum.
  914. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  915. // report an error if the checksum verification fails. If you receive a
  916. // checksum error, your client should verify that
  917. // CRC32C([EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data])
  918. // is equal to
  919. // [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c],
  920. // and if so, perform a limited number of retries. A persistent mismatch may
  921. // indicate an issue in your computation of the CRC32C checksum. Note: This
  922. // field is defined as int64 for reasons of compatibility across different
  923. // languages. However, it is a non-negative integer, which will never exceed
  924. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  925. // this type.
  926. google.protobuf.Int64Value additional_authenticated_data_crc32c = 8
  927. [(google.api.field_behavior) = OPTIONAL];
  928. }
  929. // Request message for
  930. // [KeyManagementService.Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt].
  931. message DecryptRequest {
  932. // Required. The resource name of the
  933. // [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. The
  934. // server will choose the appropriate version.
  935. string name = 1 [
  936. (google.api.field_behavior) = REQUIRED,
  937. (google.api.resource_reference) = {
  938. type: "cloudkms.googleapis.com/CryptoKey"
  939. }
  940. ];
  941. // Required. The encrypted data originally returned in
  942. // [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext].
  943. bytes ciphertext = 2 [(google.api.field_behavior) = REQUIRED];
  944. // Optional. Optional data that must match the data originally supplied in
  945. // [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data].
  946. bytes additional_authenticated_data = 3
  947. [(google.api.field_behavior) = OPTIONAL];
  948. // Optional. An optional CRC32C checksum of the
  949. // [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext].
  950. // If specified,
  951. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  952. // verify the integrity of the received
  953. // [DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]
  954. // using this checksum.
  955. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  956. // report an error if the checksum verification fails. If you receive a
  957. // checksum error, your client should verify that
  958. // CRC32C([DecryptRequest.ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext])
  959. // is equal to
  960. // [DecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.DecryptRequest.ciphertext_crc32c],
  961. // and if so, perform a limited number of retries. A persistent mismatch may
  962. // indicate an issue in your computation of the CRC32C checksum. Note: This
  963. // field is defined as int64 for reasons of compatibility across different
  964. // languages. However, it is a non-negative integer, which will never exceed
  965. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  966. // this type.
  967. google.protobuf.Int64Value ciphertext_crc32c = 5
  968. [(google.api.field_behavior) = OPTIONAL];
  969. // Optional. An optional CRC32C checksum of the
  970. // [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data].
  971. // If specified,
  972. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  973. // verify the integrity of the received
  974. // [DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data]
  975. // using this checksum.
  976. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  977. // report an error if the checksum verification fails. If you receive a
  978. // checksum error, your client should verify that
  979. // CRC32C([DecryptRequest.additional_authenticated_data][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data])
  980. // is equal to
  981. // [DecryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.DecryptRequest.additional_authenticated_data_crc32c],
  982. // and if so, perform a limited number of retries. A persistent mismatch may
  983. // indicate an issue in your computation of the CRC32C checksum. Note: This
  984. // field is defined as int64 for reasons of compatibility across different
  985. // languages. However, it is a non-negative integer, which will never exceed
  986. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  987. // this type.
  988. google.protobuf.Int64Value additional_authenticated_data_crc32c = 6
  989. [(google.api.field_behavior) = OPTIONAL];
  990. }
  991. // Request message for
  992. // [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign].
  993. message AsymmetricSignRequest {
  994. // Required. The resource name of the
  995. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
  996. // signing.
  997. string name = 1 [
  998. (google.api.field_behavior) = REQUIRED,
  999. (google.api.resource_reference) = {
  1000. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  1001. }
  1002. ];
  1003. // Optional. The digest of the data to sign. The digest must be produced with
  1004. // the same digest algorithm as specified by the key version's
  1005. // [algorithm][google.cloud.kms.v1.CryptoKeyVersion.algorithm].
  1006. //
  1007. // This field may not be supplied if
  1008. // [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]
  1009. // is supplied.
  1010. Digest digest = 3 [(google.api.field_behavior) = OPTIONAL];
  1011. // Optional. An optional CRC32C checksum of the
  1012. // [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest].
  1013. // If specified,
  1014. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1015. // verify the integrity of the received
  1016. // [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]
  1017. // using this checksum.
  1018. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1019. // report an error if the checksum verification fails. If you receive a
  1020. // checksum error, your client should verify that
  1021. // CRC32C([AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest])
  1022. // is equal to
  1023. // [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c],
  1024. // and if so, perform a limited number of retries. A persistent mismatch may
  1025. // indicate an issue in your computation of the CRC32C checksum. Note: This
  1026. // field is defined as int64 for reasons of compatibility across different
  1027. // languages. However, it is a non-negative integer, which will never exceed
  1028. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1029. // this type.
  1030. google.protobuf.Int64Value digest_crc32c = 4
  1031. [(google.api.field_behavior) = OPTIONAL];
  1032. // Optional. The data to sign.
  1033. // It can't be supplied if
  1034. // [AsymmetricSignRequest.digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]
  1035. // is supplied.
  1036. bytes data = 6 [(google.api.field_behavior) = OPTIONAL];
  1037. // Optional. An optional CRC32C checksum of the
  1038. // [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data].
  1039. // If specified,
  1040. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1041. // verify the integrity of the received
  1042. // [AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data]
  1043. // using this checksum.
  1044. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1045. // report an error if the checksum verification fails. If you receive a
  1046. // checksum error, your client should verify that
  1047. // CRC32C([AsymmetricSignRequest.data][google.cloud.kms.v1.AsymmetricSignRequest.data])
  1048. // is equal to
  1049. // [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c],
  1050. // and if so, perform a limited number of retries. A persistent mismatch may
  1051. // indicate an issue in your computation of the CRC32C checksum. Note: This
  1052. // field is defined as int64 for reasons of compatibility across different
  1053. // languages. However, it is a non-negative integer, which will never exceed
  1054. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1055. // this type.
  1056. google.protobuf.Int64Value data_crc32c = 7
  1057. [(google.api.field_behavior) = OPTIONAL];
  1058. }
  1059. // Request message for
  1060. // [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt].
  1061. message AsymmetricDecryptRequest {
  1062. // Required. The resource name of the
  1063. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
  1064. // decryption.
  1065. string name = 1 [
  1066. (google.api.field_behavior) = REQUIRED,
  1067. (google.api.resource_reference) = {
  1068. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  1069. }
  1070. ];
  1071. // Required. The data encrypted with the named
  1072. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s public key using
  1073. // OAEP.
  1074. bytes ciphertext = 3 [(google.api.field_behavior) = REQUIRED];
  1075. // Optional. An optional CRC32C checksum of the
  1076. // [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext].
  1077. // If specified,
  1078. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1079. // verify the integrity of the received
  1080. // [AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]
  1081. // using this checksum.
  1082. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1083. // report an error if the checksum verification fails. If you receive a
  1084. // checksum error, your client should verify that
  1085. // CRC32C([AsymmetricDecryptRequest.ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext])
  1086. // is equal to
  1087. // [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c],
  1088. // and if so, perform a limited number of retries. A persistent mismatch may
  1089. // indicate an issue in your computation of the CRC32C checksum. Note: This
  1090. // field is defined as int64 for reasons of compatibility across different
  1091. // languages. However, it is a non-negative integer, which will never exceed
  1092. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1093. // this type.
  1094. google.protobuf.Int64Value ciphertext_crc32c = 4
  1095. [(google.api.field_behavior) = OPTIONAL];
  1096. }
  1097. // Request message for
  1098. // [KeyManagementService.MacSign][google.cloud.kms.v1.KeyManagementService.MacSign].
  1099. message MacSignRequest {
  1100. // Required. The resource name of the
  1101. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
  1102. // signing.
  1103. string name = 1 [
  1104. (google.api.field_behavior) = REQUIRED,
  1105. (google.api.resource_reference) = {
  1106. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  1107. }
  1108. ];
  1109. // Required. The data to sign. The MAC tag is computed over this data field
  1110. // based on the specific algorithm.
  1111. bytes data = 2 [(google.api.field_behavior) = REQUIRED];
  1112. // Optional. An optional CRC32C checksum of the
  1113. // [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]. If
  1114. // specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService]
  1115. // will verify the integrity of the received
  1116. // [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] using this
  1117. // checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService]
  1118. // will report an error if the checksum verification fails. If you receive a
  1119. // checksum error, your client should verify that
  1120. // CRC32C([MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data]) is
  1121. // equal to
  1122. // [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c],
  1123. // and if so, perform a limited number of retries. A persistent mismatch may
  1124. // indicate an issue in your computation of the CRC32C checksum. Note: This
  1125. // field is defined as int64 for reasons of compatibility across different
  1126. // languages. However, it is a non-negative integer, which will never exceed
  1127. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1128. // this type.
  1129. google.protobuf.Int64Value data_crc32c = 3
  1130. [(google.api.field_behavior) = OPTIONAL];
  1131. }
  1132. // Request message for
  1133. // [KeyManagementService.MacVerify][google.cloud.kms.v1.KeyManagementService.MacVerify].
  1134. message MacVerifyRequest {
  1135. // Required. The resource name of the
  1136. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] to use for
  1137. // verification.
  1138. string name = 1 [
  1139. (google.api.field_behavior) = REQUIRED,
  1140. (google.api.resource_reference) = {
  1141. type: "cloudkms.googleapis.com/CryptoKeyVersion"
  1142. }
  1143. ];
  1144. // Required. The data used previously as a
  1145. // [MacSignRequest.data][google.cloud.kms.v1.MacSignRequest.data] to generate
  1146. // the MAC tag.
  1147. bytes data = 2 [(google.api.field_behavior) = REQUIRED];
  1148. // Optional. An optional CRC32C checksum of the
  1149. // [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data]. If
  1150. // specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService]
  1151. // will verify the integrity of the received
  1152. // [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] using
  1153. // this checksum.
  1154. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] will
  1155. // report an error if the checksum verification fails. If you receive a
  1156. // checksum error, your client should verify that
  1157. // CRC32C([MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data])
  1158. // is equal to
  1159. // [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c],
  1160. // and if so, perform a limited number of retries. A persistent mismatch may
  1161. // indicate an issue in your computation of the CRC32C checksum. Note: This
  1162. // field is defined as int64 for reasons of compatibility across different
  1163. // languages. However, it is a non-negative integer, which will never exceed
  1164. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1165. // this type.
  1166. google.protobuf.Int64Value data_crc32c = 3
  1167. [(google.api.field_behavior) = OPTIONAL];
  1168. // Required. The signature to verify.
  1169. bytes mac = 4 [(google.api.field_behavior) = REQUIRED];
  1170. // Optional. An optional CRC32C checksum of the
  1171. // [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac]. If
  1172. // specified, [KeyManagementService][google.cloud.kms.v1.KeyManagementService]
  1173. // will verify the integrity of the received
  1174. // [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] using this
  1175. // checksum. [KeyManagementService][google.cloud.kms.v1.KeyManagementService]
  1176. // will report an error if the checksum verification fails. If you receive a
  1177. // checksum error, your client should verify that
  1178. // CRC32C([MacVerifyRequest.tag][]) is equal to
  1179. // [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c],
  1180. // and if so, perform a limited number of retries. A persistent mismatch may
  1181. // indicate an issue in your computation of the CRC32C checksum. Note: This
  1182. // field is defined as int64 for reasons of compatibility across different
  1183. // languages. However, it is a non-negative integer, which will never exceed
  1184. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1185. // this type.
  1186. google.protobuf.Int64Value mac_crc32c = 5
  1187. [(google.api.field_behavior) = OPTIONAL];
  1188. }
  1189. // Request message for
  1190. // [KeyManagementService.GenerateRandomBytes][google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes].
  1191. message GenerateRandomBytesRequest {
  1192. // The project-specific location in which to generate random bytes.
  1193. // For example, "projects/my-project/locations/us-central1".
  1194. string location = 1;
  1195. // The length in bytes of the amount of randomness to retrieve. Minimum 8
  1196. // bytes, maximum 1024 bytes.
  1197. int32 length_bytes = 2;
  1198. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] to use when
  1199. // generating the random data. Currently, only
  1200. // [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] protection level is
  1201. // supported.
  1202. ProtectionLevel protection_level = 3;
  1203. }
  1204. // Response message for
  1205. // [KeyManagementService.Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
  1206. message EncryptResponse {
  1207. // The resource name of the
  1208. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in
  1209. // encryption. Check this field to verify that the intended resource was used
  1210. // for encryption.
  1211. string name = 1;
  1212. // The encrypted data.
  1213. bytes ciphertext = 2;
  1214. // Integrity verification field. A CRC32C checksum of the returned
  1215. // [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext].
  1216. // An integrity check of
  1217. // [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]
  1218. // can be performed by computing the CRC32C checksum of
  1219. // [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]
  1220. // and comparing your results to this field. Discard the response in case of
  1221. // non-matching checksum values, and perform a limited number of retries. A
  1222. // persistent mismatch may indicate an issue in your computation of the CRC32C
  1223. // checksum. Note: This field is defined as int64 for reasons of compatibility
  1224. // across different languages. However, it is a non-negative integer, which
  1225. // will never exceed 2^32-1, and can be safely downconverted to uint32 in
  1226. // languages that support this type.
  1227. google.protobuf.Int64Value ciphertext_crc32c = 4;
  1228. // Integrity verification field. A flag indicating whether
  1229. // [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c]
  1230. // was received by
  1231. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1232. // for the integrity verification of the
  1233. // [plaintext][google.cloud.kms.v1.EncryptRequest.plaintext]. A false value of
  1234. // this field indicates either that
  1235. // [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c]
  1236. // was left unset or that it was not delivered to
  1237. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1238. // set
  1239. // [EncryptRequest.plaintext_crc32c][google.cloud.kms.v1.EncryptRequest.plaintext_crc32c]
  1240. // but this field is still false, discard the response and perform a limited
  1241. // number of retries.
  1242. bool verified_plaintext_crc32c = 5;
  1243. // Integrity verification field. A flag indicating whether
  1244. // [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c]
  1245. // was received by
  1246. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1247. // for the integrity verification of the
  1248. // [AAD][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. A
  1249. // false value of this field indicates either that
  1250. // [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c]
  1251. // was left unset or that it was not delivered to
  1252. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1253. // set
  1254. // [EncryptRequest.additional_authenticated_data_crc32c][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data_crc32c]
  1255. // but this field is still false, discard the response and perform a limited
  1256. // number of retries.
  1257. bool verified_additional_authenticated_data_crc32c = 6;
  1258. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
  1259. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in
  1260. // encryption.
  1261. ProtectionLevel protection_level = 7;
  1262. }
  1263. // Response message for
  1264. // [KeyManagementService.Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt].
  1265. message DecryptResponse {
  1266. // The decrypted data originally supplied in
  1267. // [EncryptRequest.plaintext][google.cloud.kms.v1.EncryptRequest.plaintext].
  1268. bytes plaintext = 1;
  1269. // Integrity verification field. A CRC32C checksum of the returned
  1270. // [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext].
  1271. // An integrity check of
  1272. // [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]
  1273. // can be performed by computing the CRC32C checksum of
  1274. // [DecryptResponse.plaintext][google.cloud.kms.v1.DecryptResponse.plaintext]
  1275. // and comparing your results to this field. Discard the response in case of
  1276. // non-matching checksum values, and perform a limited number of retries. A
  1277. // persistent mismatch may indicate an issue in your computation of the CRC32C
  1278. // checksum. Note: receiving this response message indicates that
  1279. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] is able to
  1280. // successfully decrypt the
  1281. // [ciphertext][google.cloud.kms.v1.DecryptRequest.ciphertext]. Note: This
  1282. // field is defined as int64 for reasons of compatibility across different
  1283. // languages. However, it is a non-negative integer, which will never exceed
  1284. // 2^32-1, and can be safely downconverted to uint32 in languages that support
  1285. // this type.
  1286. google.protobuf.Int64Value plaintext_crc32c = 2;
  1287. // Whether the Decryption was performed using the primary key version.
  1288. bool used_primary = 3;
  1289. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
  1290. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in
  1291. // decryption.
  1292. ProtectionLevel protection_level = 4;
  1293. }
  1294. // Response message for
  1295. // [KeyManagementService.AsymmetricSign][google.cloud.kms.v1.KeyManagementService.AsymmetricSign].
  1296. message AsymmetricSignResponse {
  1297. // The created signature.
  1298. bytes signature = 1;
  1299. // Integrity verification field. A CRC32C checksum of the returned
  1300. // [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature].
  1301. // An integrity check of
  1302. // [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]
  1303. // can be performed by computing the CRC32C checksum of
  1304. // [AsymmetricSignResponse.signature][google.cloud.kms.v1.AsymmetricSignResponse.signature]
  1305. // and comparing your results to this field. Discard the response in case of
  1306. // non-matching checksum values, and perform a limited number of retries. A
  1307. // persistent mismatch may indicate an issue in your computation of the CRC32C
  1308. // checksum. Note: This field is defined as int64 for reasons of compatibility
  1309. // across different languages. However, it is a non-negative integer, which
  1310. // will never exceed 2^32-1, and can be safely downconverted to uint32 in
  1311. // languages that support this type.
  1312. google.protobuf.Int64Value signature_crc32c = 2;
  1313. // Integrity verification field. A flag indicating whether
  1314. // [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c]
  1315. // was received by
  1316. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1317. // for the integrity verification of the
  1318. // [digest][google.cloud.kms.v1.AsymmetricSignRequest.digest]. A false value
  1319. // of this field indicates either that
  1320. // [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c]
  1321. // was left unset or that it was not delivered to
  1322. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1323. // set
  1324. // [AsymmetricSignRequest.digest_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.digest_crc32c]
  1325. // but this field is still false, discard the response and perform a limited
  1326. // number of retries.
  1327. bool verified_digest_crc32c = 3;
  1328. // The resource name of the
  1329. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing.
  1330. // Check this field to verify that the intended resource was used for signing.
  1331. string name = 4;
  1332. // Integrity verification field. A flag indicating whether
  1333. // [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c]
  1334. // was received by
  1335. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1336. // for the integrity verification of the
  1337. // [data][google.cloud.kms.v1.AsymmetricSignRequest.data]. A false value of
  1338. // this field indicates either that
  1339. // [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c]
  1340. // was left unset or that it was not delivered to
  1341. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1342. // set
  1343. // [AsymmetricSignRequest.data_crc32c][google.cloud.kms.v1.AsymmetricSignRequest.data_crc32c]
  1344. // but this field is still false, discard the response and perform a limited
  1345. // number of retries.
  1346. bool verified_data_crc32c = 5;
  1347. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
  1348. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing.
  1349. ProtectionLevel protection_level = 6;
  1350. }
  1351. // Response message for
  1352. // [KeyManagementService.AsymmetricDecrypt][google.cloud.kms.v1.KeyManagementService.AsymmetricDecrypt].
  1353. message AsymmetricDecryptResponse {
  1354. // The decrypted data originally encrypted with the matching public key.
  1355. bytes plaintext = 1;
  1356. // Integrity verification field. A CRC32C checksum of the returned
  1357. // [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext].
  1358. // An integrity check of
  1359. // [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]
  1360. // can be performed by computing the CRC32C checksum of
  1361. // [AsymmetricDecryptResponse.plaintext][google.cloud.kms.v1.AsymmetricDecryptResponse.plaintext]
  1362. // and comparing your results to this field. Discard the response in case of
  1363. // non-matching checksum values, and perform a limited number of retries. A
  1364. // persistent mismatch may indicate an issue in your computation of the CRC32C
  1365. // checksum. Note: This field is defined as int64 for reasons of compatibility
  1366. // across different languages. However, it is a non-negative integer, which
  1367. // will never exceed 2^32-1, and can be safely downconverted to uint32 in
  1368. // languages that support this type.
  1369. google.protobuf.Int64Value plaintext_crc32c = 2;
  1370. // Integrity verification field. A flag indicating whether
  1371. // [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c]
  1372. // was received by
  1373. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1374. // for the integrity verification of the
  1375. // [ciphertext][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext]. A
  1376. // false value of this field indicates either that
  1377. // [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c]
  1378. // was left unset or that it was not delivered to
  1379. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1380. // set
  1381. // [AsymmetricDecryptRequest.ciphertext_crc32c][google.cloud.kms.v1.AsymmetricDecryptRequest.ciphertext_crc32c]
  1382. // but this field is still false, discard the response and perform a limited
  1383. // number of retries.
  1384. bool verified_ciphertext_crc32c = 3;
  1385. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
  1386. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used in
  1387. // decryption.
  1388. ProtectionLevel protection_level = 4;
  1389. }
  1390. // Response message for
  1391. // [KeyManagementService.MacSign][google.cloud.kms.v1.KeyManagementService.MacSign].
  1392. message MacSignResponse {
  1393. // The resource name of the
  1394. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing.
  1395. // Check this field to verify that the intended resource was used for signing.
  1396. string name = 1;
  1397. // The created signature.
  1398. bytes mac = 2;
  1399. // Integrity verification field. A CRC32C checksum of the returned
  1400. // [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac]. An
  1401. // integrity check of
  1402. // [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] can be
  1403. // performed by computing the CRC32C checksum of
  1404. // [MacSignResponse.mac][google.cloud.kms.v1.MacSignResponse.mac] and
  1405. // comparing your results to this field. Discard the response in case of
  1406. // non-matching checksum values, and perform a limited number of retries. A
  1407. // persistent mismatch may indicate an issue in your computation of the CRC32C
  1408. // checksum. Note: This field is defined as int64 for reasons of compatibility
  1409. // across different languages. However, it is a non-negative integer, which
  1410. // will never exceed 2^32-1, and can be safely downconverted to uint32 in
  1411. // languages that support this type.
  1412. google.protobuf.Int64Value mac_crc32c = 3;
  1413. // Integrity verification field. A flag indicating whether
  1414. // [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c]
  1415. // was received by
  1416. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1417. // for the integrity verification of the
  1418. // [data][google.cloud.kms.v1.MacSignRequest.data]. A false value of this
  1419. // field indicates either that
  1420. // [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c]
  1421. // was left unset or that it was not delivered to
  1422. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1423. // set
  1424. // [MacSignRequest.data_crc32c][google.cloud.kms.v1.MacSignRequest.data_crc32c]
  1425. // but this field is still false, discard the response and perform a limited
  1426. // number of retries.
  1427. bool verified_data_crc32c = 4;
  1428. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
  1429. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for signing.
  1430. ProtectionLevel protection_level = 5;
  1431. }
  1432. // Response message for
  1433. // [KeyManagementService.MacVerify][google.cloud.kms.v1.KeyManagementService.MacVerify].
  1434. message MacVerifyResponse {
  1435. // The resource name of the
  1436. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for
  1437. // verification. Check this field to verify that the intended resource was
  1438. // used for verification.
  1439. string name = 1;
  1440. // This field indicates whether or not the verification operation for
  1441. // [MacVerifyRequest.mac][google.cloud.kms.v1.MacVerifyRequest.mac] over
  1442. // [MacVerifyRequest.data][google.cloud.kms.v1.MacVerifyRequest.data] was
  1443. // successful.
  1444. bool success = 2;
  1445. // Integrity verification field. A flag indicating whether
  1446. // [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c]
  1447. // was received by
  1448. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1449. // for the integrity verification of the
  1450. // [data][google.cloud.kms.v1.MacVerifyRequest.data]. A false value of this
  1451. // field indicates either that
  1452. // [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c]
  1453. // was left unset or that it was not delivered to
  1454. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1455. // set
  1456. // [MacVerifyRequest.data_crc32c][google.cloud.kms.v1.MacVerifyRequest.data_crc32c]
  1457. // but this field is still false, discard the response and perform a limited
  1458. // number of retries.
  1459. bool verified_data_crc32c = 3;
  1460. // Integrity verification field. A flag indicating whether
  1461. // [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c]
  1462. // was received by
  1463. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService] and used
  1464. // for the integrity verification of the
  1465. // [data][google.cloud.kms.v1.MacVerifyRequest.mac]. A false value of this
  1466. // field indicates either that
  1467. // [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c]
  1468. // was left unset or that it was not delivered to
  1469. // [KeyManagementService][google.cloud.kms.v1.KeyManagementService]. If you've
  1470. // set
  1471. // [MacVerifyRequest.mac_crc32c][google.cloud.kms.v1.MacVerifyRequest.mac_crc32c]
  1472. // but this field is still false, discard the response and perform a limited
  1473. // number of retries.
  1474. bool verified_mac_crc32c = 4;
  1475. // Integrity verification field. This value is used for the integrity
  1476. // verification of [MacVerifyResponse.success]. If the value of this field
  1477. // contradicts the value of [MacVerifyResponse.success], discard the response
  1478. // and perform a limited number of retries.
  1479. bool verified_success_integrity = 5;
  1480. // The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
  1481. // [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] used for
  1482. // verification.
  1483. ProtectionLevel protection_level = 6;
  1484. }
  1485. // Response message for
  1486. // [KeyManagementService.GenerateRandomBytes][google.cloud.kms.v1.KeyManagementService.GenerateRandomBytes].
  1487. message GenerateRandomBytesResponse {
  1488. // The generated data.
  1489. bytes data = 1;
  1490. // Integrity verification field. A CRC32C checksum of the returned
  1491. // [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data].
  1492. // An integrity check of
  1493. // [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]
  1494. // can be performed by computing the CRC32C checksum of
  1495. // [GenerateRandomBytesResponse.data][google.cloud.kms.v1.GenerateRandomBytesResponse.data]
  1496. // and comparing your results to this field. Discard the response in case of
  1497. // non-matching checksum values, and perform a limited number of retries. A
  1498. // persistent mismatch may indicate an issue in your computation of the CRC32C
  1499. // checksum. Note: This field is defined as int64 for reasons of compatibility
  1500. // across different languages. However, it is a non-negative integer, which
  1501. // will never exceed 2^32-1, and can be safely downconverted to uint32 in
  1502. // languages that support this type.
  1503. google.protobuf.Int64Value data_crc32c = 3;
  1504. }
  1505. // A [Digest][google.cloud.kms.v1.Digest] holds a cryptographic message digest.
  1506. message Digest {
  1507. // Required. The message digest.
  1508. oneof digest {
  1509. // A message digest produced with the SHA-256 algorithm.
  1510. bytes sha256 = 1;
  1511. // A message digest produced with the SHA-384 algorithm.
  1512. bytes sha384 = 2;
  1513. // A message digest produced with the SHA-512 algorithm.
  1514. bytes sha512 = 3;
  1515. }
  1516. }
  1517. // Cloud KMS metadata for the given
  1518. // [google.cloud.location.Location][google.cloud.location.Location].
  1519. message LocationMetadata {
  1520. // Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
  1521. // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
  1522. // [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] can be created in this
  1523. // location.
  1524. bool hsm_available = 1;
  1525. // Indicates whether [CryptoKeys][google.cloud.kms.v1.CryptoKey] with
  1526. // [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
  1527. // [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL] can be created in
  1528. // this location.
  1529. bool ekm_available = 2;
  1530. }