api.go 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package kms provides a client for AWS Key Management Service.
  3. package kms
  4. import (
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. )
  9. const opCreateAlias = "CreateAlias"
  10. // CreateAliasRequest generates a request for the CreateAlias operation.
  11. func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) {
  12. op := &request.Operation{
  13. Name: opCreateAlias,
  14. HTTPMethod: "POST",
  15. HTTPPath: "/",
  16. }
  17. if input == nil {
  18. input = &CreateAliasInput{}
  19. }
  20. req = c.newRequest(op, input, output)
  21. output = &CreateAliasOutput{}
  22. req.Data = output
  23. return
  24. }
  25. // Creates a display name for a customer master key. An alias can be used to
  26. // identify a key and should be unique. The console enforces a one-to-one mapping
  27. // between the alias and a key. An alias name can contain only alphanumeric
  28. // characters, forward slashes (/), underscores (_), and dashes (-). An alias
  29. // must start with the word "alias" followed by a forward slash (alias/). An
  30. // alias that begins with "aws" after the forward slash (alias/aws...) is reserved
  31. // by Amazon Web Services (AWS).
  32. //
  33. // To associate an alias with a different key, call UpdateAlias.
  34. //
  35. // Note that you cannot create or update an alias that represents a key in
  36. // another account.
  37. func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) {
  38. req, out := c.CreateAliasRequest(input)
  39. err := req.Send()
  40. return out, err
  41. }
  42. const opCreateGrant = "CreateGrant"
  43. // CreateGrantRequest generates a request for the CreateGrant operation.
  44. func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput) {
  45. op := &request.Operation{
  46. Name: opCreateGrant,
  47. HTTPMethod: "POST",
  48. HTTPPath: "/",
  49. }
  50. if input == nil {
  51. input = &CreateGrantInput{}
  52. }
  53. req = c.newRequest(op, input, output)
  54. output = &CreateGrantOutput{}
  55. req.Data = output
  56. return
  57. }
  58. // Adds a grant to a key to specify who can access the key and under what conditions.
  59. // Grants are alternate permission mechanisms to key policies. For more information
  60. // about grants, see Grants (http://docs.aws.amazon.com/kms/latest/developerguide/grants.html)
  61. // in the developer guide. If a grant is absent, access to the key is evaluated
  62. // based on IAM policies attached to the user. ListGrants RetireGrant RevokeGrant
  63. func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) {
  64. req, out := c.CreateGrantRequest(input)
  65. err := req.Send()
  66. return out, err
  67. }
  68. const opCreateKey = "CreateKey"
  69. // CreateKeyRequest generates a request for the CreateKey operation.
  70. func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) {
  71. op := &request.Operation{
  72. Name: opCreateKey,
  73. HTTPMethod: "POST",
  74. HTTPPath: "/",
  75. }
  76. if input == nil {
  77. input = &CreateKeyInput{}
  78. }
  79. req = c.newRequest(op, input, output)
  80. output = &CreateKeyOutput{}
  81. req.Data = output
  82. return
  83. }
  84. // Creates a customer master key. Customer master keys can be used to encrypt
  85. // small amounts of data (less than 4K) directly, but they are most commonly
  86. // used to encrypt or envelope data keys that are then used to encrypt customer
  87. // data. For more information about data keys, see GenerateDataKey and GenerateDataKeyWithoutPlaintext.
  88. func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) {
  89. req, out := c.CreateKeyRequest(input)
  90. err := req.Send()
  91. return out, err
  92. }
  93. const opDecrypt = "Decrypt"
  94. // DecryptRequest generates a request for the Decrypt operation.
  95. func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput) {
  96. op := &request.Operation{
  97. Name: opDecrypt,
  98. HTTPMethod: "POST",
  99. HTTPPath: "/",
  100. }
  101. if input == nil {
  102. input = &DecryptInput{}
  103. }
  104. req = c.newRequest(op, input, output)
  105. output = &DecryptOutput{}
  106. req.Data = output
  107. return
  108. }
  109. // Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted
  110. // by using any of the following functions: GenerateDataKey GenerateDataKeyWithoutPlaintext
  111. // Encrypt
  112. //
  113. // Note that if a caller has been granted access permissions to all keys (through,
  114. // for example, IAM user policies that grant Decrypt permission on all resources),
  115. // then ciphertext encrypted by using keys in other accounts where the key grants
  116. // access to the caller can be decrypted. To remedy this, we recommend that
  117. // you do not grant Decrypt access in an IAM user policy. Instead grant Decrypt
  118. // access only in key policies. If you must grant Decrypt access in an IAM user
  119. // policy, you should scope the resource to specific keys or to specific trusted
  120. // accounts.
  121. func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) {
  122. req, out := c.DecryptRequest(input)
  123. err := req.Send()
  124. return out, err
  125. }
  126. const opDeleteAlias = "DeleteAlias"
  127. // DeleteAliasRequest generates a request for the DeleteAlias operation.
  128. func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) {
  129. op := &request.Operation{
  130. Name: opDeleteAlias,
  131. HTTPMethod: "POST",
  132. HTTPPath: "/",
  133. }
  134. if input == nil {
  135. input = &DeleteAliasInput{}
  136. }
  137. req = c.newRequest(op, input, output)
  138. output = &DeleteAliasOutput{}
  139. req.Data = output
  140. return
  141. }
  142. // Deletes the specified alias. To associate an alias with a different key,
  143. // call UpdateAlias.
  144. func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) {
  145. req, out := c.DeleteAliasRequest(input)
  146. err := req.Send()
  147. return out, err
  148. }
  149. const opDescribeKey = "DescribeKey"
  150. // DescribeKeyRequest generates a request for the DescribeKey operation.
  151. func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput) {
  152. op := &request.Operation{
  153. Name: opDescribeKey,
  154. HTTPMethod: "POST",
  155. HTTPPath: "/",
  156. }
  157. if input == nil {
  158. input = &DescribeKeyInput{}
  159. }
  160. req = c.newRequest(op, input, output)
  161. output = &DescribeKeyOutput{}
  162. req.Data = output
  163. return
  164. }
  165. // Provides detailed information about the specified customer master key.
  166. func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) {
  167. req, out := c.DescribeKeyRequest(input)
  168. err := req.Send()
  169. return out, err
  170. }
  171. const opDisableKey = "DisableKey"
  172. // DisableKeyRequest generates a request for the DisableKey operation.
  173. func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput) {
  174. op := &request.Operation{
  175. Name: opDisableKey,
  176. HTTPMethod: "POST",
  177. HTTPPath: "/",
  178. }
  179. if input == nil {
  180. input = &DisableKeyInput{}
  181. }
  182. req = c.newRequest(op, input, output)
  183. output = &DisableKeyOutput{}
  184. req.Data = output
  185. return
  186. }
  187. // Marks a key as disabled, thereby preventing its use.
  188. func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) {
  189. req, out := c.DisableKeyRequest(input)
  190. err := req.Send()
  191. return out, err
  192. }
  193. const opDisableKeyRotation = "DisableKeyRotation"
  194. // DisableKeyRotationRequest generates a request for the DisableKeyRotation operation.
  195. func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput) {
  196. op := &request.Operation{
  197. Name: opDisableKeyRotation,
  198. HTTPMethod: "POST",
  199. HTTPPath: "/",
  200. }
  201. if input == nil {
  202. input = &DisableKeyRotationInput{}
  203. }
  204. req = c.newRequest(op, input, output)
  205. output = &DisableKeyRotationOutput{}
  206. req.Data = output
  207. return
  208. }
  209. // Disables rotation of the specified key.
  210. func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) {
  211. req, out := c.DisableKeyRotationRequest(input)
  212. err := req.Send()
  213. return out, err
  214. }
  215. const opEnableKey = "EnableKey"
  216. // EnableKeyRequest generates a request for the EnableKey operation.
  217. func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput) {
  218. op := &request.Operation{
  219. Name: opEnableKey,
  220. HTTPMethod: "POST",
  221. HTTPPath: "/",
  222. }
  223. if input == nil {
  224. input = &EnableKeyInput{}
  225. }
  226. req = c.newRequest(op, input, output)
  227. output = &EnableKeyOutput{}
  228. req.Data = output
  229. return
  230. }
  231. // Marks a key as enabled, thereby permitting its use. You can have up to 25
  232. // enabled keys at one time.
  233. func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) {
  234. req, out := c.EnableKeyRequest(input)
  235. err := req.Send()
  236. return out, err
  237. }
  238. const opEnableKeyRotation = "EnableKeyRotation"
  239. // EnableKeyRotationRequest generates a request for the EnableKeyRotation operation.
  240. func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput) {
  241. op := &request.Operation{
  242. Name: opEnableKeyRotation,
  243. HTTPMethod: "POST",
  244. HTTPPath: "/",
  245. }
  246. if input == nil {
  247. input = &EnableKeyRotationInput{}
  248. }
  249. req = c.newRequest(op, input, output)
  250. output = &EnableKeyRotationOutput{}
  251. req.Data = output
  252. return
  253. }
  254. // Enables rotation of the specified customer master key.
  255. func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) {
  256. req, out := c.EnableKeyRotationRequest(input)
  257. err := req.Send()
  258. return out, err
  259. }
  260. const opEncrypt = "Encrypt"
  261. // EncryptRequest generates a request for the Encrypt operation.
  262. func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput) {
  263. op := &request.Operation{
  264. Name: opEncrypt,
  265. HTTPMethod: "POST",
  266. HTTPPath: "/",
  267. }
  268. if input == nil {
  269. input = &EncryptInput{}
  270. }
  271. req = c.newRequest(op, input, output)
  272. output = &EncryptOutput{}
  273. req.Data = output
  274. return
  275. }
  276. // Encrypts plaintext into ciphertext by using a customer master key. The Encrypt
  277. // function has two primary use cases: You can encrypt up to 4 KB of arbitrary
  278. // data such as an RSA key, a database password, or other sensitive customer
  279. // information. If you are moving encrypted data from one region to another,
  280. // you can use this API to encrypt in the new region the plaintext data key
  281. // that was used to encrypt the data in the original region. This provides you
  282. // with an encrypted copy of the data key that can be decrypted in the new region
  283. // and used there to decrypt the encrypted data.
  284. //
  285. // Unless you are moving encrypted data from one region to another, you don't
  286. // use this function to encrypt a generated data key within a region. You retrieve
  287. // data keys already encrypted by calling the GenerateDataKey or GenerateDataKeyWithoutPlaintext
  288. // function. Data keys don't need to be encrypted again by calling Encrypt.
  289. //
  290. // If you want to encrypt data locally in your application, you can use the
  291. // GenerateDataKey function to return a plaintext data encryption key and a
  292. // copy of the key encrypted under the customer master key (CMK) of your choosing.
  293. func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) {
  294. req, out := c.EncryptRequest(input)
  295. err := req.Send()
  296. return out, err
  297. }
  298. const opGenerateDataKey = "GenerateDataKey"
  299. // GenerateDataKeyRequest generates a request for the GenerateDataKey operation.
  300. func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput) {
  301. op := &request.Operation{
  302. Name: opGenerateDataKey,
  303. HTTPMethod: "POST",
  304. HTTPPath: "/",
  305. }
  306. if input == nil {
  307. input = &GenerateDataKeyInput{}
  308. }
  309. req = c.newRequest(op, input, output)
  310. output = &GenerateDataKeyOutput{}
  311. req.Data = output
  312. return
  313. }
  314. // Generates a data key that you can use in your application to locally encrypt
  315. // data. This call returns a plaintext version of the key in the Plaintext field
  316. // of the response object and an encrypted copy of the key in the CiphertextBlob
  317. // field. The key is encrypted by using the master key specified by the KeyId
  318. // field. To decrypt the encrypted key, pass it to the Decrypt API.
  319. //
  320. // We recommend that you use the following pattern to locally encrypt data:
  321. // call the GenerateDataKey API, use the key returned in the Plaintext response
  322. // field to locally encrypt data, and then erase the plaintext data key from
  323. // memory. Store the encrypted data key (contained in the CiphertextBlob field)
  324. // alongside of the locally encrypted data.
  325. //
  326. // You should not call the Encrypt function to re-encrypt your data keys within
  327. // a region. GenerateDataKey always returns the data key encrypted and tied
  328. // to the customer master key that will be used to decrypt it. There is no need
  329. // to decrypt it twice. If you decide to use the optional EncryptionContext
  330. // parameter, you must also store the context in full or at least store enough
  331. // information along with the encrypted data to be able to reconstruct the context
  332. // when submitting the ciphertext to the Decrypt API. It is a good practice
  333. // to choose a context that you can reconstruct on the fly to better secure
  334. // the ciphertext. For more information about how this parameter is used, see
  335. // Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
  336. //
  337. // To decrypt data, pass the encrypted data key to the Decrypt API. Decrypt
  338. // uses the associated master key to decrypt the encrypted data key and returns
  339. // it as plaintext. Use the plaintext data key to locally decrypt your data
  340. // and then erase the key from memory. You must specify the encryption context,
  341. // if any, that you specified when you generated the key. The encryption context
  342. // is logged by CloudTrail, and you can use this log to help track the use of
  343. // particular data.
  344. func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) {
  345. req, out := c.GenerateDataKeyRequest(input)
  346. err := req.Send()
  347. return out, err
  348. }
  349. const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext"
  350. // GenerateDataKeyWithoutPlaintextRequest generates a request for the GenerateDataKeyWithoutPlaintext operation.
  351. func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) {
  352. op := &request.Operation{
  353. Name: opGenerateDataKeyWithoutPlaintext,
  354. HTTPMethod: "POST",
  355. HTTPPath: "/",
  356. }
  357. if input == nil {
  358. input = &GenerateDataKeyWithoutPlaintextInput{}
  359. }
  360. req = c.newRequest(op, input, output)
  361. output = &GenerateDataKeyWithoutPlaintextOutput{}
  362. req.Data = output
  363. return
  364. }
  365. // Returns a data key encrypted by a customer master key without the plaintext
  366. // copy of that key. Otherwise, this API functions exactly like GenerateDataKey.
  367. // You can use this API to, for example, satisfy an audit requirement that an
  368. // encrypted key be made available without exposing the plaintext copy of that
  369. // key.
  370. func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) {
  371. req, out := c.GenerateDataKeyWithoutPlaintextRequest(input)
  372. err := req.Send()
  373. return out, err
  374. }
  375. const opGenerateRandom = "GenerateRandom"
  376. // GenerateRandomRequest generates a request for the GenerateRandom operation.
  377. func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) {
  378. op := &request.Operation{
  379. Name: opGenerateRandom,
  380. HTTPMethod: "POST",
  381. HTTPPath: "/",
  382. }
  383. if input == nil {
  384. input = &GenerateRandomInput{}
  385. }
  386. req = c.newRequest(op, input, output)
  387. output = &GenerateRandomOutput{}
  388. req.Data = output
  389. return
  390. }
  391. // Generates an unpredictable byte string.
  392. func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) {
  393. req, out := c.GenerateRandomRequest(input)
  394. err := req.Send()
  395. return out, err
  396. }
  397. const opGetKeyPolicy = "GetKeyPolicy"
  398. // GetKeyPolicyRequest generates a request for the GetKeyPolicy operation.
  399. func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) {
  400. op := &request.Operation{
  401. Name: opGetKeyPolicy,
  402. HTTPMethod: "POST",
  403. HTTPPath: "/",
  404. }
  405. if input == nil {
  406. input = &GetKeyPolicyInput{}
  407. }
  408. req = c.newRequest(op, input, output)
  409. output = &GetKeyPolicyOutput{}
  410. req.Data = output
  411. return
  412. }
  413. // Retrieves a policy attached to the specified key.
  414. func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) {
  415. req, out := c.GetKeyPolicyRequest(input)
  416. err := req.Send()
  417. return out, err
  418. }
  419. const opGetKeyRotationStatus = "GetKeyRotationStatus"
  420. // GetKeyRotationStatusRequest generates a request for the GetKeyRotationStatus operation.
  421. func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput) {
  422. op := &request.Operation{
  423. Name: opGetKeyRotationStatus,
  424. HTTPMethod: "POST",
  425. HTTPPath: "/",
  426. }
  427. if input == nil {
  428. input = &GetKeyRotationStatusInput{}
  429. }
  430. req = c.newRequest(op, input, output)
  431. output = &GetKeyRotationStatusOutput{}
  432. req.Data = output
  433. return
  434. }
  435. // Retrieves a Boolean value that indicates whether key rotation is enabled
  436. // for the specified key.
  437. func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) {
  438. req, out := c.GetKeyRotationStatusRequest(input)
  439. err := req.Send()
  440. return out, err
  441. }
  442. const opListAliases = "ListAliases"
  443. // ListAliasesRequest generates a request for the ListAliases operation.
  444. func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) {
  445. op := &request.Operation{
  446. Name: opListAliases,
  447. HTTPMethod: "POST",
  448. HTTPPath: "/",
  449. Paginator: &request.Paginator{
  450. InputTokens: []string{"Marker"},
  451. OutputTokens: []string{"NextMarker"},
  452. LimitToken: "Limit",
  453. TruncationToken: "Truncated",
  454. },
  455. }
  456. if input == nil {
  457. input = &ListAliasesInput{}
  458. }
  459. req = c.newRequest(op, input, output)
  460. output = &ListAliasesOutput{}
  461. req.Data = output
  462. return
  463. }
  464. // Lists all of the key aliases in the account.
  465. func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) {
  466. req, out := c.ListAliasesRequest(input)
  467. err := req.Send()
  468. return out, err
  469. }
  470. func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(p *ListAliasesOutput, lastPage bool) (shouldContinue bool)) error {
  471. page, _ := c.ListAliasesRequest(input)
  472. return page.EachPage(func(p interface{}, lastPage bool) bool {
  473. return fn(p.(*ListAliasesOutput), lastPage)
  474. })
  475. }
  476. const opListGrants = "ListGrants"
  477. // ListGrantsRequest generates a request for the ListGrants operation.
  478. func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsOutput) {
  479. op := &request.Operation{
  480. Name: opListGrants,
  481. HTTPMethod: "POST",
  482. HTTPPath: "/",
  483. Paginator: &request.Paginator{
  484. InputTokens: []string{"Marker"},
  485. OutputTokens: []string{"NextMarker"},
  486. LimitToken: "Limit",
  487. TruncationToken: "Truncated",
  488. },
  489. }
  490. if input == nil {
  491. input = &ListGrantsInput{}
  492. }
  493. req = c.newRequest(op, input, output)
  494. output = &ListGrantsOutput{}
  495. req.Data = output
  496. return
  497. }
  498. // List the grants for a specified key.
  499. func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsOutput, error) {
  500. req, out := c.ListGrantsRequest(input)
  501. err := req.Send()
  502. return out, err
  503. }
  504. func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(p *ListGrantsOutput, lastPage bool) (shouldContinue bool)) error {
  505. page, _ := c.ListGrantsRequest(input)
  506. return page.EachPage(func(p interface{}, lastPage bool) bool {
  507. return fn(p.(*ListGrantsOutput), lastPage)
  508. })
  509. }
  510. const opListKeyPolicies = "ListKeyPolicies"
  511. // ListKeyPoliciesRequest generates a request for the ListKeyPolicies operation.
  512. func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput) {
  513. op := &request.Operation{
  514. Name: opListKeyPolicies,
  515. HTTPMethod: "POST",
  516. HTTPPath: "/",
  517. Paginator: &request.Paginator{
  518. InputTokens: []string{"Marker"},
  519. OutputTokens: []string{"NextMarker"},
  520. LimitToken: "Limit",
  521. TruncationToken: "Truncated",
  522. },
  523. }
  524. if input == nil {
  525. input = &ListKeyPoliciesInput{}
  526. }
  527. req = c.newRequest(op, input, output)
  528. output = &ListKeyPoliciesOutput{}
  529. req.Data = output
  530. return
  531. }
  532. // Retrieves a list of policies attached to a key.
  533. func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) {
  534. req, out := c.ListKeyPoliciesRequest(input)
  535. err := req.Send()
  536. return out, err
  537. }
  538. func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(p *ListKeyPoliciesOutput, lastPage bool) (shouldContinue bool)) error {
  539. page, _ := c.ListKeyPoliciesRequest(input)
  540. return page.EachPage(func(p interface{}, lastPage bool) bool {
  541. return fn(p.(*ListKeyPoliciesOutput), lastPage)
  542. })
  543. }
  544. const opListKeys = "ListKeys"
  545. // ListKeysRequest generates a request for the ListKeys operation.
  546. func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) {
  547. op := &request.Operation{
  548. Name: opListKeys,
  549. HTTPMethod: "POST",
  550. HTTPPath: "/",
  551. Paginator: &request.Paginator{
  552. InputTokens: []string{"Marker"},
  553. OutputTokens: []string{"NextMarker"},
  554. LimitToken: "Limit",
  555. TruncationToken: "Truncated",
  556. },
  557. }
  558. if input == nil {
  559. input = &ListKeysInput{}
  560. }
  561. req = c.newRequest(op, input, output)
  562. output = &ListKeysOutput{}
  563. req.Data = output
  564. return
  565. }
  566. // Lists the customer master keys.
  567. func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) {
  568. req, out := c.ListKeysRequest(input)
  569. err := req.Send()
  570. return out, err
  571. }
  572. func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(p *ListKeysOutput, lastPage bool) (shouldContinue bool)) error {
  573. page, _ := c.ListKeysRequest(input)
  574. return page.EachPage(func(p interface{}, lastPage bool) bool {
  575. return fn(p.(*ListKeysOutput), lastPage)
  576. })
  577. }
  578. const opPutKeyPolicy = "PutKeyPolicy"
  579. // PutKeyPolicyRequest generates a request for the PutKeyPolicy operation.
  580. func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput) {
  581. op := &request.Operation{
  582. Name: opPutKeyPolicy,
  583. HTTPMethod: "POST",
  584. HTTPPath: "/",
  585. }
  586. if input == nil {
  587. input = &PutKeyPolicyInput{}
  588. }
  589. req = c.newRequest(op, input, output)
  590. output = &PutKeyPolicyOutput{}
  591. req.Data = output
  592. return
  593. }
  594. // Attaches a policy to the specified key.
  595. func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) {
  596. req, out := c.PutKeyPolicyRequest(input)
  597. err := req.Send()
  598. return out, err
  599. }
  600. const opReEncrypt = "ReEncrypt"
  601. // ReEncryptRequest generates a request for the ReEncrypt operation.
  602. func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput) {
  603. op := &request.Operation{
  604. Name: opReEncrypt,
  605. HTTPMethod: "POST",
  606. HTTPPath: "/",
  607. }
  608. if input == nil {
  609. input = &ReEncryptInput{}
  610. }
  611. req = c.newRequest(op, input, output)
  612. output = &ReEncryptOutput{}
  613. req.Data = output
  614. return
  615. }
  616. // Encrypts data on the server side with a new customer master key without exposing
  617. // the plaintext of the data on the client side. The data is first decrypted
  618. // and then encrypted. This operation can also be used to change the encryption
  619. // context of a ciphertext.
  620. //
  621. // Unlike other actions, ReEncrypt is authorized twice - once as ReEncryptFrom
  622. // on the source key and once as ReEncryptTo on the destination key. We therefore
  623. // recommend that you include the "action":"kms:ReEncrypt*" statement in your
  624. // key policies to permit re-encryption from or to the key. The statement is
  625. // included automatically when you authorize use of the key through the console
  626. // but must be included manually when you set a policy by using the PutKeyPolicy
  627. // function.
  628. func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) {
  629. req, out := c.ReEncryptRequest(input)
  630. err := req.Send()
  631. return out, err
  632. }
  633. const opRetireGrant = "RetireGrant"
  634. // RetireGrantRequest generates a request for the RetireGrant operation.
  635. func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput) {
  636. op := &request.Operation{
  637. Name: opRetireGrant,
  638. HTTPMethod: "POST",
  639. HTTPPath: "/",
  640. }
  641. if input == nil {
  642. input = &RetireGrantInput{}
  643. }
  644. req = c.newRequest(op, input, output)
  645. output = &RetireGrantOutput{}
  646. req.Data = output
  647. return
  648. }
  649. // Retires a grant. You can retire a grant when you're done using it to clean
  650. // up. You should revoke a grant when you intend to actively deny operations
  651. // that depend on it. The following are permitted to call this API: The account
  652. // that created the grant The RetiringPrincipal, if present The GranteePrincipal,
  653. // if RetireGrant is a grantee operation The grant to retire must be identified
  654. // by its grant token or by a combination of the key ARN and the grant ID. A
  655. // grant token is a unique variable-length base64-encoded string. A grant ID
  656. // is a 64 character unique identifier of a grant. Both are returned by the
  657. // CreateGrant function.
  658. func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) {
  659. req, out := c.RetireGrantRequest(input)
  660. err := req.Send()
  661. return out, err
  662. }
  663. const opRevokeGrant = "RevokeGrant"
  664. // RevokeGrantRequest generates a request for the RevokeGrant operation.
  665. func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput) {
  666. op := &request.Operation{
  667. Name: opRevokeGrant,
  668. HTTPMethod: "POST",
  669. HTTPPath: "/",
  670. }
  671. if input == nil {
  672. input = &RevokeGrantInput{}
  673. }
  674. req = c.newRequest(op, input, output)
  675. output = &RevokeGrantOutput{}
  676. req.Data = output
  677. return
  678. }
  679. // Revokes a grant. You can revoke a grant to actively deny operations that
  680. // depend on it.
  681. func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) {
  682. req, out := c.RevokeGrantRequest(input)
  683. err := req.Send()
  684. return out, err
  685. }
  686. const opUpdateAlias = "UpdateAlias"
  687. // UpdateAliasRequest generates a request for the UpdateAlias operation.
  688. func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) {
  689. op := &request.Operation{
  690. Name: opUpdateAlias,
  691. HTTPMethod: "POST",
  692. HTTPPath: "/",
  693. }
  694. if input == nil {
  695. input = &UpdateAliasInput{}
  696. }
  697. req = c.newRequest(op, input, output)
  698. output = &UpdateAliasOutput{}
  699. req.Data = output
  700. return
  701. }
  702. // Updates an alias to associate it with a different key.
  703. //
  704. // An alias name can contain only alphanumeric characters, forward slashes
  705. // (/), underscores (_), and dashes (-). An alias must start with the word "alias"
  706. // followed by a forward slash (alias/). An alias that begins with "aws" after
  707. // the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).
  708. //
  709. // An alias is not a property of a key. Therefore, an alias can be associated
  710. // with and disassociated from an existing key without changing the properties
  711. // of the key.
  712. //
  713. // Note that you cannot create or update an alias that represents a key in
  714. // another account.
  715. func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) {
  716. req, out := c.UpdateAliasRequest(input)
  717. err := req.Send()
  718. return out, err
  719. }
  720. const opUpdateKeyDescription = "UpdateKeyDescription"
  721. // UpdateKeyDescriptionRequest generates a request for the UpdateKeyDescription operation.
  722. func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput) {
  723. op := &request.Operation{
  724. Name: opUpdateKeyDescription,
  725. HTTPMethod: "POST",
  726. HTTPPath: "/",
  727. }
  728. if input == nil {
  729. input = &UpdateKeyDescriptionInput{}
  730. }
  731. req = c.newRequest(op, input, output)
  732. output = &UpdateKeyDescriptionOutput{}
  733. req.Data = output
  734. return
  735. }
  736. // Updates the description of a key.
  737. func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) {
  738. req, out := c.UpdateKeyDescriptionRequest(input)
  739. err := req.Send()
  740. return out, err
  741. }
  742. // Contains information about an alias.
  743. type AliasListEntry struct {
  744. // String that contains the key ARN.
  745. AliasArn *string `type:"string"`
  746. // String that contains the alias.
  747. AliasName *string `type:"string"`
  748. // String that contains the key identifier pointed to by the alias.
  749. TargetKeyId *string `type:"string"`
  750. metadataAliasListEntry `json:"-" xml:"-"`
  751. }
  752. type metadataAliasListEntry struct {
  753. SDKShapeTraits bool `type:"structure"`
  754. }
  755. // String returns the string representation
  756. func (s AliasListEntry) String() string {
  757. return awsutil.Prettify(s)
  758. }
  759. // GoString returns the string representation
  760. func (s AliasListEntry) GoString() string {
  761. return s.String()
  762. }
  763. type CreateAliasInput struct {
  764. // String that contains the display name. The name must start with the word
  765. // "alias" followed by a forward slash (alias/). Aliases that begin with "alias/AWS"
  766. // are reserved.
  767. AliasName *string `type:"string" required:"true"`
  768. // An identifier of the key for which you are creating the alias. This value
  769. // cannot be another alias but can be a globally unique identifier or a fully
  770. // specified ARN to a key. Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  771. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  772. TargetKeyId *string `type:"string" required:"true"`
  773. metadataCreateAliasInput `json:"-" xml:"-"`
  774. }
  775. type metadataCreateAliasInput struct {
  776. SDKShapeTraits bool `type:"structure"`
  777. }
  778. // String returns the string representation
  779. func (s CreateAliasInput) String() string {
  780. return awsutil.Prettify(s)
  781. }
  782. // GoString returns the string representation
  783. func (s CreateAliasInput) GoString() string {
  784. return s.String()
  785. }
  786. type CreateAliasOutput struct {
  787. metadataCreateAliasOutput `json:"-" xml:"-"`
  788. }
  789. type metadataCreateAliasOutput struct {
  790. SDKShapeTraits bool `type:"structure"`
  791. }
  792. // String returns the string representation
  793. func (s CreateAliasOutput) String() string {
  794. return awsutil.Prettify(s)
  795. }
  796. // GoString returns the string representation
  797. func (s CreateAliasOutput) GoString() string {
  798. return s.String()
  799. }
  800. type CreateGrantInput struct {
  801. // Specifies the conditions under which the actions specified by the Operations
  802. // parameter are allowed.
  803. Constraints *GrantConstraints `type:"structure"`
  804. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  805. GrantTokens []*string `type:"list"`
  806. // Principal given permission by the grant to use the key identified by the
  807. // keyId parameter.
  808. GranteePrincipal *string `type:"string" required:"true"`
  809. // A unique identifier for the customer master key. This value can be a globally
  810. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  811. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  812. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  813. KeyId *string `type:"string" required:"true"`
  814. // List of operations permitted by the grant. This can be any combination of
  815. // one or more of the following values: Decrypt Encrypt GenerateDataKey GenerateDataKeyWithoutPlaintext
  816. // ReEncryptFrom ReEncryptTo CreateGrant RetireGrant
  817. Operations []*string `type:"list"`
  818. // Principal given permission to retire the grant. For more information, see
  819. // RetireGrant.
  820. RetiringPrincipal *string `type:"string"`
  821. metadataCreateGrantInput `json:"-" xml:"-"`
  822. }
  823. type metadataCreateGrantInput struct {
  824. SDKShapeTraits bool `type:"structure"`
  825. }
  826. // String returns the string representation
  827. func (s CreateGrantInput) String() string {
  828. return awsutil.Prettify(s)
  829. }
  830. // GoString returns the string representation
  831. func (s CreateGrantInput) GoString() string {
  832. return s.String()
  833. }
  834. type CreateGrantOutput struct {
  835. // Unique grant identifier. You can use the GrantId value to revoke a grant.
  836. GrantId *string `type:"string"`
  837. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  838. GrantToken *string `type:"string"`
  839. metadataCreateGrantOutput `json:"-" xml:"-"`
  840. }
  841. type metadataCreateGrantOutput struct {
  842. SDKShapeTraits bool `type:"structure"`
  843. }
  844. // String returns the string representation
  845. func (s CreateGrantOutput) String() string {
  846. return awsutil.Prettify(s)
  847. }
  848. // GoString returns the string representation
  849. func (s CreateGrantOutput) GoString() string {
  850. return s.String()
  851. }
  852. type CreateKeyInput struct {
  853. // Description of the key. We recommend that you choose a description that helps
  854. // your customer decide whether the key is appropriate for a task.
  855. Description *string `type:"string"`
  856. // Specifies the intended use of the key. Currently this defaults to ENCRYPT/DECRYPT,
  857. // and only symmetric encryption and decryption are supported.
  858. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  859. // Policy to be attached to the key. This is required and delegates back to
  860. // the account. The key is the root of trust.
  861. Policy *string `type:"string"`
  862. metadataCreateKeyInput `json:"-" xml:"-"`
  863. }
  864. type metadataCreateKeyInput struct {
  865. SDKShapeTraits bool `type:"structure"`
  866. }
  867. // String returns the string representation
  868. func (s CreateKeyInput) String() string {
  869. return awsutil.Prettify(s)
  870. }
  871. // GoString returns the string representation
  872. func (s CreateKeyInput) GoString() string {
  873. return s.String()
  874. }
  875. type CreateKeyOutput struct {
  876. // Metadata associated with the key.
  877. KeyMetadata *KeyMetadata `type:"structure"`
  878. metadataCreateKeyOutput `json:"-" xml:"-"`
  879. }
  880. type metadataCreateKeyOutput struct {
  881. SDKShapeTraits bool `type:"structure"`
  882. }
  883. // String returns the string representation
  884. func (s CreateKeyOutput) String() string {
  885. return awsutil.Prettify(s)
  886. }
  887. // GoString returns the string representation
  888. func (s CreateKeyOutput) GoString() string {
  889. return s.String()
  890. }
  891. type DecryptInput struct {
  892. // Ciphertext to be decrypted. The blob includes metadata.
  893. CiphertextBlob []byte `type:"blob" required:"true"`
  894. // The encryption context. If this was specified in the Encrypt function, it
  895. // must be specified here or the decryption operation will fail. For more information,
  896. // see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
  897. EncryptionContext map[string]*string `type:"map"`
  898. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  899. GrantTokens []*string `type:"list"`
  900. metadataDecryptInput `json:"-" xml:"-"`
  901. }
  902. type metadataDecryptInput struct {
  903. SDKShapeTraits bool `type:"structure"`
  904. }
  905. // String returns the string representation
  906. func (s DecryptInput) String() string {
  907. return awsutil.Prettify(s)
  908. }
  909. // GoString returns the string representation
  910. func (s DecryptInput) GoString() string {
  911. return s.String()
  912. }
  913. type DecryptOutput struct {
  914. // ARN of the key used to perform the decryption. This value is returned if
  915. // no errors are encountered during the operation.
  916. KeyId *string `type:"string"`
  917. // Decrypted plaintext data. This value may not be returned if the customer
  918. // master key is not available or if you didn't have permission to use it.
  919. Plaintext []byte `type:"blob"`
  920. metadataDecryptOutput `json:"-" xml:"-"`
  921. }
  922. type metadataDecryptOutput struct {
  923. SDKShapeTraits bool `type:"structure"`
  924. }
  925. // String returns the string representation
  926. func (s DecryptOutput) String() string {
  927. return awsutil.Prettify(s)
  928. }
  929. // GoString returns the string representation
  930. func (s DecryptOutput) GoString() string {
  931. return s.String()
  932. }
  933. type DeleteAliasInput struct {
  934. // The alias to be deleted. The name must start with the word "alias" followed
  935. // by a forward slash (alias/). Aliases that begin with "alias/AWS" are reserved.
  936. AliasName *string `type:"string" required:"true"`
  937. metadataDeleteAliasInput `json:"-" xml:"-"`
  938. }
  939. type metadataDeleteAliasInput struct {
  940. SDKShapeTraits bool `type:"structure"`
  941. }
  942. // String returns the string representation
  943. func (s DeleteAliasInput) String() string {
  944. return awsutil.Prettify(s)
  945. }
  946. // GoString returns the string representation
  947. func (s DeleteAliasInput) GoString() string {
  948. return s.String()
  949. }
  950. type DeleteAliasOutput struct {
  951. metadataDeleteAliasOutput `json:"-" xml:"-"`
  952. }
  953. type metadataDeleteAliasOutput struct {
  954. SDKShapeTraits bool `type:"structure"`
  955. }
  956. // String returns the string representation
  957. func (s DeleteAliasOutput) String() string {
  958. return awsutil.Prettify(s)
  959. }
  960. // GoString returns the string representation
  961. func (s DeleteAliasOutput) GoString() string {
  962. return s.String()
  963. }
  964. type DescribeKeyInput struct {
  965. // A unique identifier for the customer master key. This value can be a globally
  966. // unique identifier, a fully specified ARN to either an alias or a key, or
  967. // an alias name prefixed by "alias/". Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  968. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  969. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 Alias
  970. // Name Example - alias/MyAliasName
  971. KeyId *string `type:"string" required:"true"`
  972. metadataDescribeKeyInput `json:"-" xml:"-"`
  973. }
  974. type metadataDescribeKeyInput struct {
  975. SDKShapeTraits bool `type:"structure"`
  976. }
  977. // String returns the string representation
  978. func (s DescribeKeyInput) String() string {
  979. return awsutil.Prettify(s)
  980. }
  981. // GoString returns the string representation
  982. func (s DescribeKeyInput) GoString() string {
  983. return s.String()
  984. }
  985. type DescribeKeyOutput struct {
  986. // Metadata associated with the key.
  987. KeyMetadata *KeyMetadata `type:"structure"`
  988. metadataDescribeKeyOutput `json:"-" xml:"-"`
  989. }
  990. type metadataDescribeKeyOutput struct {
  991. SDKShapeTraits bool `type:"structure"`
  992. }
  993. // String returns the string representation
  994. func (s DescribeKeyOutput) String() string {
  995. return awsutil.Prettify(s)
  996. }
  997. // GoString returns the string representation
  998. func (s DescribeKeyOutput) GoString() string {
  999. return s.String()
  1000. }
  1001. type DisableKeyInput struct {
  1002. // A unique identifier for the customer master key. This value can be a globally
  1003. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1004. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1005. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1006. KeyId *string `type:"string" required:"true"`
  1007. metadataDisableKeyInput `json:"-" xml:"-"`
  1008. }
  1009. type metadataDisableKeyInput struct {
  1010. SDKShapeTraits bool `type:"structure"`
  1011. }
  1012. // String returns the string representation
  1013. func (s DisableKeyInput) String() string {
  1014. return awsutil.Prettify(s)
  1015. }
  1016. // GoString returns the string representation
  1017. func (s DisableKeyInput) GoString() string {
  1018. return s.String()
  1019. }
  1020. type DisableKeyOutput struct {
  1021. metadataDisableKeyOutput `json:"-" xml:"-"`
  1022. }
  1023. type metadataDisableKeyOutput struct {
  1024. SDKShapeTraits bool `type:"structure"`
  1025. }
  1026. // String returns the string representation
  1027. func (s DisableKeyOutput) String() string {
  1028. return awsutil.Prettify(s)
  1029. }
  1030. // GoString returns the string representation
  1031. func (s DisableKeyOutput) GoString() string {
  1032. return s.String()
  1033. }
  1034. type DisableKeyRotationInput struct {
  1035. // A unique identifier for the customer master key. This value can be a globally
  1036. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1037. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1038. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1039. KeyId *string `type:"string" required:"true"`
  1040. metadataDisableKeyRotationInput `json:"-" xml:"-"`
  1041. }
  1042. type metadataDisableKeyRotationInput struct {
  1043. SDKShapeTraits bool `type:"structure"`
  1044. }
  1045. // String returns the string representation
  1046. func (s DisableKeyRotationInput) String() string {
  1047. return awsutil.Prettify(s)
  1048. }
  1049. // GoString returns the string representation
  1050. func (s DisableKeyRotationInput) GoString() string {
  1051. return s.String()
  1052. }
  1053. type DisableKeyRotationOutput struct {
  1054. metadataDisableKeyRotationOutput `json:"-" xml:"-"`
  1055. }
  1056. type metadataDisableKeyRotationOutput struct {
  1057. SDKShapeTraits bool `type:"structure"`
  1058. }
  1059. // String returns the string representation
  1060. func (s DisableKeyRotationOutput) String() string {
  1061. return awsutil.Prettify(s)
  1062. }
  1063. // GoString returns the string representation
  1064. func (s DisableKeyRotationOutput) GoString() string {
  1065. return s.String()
  1066. }
  1067. type EnableKeyInput struct {
  1068. // A unique identifier for the customer master key. This value can be a globally
  1069. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1070. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1071. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1072. KeyId *string `type:"string" required:"true"`
  1073. metadataEnableKeyInput `json:"-" xml:"-"`
  1074. }
  1075. type metadataEnableKeyInput struct {
  1076. SDKShapeTraits bool `type:"structure"`
  1077. }
  1078. // String returns the string representation
  1079. func (s EnableKeyInput) String() string {
  1080. return awsutil.Prettify(s)
  1081. }
  1082. // GoString returns the string representation
  1083. func (s EnableKeyInput) GoString() string {
  1084. return s.String()
  1085. }
  1086. type EnableKeyOutput struct {
  1087. metadataEnableKeyOutput `json:"-" xml:"-"`
  1088. }
  1089. type metadataEnableKeyOutput struct {
  1090. SDKShapeTraits bool `type:"structure"`
  1091. }
  1092. // String returns the string representation
  1093. func (s EnableKeyOutput) String() string {
  1094. return awsutil.Prettify(s)
  1095. }
  1096. // GoString returns the string representation
  1097. func (s EnableKeyOutput) GoString() string {
  1098. return s.String()
  1099. }
  1100. type EnableKeyRotationInput struct {
  1101. // A unique identifier for the customer master key. This value can be a globally
  1102. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1103. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1104. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1105. KeyId *string `type:"string" required:"true"`
  1106. metadataEnableKeyRotationInput `json:"-" xml:"-"`
  1107. }
  1108. type metadataEnableKeyRotationInput struct {
  1109. SDKShapeTraits bool `type:"structure"`
  1110. }
  1111. // String returns the string representation
  1112. func (s EnableKeyRotationInput) String() string {
  1113. return awsutil.Prettify(s)
  1114. }
  1115. // GoString returns the string representation
  1116. func (s EnableKeyRotationInput) GoString() string {
  1117. return s.String()
  1118. }
  1119. type EnableKeyRotationOutput struct {
  1120. metadataEnableKeyRotationOutput `json:"-" xml:"-"`
  1121. }
  1122. type metadataEnableKeyRotationOutput struct {
  1123. SDKShapeTraits bool `type:"structure"`
  1124. }
  1125. // String returns the string representation
  1126. func (s EnableKeyRotationOutput) String() string {
  1127. return awsutil.Prettify(s)
  1128. }
  1129. // GoString returns the string representation
  1130. func (s EnableKeyRotationOutput) GoString() string {
  1131. return s.String()
  1132. }
  1133. type EncryptInput struct {
  1134. // Name/value pair that specifies the encryption context to be used for authenticated
  1135. // encryption. If used here, the same value must be supplied to the Decrypt
  1136. // API or decryption will fail. For more information, see Encryption Context
  1137. // (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
  1138. EncryptionContext map[string]*string `type:"map"`
  1139. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  1140. GrantTokens []*string `type:"list"`
  1141. // A unique identifier for the customer master key. This value can be a globally
  1142. // unique identifier, a fully specified ARN to either an alias or a key, or
  1143. // an alias name prefixed by "alias/". Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1144. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  1145. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 Alias
  1146. // Name Example - alias/MyAliasName
  1147. KeyId *string `type:"string" required:"true"`
  1148. // Data to be encrypted.
  1149. Plaintext []byte `type:"blob" required:"true"`
  1150. metadataEncryptInput `json:"-" xml:"-"`
  1151. }
  1152. type metadataEncryptInput struct {
  1153. SDKShapeTraits bool `type:"structure"`
  1154. }
  1155. // String returns the string representation
  1156. func (s EncryptInput) String() string {
  1157. return awsutil.Prettify(s)
  1158. }
  1159. // GoString returns the string representation
  1160. func (s EncryptInput) GoString() string {
  1161. return s.String()
  1162. }
  1163. type EncryptOutput struct {
  1164. // The encrypted plaintext. If you are using the CLI, the value is Base64 encoded.
  1165. // Otherwise, it is not encoded.
  1166. CiphertextBlob []byte `type:"blob"`
  1167. // The ID of the key used during encryption.
  1168. KeyId *string `type:"string"`
  1169. metadataEncryptOutput `json:"-" xml:"-"`
  1170. }
  1171. type metadataEncryptOutput struct {
  1172. SDKShapeTraits bool `type:"structure"`
  1173. }
  1174. // String returns the string representation
  1175. func (s EncryptOutput) String() string {
  1176. return awsutil.Prettify(s)
  1177. }
  1178. // GoString returns the string representation
  1179. func (s EncryptOutput) GoString() string {
  1180. return s.String()
  1181. }
  1182. type GenerateDataKeyInput struct {
  1183. // Name/value pair that contains additional data to be authenticated during
  1184. // the encryption and decryption processes that use the key. This value is logged
  1185. // by AWS CloudTrail to provide context around the data encrypted by the key.
  1186. EncryptionContext map[string]*string `type:"map"`
  1187. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  1188. GrantTokens []*string `type:"list"`
  1189. // A unique identifier for the customer master key. This value can be a globally
  1190. // unique identifier, a fully specified ARN to either an alias or a key, or
  1191. // an alias name prefixed by "alias/". Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1192. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  1193. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 Alias
  1194. // Name Example - alias/MyAliasName
  1195. KeyId *string `type:"string" required:"true"`
  1196. // Value that identifies the encryption algorithm and key size to generate a
  1197. // data key for. Currently this can be AES_128 or AES_256.
  1198. KeySpec *string `type:"string" enum:"DataKeySpec"`
  1199. // Integer that contains the number of bytes to generate. Common values are
  1200. // 128, 256, 512, and 1024. 1024 is the current limit. We recommend that you
  1201. // use the KeySpec parameter instead.
  1202. NumberOfBytes *int64 `type:"integer"`
  1203. metadataGenerateDataKeyInput `json:"-" xml:"-"`
  1204. }
  1205. type metadataGenerateDataKeyInput struct {
  1206. SDKShapeTraits bool `type:"structure"`
  1207. }
  1208. // String returns the string representation
  1209. func (s GenerateDataKeyInput) String() string {
  1210. return awsutil.Prettify(s)
  1211. }
  1212. // GoString returns the string representation
  1213. func (s GenerateDataKeyInput) GoString() string {
  1214. return s.String()
  1215. }
  1216. type GenerateDataKeyOutput struct {
  1217. // Ciphertext that contains the encrypted data key. You must store the blob
  1218. // and enough information to reconstruct the encryption context so that the
  1219. // data encrypted by using the key can later be decrypted. You must provide
  1220. // both the ciphertext blob and the encryption context to the Decrypt API to
  1221. // recover the plaintext data key and decrypt the object.
  1222. //
  1223. // If you are using the CLI, the value is Base64 encoded. Otherwise, it is
  1224. // not encoded.
  1225. CiphertextBlob []byte `type:"blob"`
  1226. // System generated unique identifier of the key to be used to decrypt the encrypted
  1227. // copy of the data key.
  1228. KeyId *string `type:"string"`
  1229. // Plaintext that contains the data key. Use this for encryption and decryption
  1230. // and then remove it from memory as soon as possible.
  1231. Plaintext []byte `type:"blob"`
  1232. metadataGenerateDataKeyOutput `json:"-" xml:"-"`
  1233. }
  1234. type metadataGenerateDataKeyOutput struct {
  1235. SDKShapeTraits bool `type:"structure"`
  1236. }
  1237. // String returns the string representation
  1238. func (s GenerateDataKeyOutput) String() string {
  1239. return awsutil.Prettify(s)
  1240. }
  1241. // GoString returns the string representation
  1242. func (s GenerateDataKeyOutput) GoString() string {
  1243. return s.String()
  1244. }
  1245. type GenerateDataKeyWithoutPlaintextInput struct {
  1246. // Name:value pair that contains additional data to be authenticated during
  1247. // the encryption and decryption processes.
  1248. EncryptionContext map[string]*string `type:"map"`
  1249. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  1250. GrantTokens []*string `type:"list"`
  1251. // A unique identifier for the customer master key. This value can be a globally
  1252. // unique identifier, a fully specified ARN to either an alias or a key, or
  1253. // an alias name prefixed by "alias/". Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1254. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  1255. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 Alias
  1256. // Name Example - alias/MyAliasName
  1257. KeyId *string `type:"string" required:"true"`
  1258. // Value that identifies the encryption algorithm and key size. Currently this
  1259. // can be AES_128 or AES_256.
  1260. KeySpec *string `type:"string" enum:"DataKeySpec"`
  1261. // Integer that contains the number of bytes to generate. Common values are
  1262. // 128, 256, 512, 1024 and so on. We recommend that you use the KeySpec parameter
  1263. // instead.
  1264. NumberOfBytes *int64 `type:"integer"`
  1265. metadataGenerateDataKeyWithoutPlaintextInput `json:"-" xml:"-"`
  1266. }
  1267. type metadataGenerateDataKeyWithoutPlaintextInput struct {
  1268. SDKShapeTraits bool `type:"structure"`
  1269. }
  1270. // String returns the string representation
  1271. func (s GenerateDataKeyWithoutPlaintextInput) String() string {
  1272. return awsutil.Prettify(s)
  1273. }
  1274. // GoString returns the string representation
  1275. func (s GenerateDataKeyWithoutPlaintextInput) GoString() string {
  1276. return s.String()
  1277. }
  1278. type GenerateDataKeyWithoutPlaintextOutput struct {
  1279. // Ciphertext that contains the wrapped data key. You must store the blob and
  1280. // encryption context so that the key can be used in a future decrypt operation.
  1281. //
  1282. // If you are using the CLI, the value is Base64 encoded. Otherwise, it is
  1283. // not encoded.
  1284. CiphertextBlob []byte `type:"blob"`
  1285. // System generated unique identifier of the key to be used to decrypt the encrypted
  1286. // copy of the data key.
  1287. KeyId *string `type:"string"`
  1288. metadataGenerateDataKeyWithoutPlaintextOutput `json:"-" xml:"-"`
  1289. }
  1290. type metadataGenerateDataKeyWithoutPlaintextOutput struct {
  1291. SDKShapeTraits bool `type:"structure"`
  1292. }
  1293. // String returns the string representation
  1294. func (s GenerateDataKeyWithoutPlaintextOutput) String() string {
  1295. return awsutil.Prettify(s)
  1296. }
  1297. // GoString returns the string representation
  1298. func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string {
  1299. return s.String()
  1300. }
  1301. type GenerateRandomInput struct {
  1302. // Integer that contains the number of bytes to generate. Common values are
  1303. // 128, 256, 512, 1024 and so on. The current limit is 1024 bytes.
  1304. NumberOfBytes *int64 `type:"integer"`
  1305. metadataGenerateRandomInput `json:"-" xml:"-"`
  1306. }
  1307. type metadataGenerateRandomInput struct {
  1308. SDKShapeTraits bool `type:"structure"`
  1309. }
  1310. // String returns the string representation
  1311. func (s GenerateRandomInput) String() string {
  1312. return awsutil.Prettify(s)
  1313. }
  1314. // GoString returns the string representation
  1315. func (s GenerateRandomInput) GoString() string {
  1316. return s.String()
  1317. }
  1318. type GenerateRandomOutput struct {
  1319. // Plaintext that contains the unpredictable byte string.
  1320. Plaintext []byte `type:"blob"`
  1321. metadataGenerateRandomOutput `json:"-" xml:"-"`
  1322. }
  1323. type metadataGenerateRandomOutput struct {
  1324. SDKShapeTraits bool `type:"structure"`
  1325. }
  1326. // String returns the string representation
  1327. func (s GenerateRandomOutput) String() string {
  1328. return awsutil.Prettify(s)
  1329. }
  1330. // GoString returns the string representation
  1331. func (s GenerateRandomOutput) GoString() string {
  1332. return s.String()
  1333. }
  1334. type GetKeyPolicyInput struct {
  1335. // A unique identifier for the customer master key. This value can be a globally
  1336. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1337. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1338. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1339. KeyId *string `type:"string" required:"true"`
  1340. // String that contains the name of the policy. Currently, this must be "default".
  1341. // Policy names can be discovered by calling ListKeyPolicies.
  1342. PolicyName *string `type:"string" required:"true"`
  1343. metadataGetKeyPolicyInput `json:"-" xml:"-"`
  1344. }
  1345. type metadataGetKeyPolicyInput struct {
  1346. SDKShapeTraits bool `type:"structure"`
  1347. }
  1348. // String returns the string representation
  1349. func (s GetKeyPolicyInput) String() string {
  1350. return awsutil.Prettify(s)
  1351. }
  1352. // GoString returns the string representation
  1353. func (s GetKeyPolicyInput) GoString() string {
  1354. return s.String()
  1355. }
  1356. type GetKeyPolicyOutput struct {
  1357. // A policy document in JSON format.
  1358. Policy *string `type:"string"`
  1359. metadataGetKeyPolicyOutput `json:"-" xml:"-"`
  1360. }
  1361. type metadataGetKeyPolicyOutput struct {
  1362. SDKShapeTraits bool `type:"structure"`
  1363. }
  1364. // String returns the string representation
  1365. func (s GetKeyPolicyOutput) String() string {
  1366. return awsutil.Prettify(s)
  1367. }
  1368. // GoString returns the string representation
  1369. func (s GetKeyPolicyOutput) GoString() string {
  1370. return s.String()
  1371. }
  1372. type GetKeyRotationStatusInput struct {
  1373. // A unique identifier for the customer master key. This value can be a globally
  1374. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1375. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1376. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1377. KeyId *string `type:"string" required:"true"`
  1378. metadataGetKeyRotationStatusInput `json:"-" xml:"-"`
  1379. }
  1380. type metadataGetKeyRotationStatusInput struct {
  1381. SDKShapeTraits bool `type:"structure"`
  1382. }
  1383. // String returns the string representation
  1384. func (s GetKeyRotationStatusInput) String() string {
  1385. return awsutil.Prettify(s)
  1386. }
  1387. // GoString returns the string representation
  1388. func (s GetKeyRotationStatusInput) GoString() string {
  1389. return s.String()
  1390. }
  1391. type GetKeyRotationStatusOutput struct {
  1392. // A Boolean value that specifies whether key rotation is enabled.
  1393. KeyRotationEnabled *bool `type:"boolean"`
  1394. metadataGetKeyRotationStatusOutput `json:"-" xml:"-"`
  1395. }
  1396. type metadataGetKeyRotationStatusOutput struct {
  1397. SDKShapeTraits bool `type:"structure"`
  1398. }
  1399. // String returns the string representation
  1400. func (s GetKeyRotationStatusOutput) String() string {
  1401. return awsutil.Prettify(s)
  1402. }
  1403. // GoString returns the string representation
  1404. func (s GetKeyRotationStatusOutput) GoString() string {
  1405. return s.String()
  1406. }
  1407. // Contains constraints on the grant.
  1408. type GrantConstraints struct {
  1409. // The constraint contains additional key/value pairs that serve to further
  1410. // limit the grant.
  1411. EncryptionContextEquals map[string]*string `type:"map"`
  1412. // The constraint equals the full encryption context.
  1413. EncryptionContextSubset map[string]*string `type:"map"`
  1414. metadataGrantConstraints `json:"-" xml:"-"`
  1415. }
  1416. type metadataGrantConstraints struct {
  1417. SDKShapeTraits bool `type:"structure"`
  1418. }
  1419. // String returns the string representation
  1420. func (s GrantConstraints) String() string {
  1421. return awsutil.Prettify(s)
  1422. }
  1423. // GoString returns the string representation
  1424. func (s GrantConstraints) GoString() string {
  1425. return s.String()
  1426. }
  1427. // Contains information about each entry in the grant list.
  1428. type GrantListEntry struct {
  1429. // Specifies the conditions under which the actions specified by the Operations
  1430. // parameter are allowed.
  1431. Constraints *GrantConstraints `type:"structure"`
  1432. // Unique grant identifier.
  1433. GrantId *string `type:"string"`
  1434. // The principal that receives the grant permission.
  1435. GranteePrincipal *string `type:"string"`
  1436. // The account under which the grant was issued.
  1437. IssuingAccount *string `type:"string"`
  1438. // List of operations permitted by the grant. This can be any combination of
  1439. // one or more of the following values: Decrypt Encrypt GenerateDataKey GenerateDataKeyWithoutPlaintext
  1440. // ReEncryptFrom ReEncryptTo CreateGrant
  1441. Operations []*string `type:"list"`
  1442. // The principal that can retire the account.
  1443. RetiringPrincipal *string `type:"string"`
  1444. metadataGrantListEntry `json:"-" xml:"-"`
  1445. }
  1446. type metadataGrantListEntry struct {
  1447. SDKShapeTraits bool `type:"structure"`
  1448. }
  1449. // String returns the string representation
  1450. func (s GrantListEntry) String() string {
  1451. return awsutil.Prettify(s)
  1452. }
  1453. // GoString returns the string representation
  1454. func (s GrantListEntry) GoString() string {
  1455. return s.String()
  1456. }
  1457. // Contains information about each entry in the key list.
  1458. type KeyListEntry struct {
  1459. // ARN of the key.
  1460. KeyArn *string `type:"string"`
  1461. // Unique identifier of the key.
  1462. KeyId *string `type:"string"`
  1463. metadataKeyListEntry `json:"-" xml:"-"`
  1464. }
  1465. type metadataKeyListEntry struct {
  1466. SDKShapeTraits bool `type:"structure"`
  1467. }
  1468. // String returns the string representation
  1469. func (s KeyListEntry) String() string {
  1470. return awsutil.Prettify(s)
  1471. }
  1472. // GoString returns the string representation
  1473. func (s KeyListEntry) GoString() string {
  1474. return s.String()
  1475. }
  1476. // Contains metadata associated with a specific key.
  1477. type KeyMetadata struct {
  1478. // Account ID number.
  1479. AWSAccountId *string `type:"string"`
  1480. // Key ARN (Amazon Resource Name).
  1481. Arn *string `type:"string"`
  1482. // Date the key was created.
  1483. CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"`
  1484. // The description of the key.
  1485. Description *string `type:"string"`
  1486. // Value that specifies whether the key is enabled.
  1487. Enabled *bool `type:"boolean"`
  1488. // Unique identifier for the key.
  1489. KeyId *string `type:"string" required:"true"`
  1490. // A value that specifies what operation(s) the key can perform.
  1491. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  1492. metadataKeyMetadata `json:"-" xml:"-"`
  1493. }
  1494. type metadataKeyMetadata struct {
  1495. SDKShapeTraits bool `type:"structure"`
  1496. }
  1497. // String returns the string representation
  1498. func (s KeyMetadata) String() string {
  1499. return awsutil.Prettify(s)
  1500. }
  1501. // GoString returns the string representation
  1502. func (s KeyMetadata) GoString() string {
  1503. return s.String()
  1504. }
  1505. type ListAliasesInput struct {
  1506. // Specify this parameter when paginating results to indicate the maximum number
  1507. // of aliases you want in each response. If there are additional aliases beyond
  1508. // the maximum you specify, the Truncated response element will be set to true.
  1509. Limit *int64 `type:"integer"`
  1510. // Use this parameter when paginating results, and only in a subsequent request
  1511. // after you've received a response where the results are truncated. Set it
  1512. // to the value of the NextMarker element in the response you just received.
  1513. Marker *string `type:"string"`
  1514. metadataListAliasesInput `json:"-" xml:"-"`
  1515. }
  1516. type metadataListAliasesInput struct {
  1517. SDKShapeTraits bool `type:"structure"`
  1518. }
  1519. // String returns the string representation
  1520. func (s ListAliasesInput) String() string {
  1521. return awsutil.Prettify(s)
  1522. }
  1523. // GoString returns the string representation
  1524. func (s ListAliasesInput) GoString() string {
  1525. return s.String()
  1526. }
  1527. type ListAliasesOutput struct {
  1528. // A list of key aliases in the user's account.
  1529. Aliases []*AliasListEntry `type:"list"`
  1530. // If Truncated is true, this value is present and contains the value to use
  1531. // for the Marker request parameter in a subsequent pagination request.
  1532. NextMarker *string `type:"string"`
  1533. // A flag that indicates whether there are more items in the list. If your results
  1534. // were truncated, you can make a subsequent pagination request using the Marker
  1535. // request parameter to retrieve more aliases in the list.
  1536. Truncated *bool `type:"boolean"`
  1537. metadataListAliasesOutput `json:"-" xml:"-"`
  1538. }
  1539. type metadataListAliasesOutput struct {
  1540. SDKShapeTraits bool `type:"structure"`
  1541. }
  1542. // String returns the string representation
  1543. func (s ListAliasesOutput) String() string {
  1544. return awsutil.Prettify(s)
  1545. }
  1546. // GoString returns the string representation
  1547. func (s ListAliasesOutput) GoString() string {
  1548. return s.String()
  1549. }
  1550. type ListGrantsInput struct {
  1551. // A unique identifier for the customer master key. This value can be a globally
  1552. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1553. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1554. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1555. KeyId *string `type:"string" required:"true"`
  1556. // Specify this parameter only when paginating results to indicate the maximum
  1557. // number of grants you want listed in the response. If there are additional
  1558. // grants beyond the maximum you specify, the Truncated response element will
  1559. // be set to true.
  1560. Limit *int64 `type:"integer"`
  1561. // Use this parameter only when paginating results, and only in a subsequent
  1562. // request after you've received a response where the results are truncated.
  1563. // Set it to the value of the NextMarker in the response you just received.
  1564. Marker *string `type:"string"`
  1565. metadataListGrantsInput `json:"-" xml:"-"`
  1566. }
  1567. type metadataListGrantsInput struct {
  1568. SDKShapeTraits bool `type:"structure"`
  1569. }
  1570. // String returns the string representation
  1571. func (s ListGrantsInput) String() string {
  1572. return awsutil.Prettify(s)
  1573. }
  1574. // GoString returns the string representation
  1575. func (s ListGrantsInput) GoString() string {
  1576. return s.String()
  1577. }
  1578. type ListGrantsOutput struct {
  1579. // A list of grants.
  1580. Grants []*GrantListEntry `type:"list"`
  1581. // If Truncated is true, this value is present and contains the value to use
  1582. // for the Marker request parameter in a subsequent pagination request.
  1583. NextMarker *string `type:"string"`
  1584. // A flag that indicates whether there are more items in the list. If your results
  1585. // were truncated, you can make a subsequent pagination request using the Marker
  1586. // request parameter to retrieve more grants in the list.
  1587. Truncated *bool `type:"boolean"`
  1588. metadataListGrantsOutput `json:"-" xml:"-"`
  1589. }
  1590. type metadataListGrantsOutput struct {
  1591. SDKShapeTraits bool `type:"structure"`
  1592. }
  1593. // String returns the string representation
  1594. func (s ListGrantsOutput) String() string {
  1595. return awsutil.Prettify(s)
  1596. }
  1597. // GoString returns the string representation
  1598. func (s ListGrantsOutput) GoString() string {
  1599. return s.String()
  1600. }
  1601. type ListKeyPoliciesInput struct {
  1602. // A unique identifier for the customer master key. This value can be a globally
  1603. // unique identifier, a fully specified ARN to either an alias or a key, or
  1604. // an alias name prefixed by "alias/". Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1605. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  1606. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 Alias
  1607. // Name Example - alias/MyAliasName
  1608. KeyId *string `type:"string" required:"true"`
  1609. // Specify this parameter only when paginating results to indicate the maximum
  1610. // number of policies you want listed in the response. If there are additional
  1611. // policies beyond the maximum you specify, the Truncated response element will
  1612. // be set to true.
  1613. Limit *int64 `type:"integer"`
  1614. // Use this parameter only when paginating results, and only in a subsequent
  1615. // request after you've received a response where the results are truncated.
  1616. // Set it to the value of the NextMarker in the response you just received.
  1617. Marker *string `type:"string"`
  1618. metadataListKeyPoliciesInput `json:"-" xml:"-"`
  1619. }
  1620. type metadataListKeyPoliciesInput struct {
  1621. SDKShapeTraits bool `type:"structure"`
  1622. }
  1623. // String returns the string representation
  1624. func (s ListKeyPoliciesInput) String() string {
  1625. return awsutil.Prettify(s)
  1626. }
  1627. // GoString returns the string representation
  1628. func (s ListKeyPoliciesInput) GoString() string {
  1629. return s.String()
  1630. }
  1631. type ListKeyPoliciesOutput struct {
  1632. // If Truncated is true, this value is present and contains the value to use
  1633. // for the Marker request parameter in a subsequent pagination request.
  1634. NextMarker *string `type:"string"`
  1635. // A list of policy names. Currently, there is only one policy and it is named
  1636. // "Default".
  1637. PolicyNames []*string `type:"list"`
  1638. // A flag that indicates whether there are more items in the list. If your results
  1639. // were truncated, you can make a subsequent pagination request using the Marker
  1640. // request parameter to retrieve more policies in the list.
  1641. Truncated *bool `type:"boolean"`
  1642. metadataListKeyPoliciesOutput `json:"-" xml:"-"`
  1643. }
  1644. type metadataListKeyPoliciesOutput struct {
  1645. SDKShapeTraits bool `type:"structure"`
  1646. }
  1647. // String returns the string representation
  1648. func (s ListKeyPoliciesOutput) String() string {
  1649. return awsutil.Prettify(s)
  1650. }
  1651. // GoString returns the string representation
  1652. func (s ListKeyPoliciesOutput) GoString() string {
  1653. return s.String()
  1654. }
  1655. type ListKeysInput struct {
  1656. // Specify this parameter only when paginating results to indicate the maximum
  1657. // number of keys you want listed in the response. If there are additional keys
  1658. // beyond the maximum you specify, the Truncated response element will be set
  1659. // to true.
  1660. Limit *int64 `type:"integer"`
  1661. // Use this parameter only when paginating results, and only in a subsequent
  1662. // request after you've received a response where the results are truncated.
  1663. // Set it to the value of the NextMarker in the response you just received.
  1664. Marker *string `type:"string"`
  1665. metadataListKeysInput `json:"-" xml:"-"`
  1666. }
  1667. type metadataListKeysInput struct {
  1668. SDKShapeTraits bool `type:"structure"`
  1669. }
  1670. // String returns the string representation
  1671. func (s ListKeysInput) String() string {
  1672. return awsutil.Prettify(s)
  1673. }
  1674. // GoString returns the string representation
  1675. func (s ListKeysInput) GoString() string {
  1676. return s.String()
  1677. }
  1678. type ListKeysOutput struct {
  1679. // A list of keys.
  1680. Keys []*KeyListEntry `type:"list"`
  1681. // If Truncated is true, this value is present and contains the value to use
  1682. // for the Marker request parameter in a subsequent pagination request.
  1683. NextMarker *string `type:"string"`
  1684. // A flag that indicates whether there are more items in the list. If your results
  1685. // were truncated, you can make a subsequent pagination request using the Marker
  1686. // request parameter to retrieve more keys in the list.
  1687. Truncated *bool `type:"boolean"`
  1688. metadataListKeysOutput `json:"-" xml:"-"`
  1689. }
  1690. type metadataListKeysOutput struct {
  1691. SDKShapeTraits bool `type:"structure"`
  1692. }
  1693. // String returns the string representation
  1694. func (s ListKeysOutput) String() string {
  1695. return awsutil.Prettify(s)
  1696. }
  1697. // GoString returns the string representation
  1698. func (s ListKeysOutput) GoString() string {
  1699. return s.String()
  1700. }
  1701. type PutKeyPolicyInput struct {
  1702. // A unique identifier for the customer master key. This value can be a globally
  1703. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1704. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1705. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1706. KeyId *string `type:"string" required:"true"`
  1707. // The policy, in JSON format, to be attached to the key.
  1708. Policy *string `type:"string" required:"true"`
  1709. // Name of the policy to be attached. Currently, the only supported name is
  1710. // "default".
  1711. PolicyName *string `type:"string" required:"true"`
  1712. metadataPutKeyPolicyInput `json:"-" xml:"-"`
  1713. }
  1714. type metadataPutKeyPolicyInput struct {
  1715. SDKShapeTraits bool `type:"structure"`
  1716. }
  1717. // String returns the string representation
  1718. func (s PutKeyPolicyInput) String() string {
  1719. return awsutil.Prettify(s)
  1720. }
  1721. // GoString returns the string representation
  1722. func (s PutKeyPolicyInput) GoString() string {
  1723. return s.String()
  1724. }
  1725. type PutKeyPolicyOutput struct {
  1726. metadataPutKeyPolicyOutput `json:"-" xml:"-"`
  1727. }
  1728. type metadataPutKeyPolicyOutput struct {
  1729. SDKShapeTraits bool `type:"structure"`
  1730. }
  1731. // String returns the string representation
  1732. func (s PutKeyPolicyOutput) String() string {
  1733. return awsutil.Prettify(s)
  1734. }
  1735. // GoString returns the string representation
  1736. func (s PutKeyPolicyOutput) GoString() string {
  1737. return s.String()
  1738. }
  1739. type ReEncryptInput struct {
  1740. // Ciphertext of the data to re-encrypt.
  1741. CiphertextBlob []byte `type:"blob" required:"true"`
  1742. // Encryption context to be used when the data is re-encrypted.
  1743. DestinationEncryptionContext map[string]*string `type:"map"`
  1744. // A unique identifier for the customer master key used to re-encrypt the data.
  1745. // This value can be a globally unique identifier, a fully specified ARN to
  1746. // either an alias or a key, or an alias name prefixed by "alias/". Key ARN
  1747. // Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1748. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  1749. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012 Alias
  1750. // Name Example - alias/MyAliasName
  1751. DestinationKeyId *string `type:"string" required:"true"`
  1752. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token).
  1753. GrantTokens []*string `type:"list"`
  1754. // Encryption context used to encrypt and decrypt the data specified in the
  1755. // CiphertextBlob parameter.
  1756. SourceEncryptionContext map[string]*string `type:"map"`
  1757. metadataReEncryptInput `json:"-" xml:"-"`
  1758. }
  1759. type metadataReEncryptInput struct {
  1760. SDKShapeTraits bool `type:"structure"`
  1761. }
  1762. // String returns the string representation
  1763. func (s ReEncryptInput) String() string {
  1764. return awsutil.Prettify(s)
  1765. }
  1766. // GoString returns the string representation
  1767. func (s ReEncryptInput) GoString() string {
  1768. return s.String()
  1769. }
  1770. type ReEncryptOutput struct {
  1771. // The re-encrypted data. If you are using the CLI, the value is Base64 encoded.
  1772. // Otherwise, it is not encoded.
  1773. CiphertextBlob []byte `type:"blob"`
  1774. // Unique identifier of the key used to re-encrypt the data.
  1775. KeyId *string `type:"string"`
  1776. // Unique identifier of the key used to originally encrypt the data.
  1777. SourceKeyId *string `type:"string"`
  1778. metadataReEncryptOutput `json:"-" xml:"-"`
  1779. }
  1780. type metadataReEncryptOutput struct {
  1781. SDKShapeTraits bool `type:"structure"`
  1782. }
  1783. // String returns the string representation
  1784. func (s ReEncryptOutput) String() string {
  1785. return awsutil.Prettify(s)
  1786. }
  1787. // GoString returns the string representation
  1788. func (s ReEncryptOutput) GoString() string {
  1789. return s.String()
  1790. }
  1791. type RetireGrantInput struct {
  1792. // Unique identifier of the grant to be retired. The grant ID is returned by
  1793. // the CreateGrant function. Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123
  1794. GrantId *string `type:"string"`
  1795. // Token that identifies the grant to be retired.
  1796. GrantToken *string `type:"string"`
  1797. // A unique identifier for the customer master key associated with the grant.
  1798. // This value can be a globally unique identifier or a fully specified ARN of
  1799. // the key. Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1800. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1801. KeyId *string `type:"string"`
  1802. metadataRetireGrantInput `json:"-" xml:"-"`
  1803. }
  1804. type metadataRetireGrantInput struct {
  1805. SDKShapeTraits bool `type:"structure"`
  1806. }
  1807. // String returns the string representation
  1808. func (s RetireGrantInput) String() string {
  1809. return awsutil.Prettify(s)
  1810. }
  1811. // GoString returns the string representation
  1812. func (s RetireGrantInput) GoString() string {
  1813. return s.String()
  1814. }
  1815. type RetireGrantOutput struct {
  1816. metadataRetireGrantOutput `json:"-" xml:"-"`
  1817. }
  1818. type metadataRetireGrantOutput struct {
  1819. SDKShapeTraits bool `type:"structure"`
  1820. }
  1821. // String returns the string representation
  1822. func (s RetireGrantOutput) String() string {
  1823. return awsutil.Prettify(s)
  1824. }
  1825. // GoString returns the string representation
  1826. func (s RetireGrantOutput) GoString() string {
  1827. return s.String()
  1828. }
  1829. type RevokeGrantInput struct {
  1830. // Identifier of the grant to be revoked.
  1831. GrantId *string `type:"string" required:"true"`
  1832. // A unique identifier for the customer master key associated with the grant.
  1833. // This value can be a globally unique identifier or the fully specified ARN
  1834. // to a key. Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1835. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1836. KeyId *string `type:"string" required:"true"`
  1837. metadataRevokeGrantInput `json:"-" xml:"-"`
  1838. }
  1839. type metadataRevokeGrantInput struct {
  1840. SDKShapeTraits bool `type:"structure"`
  1841. }
  1842. // String returns the string representation
  1843. func (s RevokeGrantInput) String() string {
  1844. return awsutil.Prettify(s)
  1845. }
  1846. // GoString returns the string representation
  1847. func (s RevokeGrantInput) GoString() string {
  1848. return s.String()
  1849. }
  1850. type RevokeGrantOutput struct {
  1851. metadataRevokeGrantOutput `json:"-" xml:"-"`
  1852. }
  1853. type metadataRevokeGrantOutput struct {
  1854. SDKShapeTraits bool `type:"structure"`
  1855. }
  1856. // String returns the string representation
  1857. func (s RevokeGrantOutput) String() string {
  1858. return awsutil.Prettify(s)
  1859. }
  1860. // GoString returns the string representation
  1861. func (s RevokeGrantOutput) GoString() string {
  1862. return s.String()
  1863. }
  1864. type UpdateAliasInput struct {
  1865. // String that contains the name of the alias to be modifed. The name must start
  1866. // with the word "alias" followed by a forward slash (alias/). Aliases that
  1867. // begin with "alias/AWS" are reserved.
  1868. AliasName *string `type:"string" required:"true"`
  1869. // Unique identifier of the customer master key to be associated with the alias.
  1870. // This value can be a globally unique identifier or the fully specified ARN
  1871. // of a key. Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1872. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1873. TargetKeyId *string `type:"string" required:"true"`
  1874. metadataUpdateAliasInput `json:"-" xml:"-"`
  1875. }
  1876. type metadataUpdateAliasInput struct {
  1877. SDKShapeTraits bool `type:"structure"`
  1878. }
  1879. // String returns the string representation
  1880. func (s UpdateAliasInput) String() string {
  1881. return awsutil.Prettify(s)
  1882. }
  1883. // GoString returns the string representation
  1884. func (s UpdateAliasInput) GoString() string {
  1885. return s.String()
  1886. }
  1887. type UpdateAliasOutput struct {
  1888. metadataUpdateAliasOutput `json:"-" xml:"-"`
  1889. }
  1890. type metadataUpdateAliasOutput struct {
  1891. SDKShapeTraits bool `type:"structure"`
  1892. }
  1893. // String returns the string representation
  1894. func (s UpdateAliasOutput) String() string {
  1895. return awsutil.Prettify(s)
  1896. }
  1897. // GoString returns the string representation
  1898. func (s UpdateAliasOutput) GoString() string {
  1899. return s.String()
  1900. }
  1901. type UpdateKeyDescriptionInput struct {
  1902. // New description for the key.
  1903. Description *string `type:"string" required:"true"`
  1904. // A unique identifier for the customer master key. This value can be a globally
  1905. // unique identifier or the fully specified ARN to a key. Key ARN Example -
  1906. // arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1907. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1908. KeyId *string `type:"string" required:"true"`
  1909. metadataUpdateKeyDescriptionInput `json:"-" xml:"-"`
  1910. }
  1911. type metadataUpdateKeyDescriptionInput struct {
  1912. SDKShapeTraits bool `type:"structure"`
  1913. }
  1914. // String returns the string representation
  1915. func (s UpdateKeyDescriptionInput) String() string {
  1916. return awsutil.Prettify(s)
  1917. }
  1918. // GoString returns the string representation
  1919. func (s UpdateKeyDescriptionInput) GoString() string {
  1920. return s.String()
  1921. }
  1922. type UpdateKeyDescriptionOutput struct {
  1923. metadataUpdateKeyDescriptionOutput `json:"-" xml:"-"`
  1924. }
  1925. type metadataUpdateKeyDescriptionOutput struct {
  1926. SDKShapeTraits bool `type:"structure"`
  1927. }
  1928. // String returns the string representation
  1929. func (s UpdateKeyDescriptionOutput) String() string {
  1930. return awsutil.Prettify(s)
  1931. }
  1932. // GoString returns the string representation
  1933. func (s UpdateKeyDescriptionOutput) GoString() string {
  1934. return s.String()
  1935. }
  1936. const (
  1937. // @enum DataKeySpec
  1938. DataKeySpecAes256 = "AES_256"
  1939. // @enum DataKeySpec
  1940. DataKeySpecAes128 = "AES_128"
  1941. )
  1942. const (
  1943. // @enum GrantOperation
  1944. GrantOperationDecrypt = "Decrypt"
  1945. // @enum GrantOperation
  1946. GrantOperationEncrypt = "Encrypt"
  1947. // @enum GrantOperation
  1948. GrantOperationGenerateDataKey = "GenerateDataKey"
  1949. // @enum GrantOperation
  1950. GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext"
  1951. // @enum GrantOperation
  1952. GrantOperationReEncryptFrom = "ReEncryptFrom"
  1953. // @enum GrantOperation
  1954. GrantOperationReEncryptTo = "ReEncryptTo"
  1955. // @enum GrantOperation
  1956. GrantOperationCreateGrant = "CreateGrant"
  1957. // @enum GrantOperation
  1958. GrantOperationRetireGrant = "RetireGrant"
  1959. )
  1960. const (
  1961. // @enum KeyUsageType
  1962. KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT"
  1963. )