PageRenderTime 35ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/vendor/google/apiclient-services/src/Google/Service/CloudKMS/Resource/ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions.php

https://gitlab.com/efabian/maya
PHP | 222 lines | 64 code | 1 blank | 157 comment | 0 complexity | d7740798a4c1163dae88cb8c325b9ba5 MD5 | raw file
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. /**
  18. * The "cryptoKeyVersions" collection of methods.
  19. * Typical usage is:
  20. * <code>
  21. * $cloudkmsService = new Google_Service_CloudKMS(...);
  22. * $cryptoKeyVersions = $cloudkmsService->cryptoKeyVersions;
  23. * </code>
  24. */
  25. class Google_Service_CloudKMS_Resource_ProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions extends Google_Service_Resource
  26. {
  27. /**
  28. * Decrypts data that was encrypted with a public key retrieved from
  29. * GetPublicKey corresponding to a CryptoKeyVersion with CryptoKey.purpose
  30. * ASYMMETRIC_DECRYPT. (cryptoKeyVersions.asymmetricDecrypt)
  31. *
  32. * @param string $name Required. The resource name of the CryptoKeyVersion to
  33. * use for decryption.
  34. * @param Google_Service_CloudKMS_AsymmetricDecryptRequest $postBody
  35. * @param array $optParams Optional parameters.
  36. * @return Google_Service_CloudKMS_AsymmetricDecryptResponse
  37. */
  38. public function asymmetricDecrypt($name, Google_Service_CloudKMS_AsymmetricDecryptRequest $postBody, $optParams = array())
  39. {
  40. $params = array('name' => $name, 'postBody' => $postBody);
  41. $params = array_merge($params, $optParams);
  42. return $this->call('asymmetricDecrypt', array($params), "Google_Service_CloudKMS_AsymmetricDecryptResponse");
  43. }
  44. /**
  45. * Signs data using a CryptoKeyVersion with CryptoKey.purpose ASYMMETRIC_SIGN,
  46. * producing a signature that can be verified with the public key retrieved from
  47. * GetPublicKey. (cryptoKeyVersions.asymmetricSign)
  48. *
  49. * @param string $name Required. The resource name of the CryptoKeyVersion to
  50. * use for signing.
  51. * @param Google_Service_CloudKMS_AsymmetricSignRequest $postBody
  52. * @param array $optParams Optional parameters.
  53. * @return Google_Service_CloudKMS_AsymmetricSignResponse
  54. */
  55. public function asymmetricSign($name, Google_Service_CloudKMS_AsymmetricSignRequest $postBody, $optParams = array())
  56. {
  57. $params = array('name' => $name, 'postBody' => $postBody);
  58. $params = array_merge($params, $optParams);
  59. return $this->call('asymmetricSign', array($params), "Google_Service_CloudKMS_AsymmetricSignResponse");
  60. }
  61. /**
  62. * Create a new CryptoKeyVersion in a CryptoKey.
  63. *
  64. * The server will assign the next sequential id. If unset, state will be set to
  65. * ENABLED. (cryptoKeyVersions.create)
  66. *
  67. * @param string $parent Required. The name of the CryptoKey associated with the
  68. * CryptoKeyVersions.
  69. * @param Google_Service_CloudKMS_CryptoKeyVersion $postBody
  70. * @param array $optParams Optional parameters.
  71. * @return Google_Service_CloudKMS_CryptoKeyVersion
  72. */
  73. public function create($parent, Google_Service_CloudKMS_CryptoKeyVersion $postBody, $optParams = array())
  74. {
  75. $params = array('parent' => $parent, 'postBody' => $postBody);
  76. $params = array_merge($params, $optParams);
  77. return $this->call('create', array($params), "Google_Service_CloudKMS_CryptoKeyVersion");
  78. }
  79. /**
  80. * Schedule a CryptoKeyVersion for destruction.
  81. *
  82. * Upon calling this method, CryptoKeyVersion.state will be set to
  83. * DESTROY_SCHEDULED and destroy_time will be set to a time 24 hours in the
  84. * future, at which point the state will be changed to DESTROYED, and the key
  85. * material will be irrevocably destroyed.
  86. *
  87. * Before the destroy_time is reached, RestoreCryptoKeyVersion may be called to
  88. * reverse the process. (cryptoKeyVersions.destroy)
  89. *
  90. * @param string $name Required. The resource name of the CryptoKeyVersion to
  91. * destroy.
  92. * @param Google_Service_CloudKMS_DestroyCryptoKeyVersionRequest $postBody
  93. * @param array $optParams Optional parameters.
  94. * @return Google_Service_CloudKMS_CryptoKeyVersion
  95. */
  96. public function destroy($name, Google_Service_CloudKMS_DestroyCryptoKeyVersionRequest $postBody, $optParams = array())
  97. {
  98. $params = array('name' => $name, 'postBody' => $postBody);
  99. $params = array_merge($params, $optParams);
  100. return $this->call('destroy', array($params), "Google_Service_CloudKMS_CryptoKeyVersion");
  101. }
  102. /**
  103. * Returns metadata for a given CryptoKeyVersion. (cryptoKeyVersions.get)
  104. *
  105. * @param string $name Required. The name of the CryptoKeyVersion to get.
  106. * @param array $optParams Optional parameters.
  107. * @return Google_Service_CloudKMS_CryptoKeyVersion
  108. */
  109. public function get($name, $optParams = array())
  110. {
  111. $params = array('name' => $name);
  112. $params = array_merge($params, $optParams);
  113. return $this->call('get', array($params), "Google_Service_CloudKMS_CryptoKeyVersion");
  114. }
  115. /**
  116. * Returns the public key for the given CryptoKeyVersion. The CryptoKey.purpose
  117. * must be ASYMMETRIC_SIGN or ASYMMETRIC_DECRYPT.
  118. * (cryptoKeyVersions.getPublicKey)
  119. *
  120. * @param string $name Required. The name of the CryptoKeyVersion public key to
  121. * get.
  122. * @param array $optParams Optional parameters.
  123. * @return Google_Service_CloudKMS_PublicKey
  124. */
  125. public function getPublicKey($name, $optParams = array())
  126. {
  127. $params = array('name' => $name);
  128. $params = array_merge($params, $optParams);
  129. return $this->call('getPublicKey', array($params), "Google_Service_CloudKMS_PublicKey");
  130. }
  131. /**
  132. * Imports a new CryptoKeyVersion into an existing CryptoKey using the wrapped
  133. * key material provided in the request.
  134. *
  135. * The version ID will be assigned the next sequential id within the CryptoKey.
  136. * (cryptoKeyVersions.import)
  137. *
  138. * @param string $parent Required. The name of the CryptoKey to be imported
  139. * into.
  140. * @param Google_Service_CloudKMS_ImportCryptoKeyVersionRequest $postBody
  141. * @param array $optParams Optional parameters.
  142. * @return Google_Service_CloudKMS_CryptoKeyVersion
  143. */
  144. public function import($parent, Google_Service_CloudKMS_ImportCryptoKeyVersionRequest $postBody, $optParams = array())
  145. {
  146. $params = array('parent' => $parent, 'postBody' => $postBody);
  147. $params = array_merge($params, $optParams);
  148. return $this->call('import', array($params), "Google_Service_CloudKMS_CryptoKeyVersion");
  149. }
  150. /**
  151. * Lists CryptoKeyVersions.
  152. * (cryptoKeyVersions.listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions)
  153. *
  154. * @param string $parent Required. The resource name of the CryptoKey to list,
  155. * in the format `projects/locations/keyRings/cryptoKeys`.
  156. * @param array $optParams Optional parameters.
  157. *
  158. * @opt_param string view The fields to include in the response.
  159. * @opt_param string filter Optional. Only include resources that match the
  160. * filter in the response. For more information, see [Sorting and filtering list
  161. * results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  162. * @opt_param string orderBy Optional. Specify how the results should be sorted.
  163. * If not specified, the results will be sorted in the default order. For more
  164. * information, see [Sorting and filtering list
  165. * results](https://cloud.google.com/kms/docs/sorting-and-filtering).
  166. * @opt_param string pageToken Optional. Optional pagination token, returned
  167. * earlier via ListCryptoKeyVersionsResponse.next_page_token.
  168. * @opt_param int pageSize Optional. Optional limit on the number of
  169. * CryptoKeyVersions to include in the response. Further CryptoKeyVersions can
  170. * subsequently be obtained by including the
  171. * ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If
  172. * unspecified, the server will pick an appropriate default.
  173. * @return Google_Service_CloudKMS_ListCryptoKeyVersionsResponse
  174. */
  175. public function listProjectsLocationsKeyRingsCryptoKeysCryptoKeyVersions($parent, $optParams = array())
  176. {
  177. $params = array('parent' => $parent);
  178. $params = array_merge($params, $optParams);
  179. return $this->call('list', array($params), "Google_Service_CloudKMS_ListCryptoKeyVersionsResponse");
  180. }
  181. /**
  182. * Update a CryptoKeyVersion's metadata.
  183. *
  184. * state may be changed between ENABLED and DISABLED using this method. See
  185. * DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to move between other
  186. * states. (cryptoKeyVersions.patch)
  187. *
  188. * @param string $name Output only. The resource name for this CryptoKeyVersion
  189. * in the format `projects/locations/keyRings/cryptoKeys/cryptoKeyVersions`.
  190. * @param Google_Service_CloudKMS_CryptoKeyVersion $postBody
  191. * @param array $optParams Optional parameters.
  192. *
  193. * @opt_param string updateMask Required. List of fields to be updated in this
  194. * request.
  195. * @return Google_Service_CloudKMS_CryptoKeyVersion
  196. */
  197. public function patch($name, Google_Service_CloudKMS_CryptoKeyVersion $postBody, $optParams = array())
  198. {
  199. $params = array('name' => $name, 'postBody' => $postBody);
  200. $params = array_merge($params, $optParams);
  201. return $this->call('patch', array($params), "Google_Service_CloudKMS_CryptoKeyVersion");
  202. }
  203. /**
  204. * Restore a CryptoKeyVersion in the DESTROY_SCHEDULED state.
  205. *
  206. * Upon restoration of the CryptoKeyVersion, state will be set to DISABLED, and
  207. * destroy_time will be cleared. (cryptoKeyVersions.restore)
  208. *
  209. * @param string $name Required. The resource name of the CryptoKeyVersion to
  210. * restore.
  211. * @param Google_Service_CloudKMS_RestoreCryptoKeyVersionRequest $postBody
  212. * @param array $optParams Optional parameters.
  213. * @return Google_Service_CloudKMS_CryptoKeyVersion
  214. */
  215. public function restore($name, Google_Service_CloudKMS_RestoreCryptoKeyVersionRequest $postBody, $optParams = array())
  216. {
  217. $params = array('name' => $name, 'postBody' => $postBody);
  218. $params = array_merge($params, $optParams);
  219. return $this->call('restore', array($params), "Google_Service_CloudKMS_CryptoKeyVersion");
  220. }
  221. }