api.go 154 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540
  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. "github.com/aws/aws-sdk-go/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  10. )
  11. const opCancelKeyDeletion = "CancelKeyDeletion"
  12. // CancelKeyDeletionRequest generates a "aws/request.Request" representing the
  13. // client's request for the CancelKeyDeletion operation. The "output" return
  14. // value can be used to capture response data after the request's "Send" method
  15. // is called.
  16. //
  17. // Creating a request object using this method should be used when you want to inject
  18. // custom logic into the request's lifecycle using a custom handler, or if you want to
  19. // access properties on the request object before or after sending the request. If
  20. // you just want the service response, call the CancelKeyDeletion method directly
  21. // instead.
  22. //
  23. // Note: You must call the "Send" method on the returned request object in order
  24. // to execute the request.
  25. //
  26. // // Example sending a request using the CancelKeyDeletionRequest method.
  27. // req, resp := client.CancelKeyDeletionRequest(params)
  28. //
  29. // err := req.Send()
  30. // if err == nil { // resp is now filled
  31. // fmt.Println(resp)
  32. // }
  33. //
  34. func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput) {
  35. op := &request.Operation{
  36. Name: opCancelKeyDeletion,
  37. HTTPMethod: "POST",
  38. HTTPPath: "/",
  39. }
  40. if input == nil {
  41. input = &CancelKeyDeletionInput{}
  42. }
  43. req = c.newRequest(op, input, output)
  44. output = &CancelKeyDeletionOutput{}
  45. req.Data = output
  46. return
  47. }
  48. // Cancels the deletion of a customer master key (CMK). When this operation
  49. // is successful, the CMK is set to the Disabled state. To enable a CMK, use
  50. // EnableKey.
  51. //
  52. // For more information about scheduling and canceling deletion of a CMK, see
  53. // Deleting Customer Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html)
  54. // in the AWS Key Management Service Developer Guide.
  55. func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) {
  56. req, out := c.CancelKeyDeletionRequest(input)
  57. err := req.Send()
  58. return out, err
  59. }
  60. const opCreateAlias = "CreateAlias"
  61. // CreateAliasRequest generates a "aws/request.Request" representing the
  62. // client's request for the CreateAlias operation. The "output" return
  63. // value can be used to capture response data after the request's "Send" method
  64. // is called.
  65. //
  66. // Creating a request object using this method should be used when you want to inject
  67. // custom logic into the request's lifecycle using a custom handler, or if you want to
  68. // access properties on the request object before or after sending the request. If
  69. // you just want the service response, call the CreateAlias method directly
  70. // instead.
  71. //
  72. // Note: You must call the "Send" method on the returned request object in order
  73. // to execute the request.
  74. //
  75. // // Example sending a request using the CreateAliasRequest method.
  76. // req, resp := client.CreateAliasRequest(params)
  77. //
  78. // err := req.Send()
  79. // if err == nil { // resp is now filled
  80. // fmt.Println(resp)
  81. // }
  82. //
  83. func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) {
  84. op := &request.Operation{
  85. Name: opCreateAlias,
  86. HTTPMethod: "POST",
  87. HTTPPath: "/",
  88. }
  89. if input == nil {
  90. input = &CreateAliasInput{}
  91. }
  92. req = c.newRequest(op, input, output)
  93. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  94. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  95. output = &CreateAliasOutput{}
  96. req.Data = output
  97. return
  98. }
  99. // Creates a display name for a customer master key. An alias can be used to
  100. // identify a key and should be unique. The console enforces a one-to-one mapping
  101. // between the alias and a key. An alias name can contain only alphanumeric
  102. // characters, forward slashes (/), underscores (_), and dashes (-). An alias
  103. // must start with the word "alias" followed by a forward slash (alias/). An
  104. // alias that begins with "aws" after the forward slash (alias/aws...) is reserved
  105. // by Amazon Web Services (AWS).
  106. //
  107. // The alias and the key it is mapped to must be in the same AWS account and
  108. // the same region.
  109. //
  110. // To map an alias to a different key, call UpdateAlias.
  111. func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) {
  112. req, out := c.CreateAliasRequest(input)
  113. err := req.Send()
  114. return out, err
  115. }
  116. const opCreateGrant = "CreateGrant"
  117. // CreateGrantRequest generates a "aws/request.Request" representing the
  118. // client's request for the CreateGrant operation. The "output" return
  119. // value can be used to capture response data after the request's "Send" method
  120. // is called.
  121. //
  122. // Creating a request object using this method should be used when you want to inject
  123. // custom logic into the request's lifecycle using a custom handler, or if you want to
  124. // access properties on the request object before or after sending the request. If
  125. // you just want the service response, call the CreateGrant method directly
  126. // instead.
  127. //
  128. // Note: You must call the "Send" method on the returned request object in order
  129. // to execute the request.
  130. //
  131. // // Example sending a request using the CreateGrantRequest method.
  132. // req, resp := client.CreateGrantRequest(params)
  133. //
  134. // err := req.Send()
  135. // if err == nil { // resp is now filled
  136. // fmt.Println(resp)
  137. // }
  138. //
  139. func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput) {
  140. op := &request.Operation{
  141. Name: opCreateGrant,
  142. HTTPMethod: "POST",
  143. HTTPPath: "/",
  144. }
  145. if input == nil {
  146. input = &CreateGrantInput{}
  147. }
  148. req = c.newRequest(op, input, output)
  149. output = &CreateGrantOutput{}
  150. req.Data = output
  151. return
  152. }
  153. // Adds a grant to a key to specify who can use the key and under what conditions.
  154. // Grants are alternate permission mechanisms to key policies.
  155. //
  156. // For more information about grants, see Grants (http://docs.aws.amazon.com/kms/latest/developerguide/grants.html)
  157. // in the AWS Key Management Service Developer Guide.
  158. func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) {
  159. req, out := c.CreateGrantRequest(input)
  160. err := req.Send()
  161. return out, err
  162. }
  163. const opCreateKey = "CreateKey"
  164. // CreateKeyRequest generates a "aws/request.Request" representing the
  165. // client's request for the CreateKey operation. The "output" return
  166. // value can be used to capture response data after the request's "Send" method
  167. // is called.
  168. //
  169. // Creating a request object using this method should be used when you want to inject
  170. // custom logic into the request's lifecycle using a custom handler, or if you want to
  171. // access properties on the request object before or after sending the request. If
  172. // you just want the service response, call the CreateKey method directly
  173. // instead.
  174. //
  175. // Note: You must call the "Send" method on the returned request object in order
  176. // to execute the request.
  177. //
  178. // // Example sending a request using the CreateKeyRequest method.
  179. // req, resp := client.CreateKeyRequest(params)
  180. //
  181. // err := req.Send()
  182. // if err == nil { // resp is now filled
  183. // fmt.Println(resp)
  184. // }
  185. //
  186. func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) {
  187. op := &request.Operation{
  188. Name: opCreateKey,
  189. HTTPMethod: "POST",
  190. HTTPPath: "/",
  191. }
  192. if input == nil {
  193. input = &CreateKeyInput{}
  194. }
  195. req = c.newRequest(op, input, output)
  196. output = &CreateKeyOutput{}
  197. req.Data = output
  198. return
  199. }
  200. // Creates a customer master key (CMK).
  201. //
  202. // You can use a CMK to encrypt small amounts of data (4 KiB or less) directly,
  203. // but CMKs are more commonly used to encrypt data encryption keys (DEKs), which
  204. // are used to encrypt raw data. For more information about DEKs and the difference
  205. // between CMKs and DEKs, see the following:
  206. //
  207. // The GenerateDataKey operation
  208. //
  209. // AWS Key Management Service Concepts (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html)
  210. // in the AWS Key Management Service Developer Guide
  211. func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) {
  212. req, out := c.CreateKeyRequest(input)
  213. err := req.Send()
  214. return out, err
  215. }
  216. const opDecrypt = "Decrypt"
  217. // DecryptRequest generates a "aws/request.Request" representing the
  218. // client's request for the Decrypt operation. The "output" return
  219. // value can be used to capture response data after the request's "Send" method
  220. // is called.
  221. //
  222. // Creating a request object using this method should be used when you want to inject
  223. // custom logic into the request's lifecycle using a custom handler, or if you want to
  224. // access properties on the request object before or after sending the request. If
  225. // you just want the service response, call the Decrypt method directly
  226. // instead.
  227. //
  228. // Note: You must call the "Send" method on the returned request object in order
  229. // to execute the request.
  230. //
  231. // // Example sending a request using the DecryptRequest method.
  232. // req, resp := client.DecryptRequest(params)
  233. //
  234. // err := req.Send()
  235. // if err == nil { // resp is now filled
  236. // fmt.Println(resp)
  237. // }
  238. //
  239. func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput) {
  240. op := &request.Operation{
  241. Name: opDecrypt,
  242. HTTPMethod: "POST",
  243. HTTPPath: "/",
  244. }
  245. if input == nil {
  246. input = &DecryptInput{}
  247. }
  248. req = c.newRequest(op, input, output)
  249. output = &DecryptOutput{}
  250. req.Data = output
  251. return
  252. }
  253. // Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted
  254. // by using any of the following functions:
  255. //
  256. // GenerateDataKey
  257. //
  258. // GenerateDataKeyWithoutPlaintext
  259. //
  260. // Encrypt
  261. //
  262. // Note that if a caller has been granted access permissions to all keys
  263. // (through, for example, IAM user policies that grant Decrypt permission on
  264. // all resources), then ciphertext encrypted by using keys in other accounts
  265. // where the key grants access to the caller can be decrypted. To remedy this,
  266. // we recommend that you do not grant Decrypt access in an IAM user policy.
  267. // Instead grant Decrypt access only in key policies. If you must grant Decrypt
  268. // access in an IAM user policy, you should scope the resource to specific keys
  269. // or to specific trusted accounts.
  270. func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) {
  271. req, out := c.DecryptRequest(input)
  272. err := req.Send()
  273. return out, err
  274. }
  275. const opDeleteAlias = "DeleteAlias"
  276. // DeleteAliasRequest generates a "aws/request.Request" representing the
  277. // client's request for the DeleteAlias operation. The "output" return
  278. // value can be used to capture response data after the request's "Send" method
  279. // is called.
  280. //
  281. // Creating a request object using this method should be used when you want to inject
  282. // custom logic into the request's lifecycle using a custom handler, or if you want to
  283. // access properties on the request object before or after sending the request. If
  284. // you just want the service response, call the DeleteAlias method directly
  285. // instead.
  286. //
  287. // Note: You must call the "Send" method on the returned request object in order
  288. // to execute the request.
  289. //
  290. // // Example sending a request using the DeleteAliasRequest method.
  291. // req, resp := client.DeleteAliasRequest(params)
  292. //
  293. // err := req.Send()
  294. // if err == nil { // resp is now filled
  295. // fmt.Println(resp)
  296. // }
  297. //
  298. func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) {
  299. op := &request.Operation{
  300. Name: opDeleteAlias,
  301. HTTPMethod: "POST",
  302. HTTPPath: "/",
  303. }
  304. if input == nil {
  305. input = &DeleteAliasInput{}
  306. }
  307. req = c.newRequest(op, input, output)
  308. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  309. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  310. output = &DeleteAliasOutput{}
  311. req.Data = output
  312. return
  313. }
  314. // Deletes the specified alias. To map an alias to a different key, call UpdateAlias.
  315. func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) {
  316. req, out := c.DeleteAliasRequest(input)
  317. err := req.Send()
  318. return out, err
  319. }
  320. const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial"
  321. // DeleteImportedKeyMaterialRequest generates a "aws/request.Request" representing the
  322. // client's request for the DeleteImportedKeyMaterial operation. The "output" return
  323. // value can be used to capture response data after the request's "Send" method
  324. // is called.
  325. //
  326. // Creating a request object using this method should be used when you want to inject
  327. // custom logic into the request's lifecycle using a custom handler, or if you want to
  328. // access properties on the request object before or after sending the request. If
  329. // you just want the service response, call the DeleteImportedKeyMaterial method directly
  330. // instead.
  331. //
  332. // Note: You must call the "Send" method on the returned request object in order
  333. // to execute the request.
  334. //
  335. // // Example sending a request using the DeleteImportedKeyMaterialRequest method.
  336. // req, resp := client.DeleteImportedKeyMaterialRequest(params)
  337. //
  338. // err := req.Send()
  339. // if err == nil { // resp is now filled
  340. // fmt.Println(resp)
  341. // }
  342. //
  343. func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialInput) (req *request.Request, output *DeleteImportedKeyMaterialOutput) {
  344. op := &request.Operation{
  345. Name: opDeleteImportedKeyMaterial,
  346. HTTPMethod: "POST",
  347. HTTPPath: "/",
  348. }
  349. if input == nil {
  350. input = &DeleteImportedKeyMaterialInput{}
  351. }
  352. req = c.newRequest(op, input, output)
  353. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  354. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  355. output = &DeleteImportedKeyMaterialOutput{}
  356. req.Data = output
  357. return
  358. }
  359. // Deletes key material that you previously imported and makes the specified
  360. // customer master key (CMK) unusable. For more information about importing
  361. // key material into AWS KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  362. // in the AWS Key Management Service Developer Guide.
  363. //
  364. // When the specified CMK is in the PendingDeletion state, this operation does
  365. // not change the CMK's state. Otherwise, it changes the CMK's state to PendingImport.
  366. //
  367. // After you delete key material, you can use ImportKeyMaterial to reimport
  368. // the same key material into the CMK.
  369. func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) {
  370. req, out := c.DeleteImportedKeyMaterialRequest(input)
  371. err := req.Send()
  372. return out, err
  373. }
  374. const opDescribeKey = "DescribeKey"
  375. // DescribeKeyRequest generates a "aws/request.Request" representing the
  376. // client's request for the DescribeKey operation. The "output" return
  377. // value can be used to capture response data after the request's "Send" method
  378. // is called.
  379. //
  380. // Creating a request object using this method should be used when you want to inject
  381. // custom logic into the request's lifecycle using a custom handler, or if you want to
  382. // access properties on the request object before or after sending the request. If
  383. // you just want the service response, call the DescribeKey method directly
  384. // instead.
  385. //
  386. // Note: You must call the "Send" method on the returned request object in order
  387. // to execute the request.
  388. //
  389. // // Example sending a request using the DescribeKeyRequest method.
  390. // req, resp := client.DescribeKeyRequest(params)
  391. //
  392. // err := req.Send()
  393. // if err == nil { // resp is now filled
  394. // fmt.Println(resp)
  395. // }
  396. //
  397. func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput) {
  398. op := &request.Operation{
  399. Name: opDescribeKey,
  400. HTTPMethod: "POST",
  401. HTTPPath: "/",
  402. }
  403. if input == nil {
  404. input = &DescribeKeyInput{}
  405. }
  406. req = c.newRequest(op, input, output)
  407. output = &DescribeKeyOutput{}
  408. req.Data = output
  409. return
  410. }
  411. // Provides detailed information about the specified customer master key.
  412. func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) {
  413. req, out := c.DescribeKeyRequest(input)
  414. err := req.Send()
  415. return out, err
  416. }
  417. const opDisableKey = "DisableKey"
  418. // DisableKeyRequest generates a "aws/request.Request" representing the
  419. // client's request for the DisableKey operation. The "output" return
  420. // value can be used to capture response data after the request's "Send" method
  421. // is called.
  422. //
  423. // Creating a request object using this method should be used when you want to inject
  424. // custom logic into the request's lifecycle using a custom handler, or if you want to
  425. // access properties on the request object before or after sending the request. If
  426. // you just want the service response, call the DisableKey method directly
  427. // instead.
  428. //
  429. // Note: You must call the "Send" method on the returned request object in order
  430. // to execute the request.
  431. //
  432. // // Example sending a request using the DisableKeyRequest method.
  433. // req, resp := client.DisableKeyRequest(params)
  434. //
  435. // err := req.Send()
  436. // if err == nil { // resp is now filled
  437. // fmt.Println(resp)
  438. // }
  439. //
  440. func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput) {
  441. op := &request.Operation{
  442. Name: opDisableKey,
  443. HTTPMethod: "POST",
  444. HTTPPath: "/",
  445. }
  446. if input == nil {
  447. input = &DisableKeyInput{}
  448. }
  449. req = c.newRequest(op, input, output)
  450. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  451. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  452. output = &DisableKeyOutput{}
  453. req.Data = output
  454. return
  455. }
  456. // Sets the state of a customer master key (CMK) to disabled, thereby preventing
  457. // its use for cryptographic operations. For more information about how key
  458. // state affects the use of a CMK, see How Key State Affects the Use of a Customer
  459. // Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  460. // in the AWS Key Management Service Developer Guide.
  461. func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) {
  462. req, out := c.DisableKeyRequest(input)
  463. err := req.Send()
  464. return out, err
  465. }
  466. const opDisableKeyRotation = "DisableKeyRotation"
  467. // DisableKeyRotationRequest generates a "aws/request.Request" representing the
  468. // client's request for the DisableKeyRotation operation. The "output" return
  469. // value can be used to capture response data after the request's "Send" method
  470. // is called.
  471. //
  472. // Creating a request object using this method should be used when you want to inject
  473. // custom logic into the request's lifecycle using a custom handler, or if you want to
  474. // access properties on the request object before or after sending the request. If
  475. // you just want the service response, call the DisableKeyRotation method directly
  476. // instead.
  477. //
  478. // Note: You must call the "Send" method on the returned request object in order
  479. // to execute the request.
  480. //
  481. // // Example sending a request using the DisableKeyRotationRequest method.
  482. // req, resp := client.DisableKeyRotationRequest(params)
  483. //
  484. // err := req.Send()
  485. // if err == nil { // resp is now filled
  486. // fmt.Println(resp)
  487. // }
  488. //
  489. func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput) {
  490. op := &request.Operation{
  491. Name: opDisableKeyRotation,
  492. HTTPMethod: "POST",
  493. HTTPPath: "/",
  494. }
  495. if input == nil {
  496. input = &DisableKeyRotationInput{}
  497. }
  498. req = c.newRequest(op, input, output)
  499. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  500. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  501. output = &DisableKeyRotationOutput{}
  502. req.Data = output
  503. return
  504. }
  505. // Disables rotation of the specified key.
  506. func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) {
  507. req, out := c.DisableKeyRotationRequest(input)
  508. err := req.Send()
  509. return out, err
  510. }
  511. const opEnableKey = "EnableKey"
  512. // EnableKeyRequest generates a "aws/request.Request" representing the
  513. // client's request for the EnableKey operation. The "output" return
  514. // value can be used to capture response data after the request's "Send" method
  515. // is called.
  516. //
  517. // Creating a request object using this method should be used when you want to inject
  518. // custom logic into the request's lifecycle using a custom handler, or if you want to
  519. // access properties on the request object before or after sending the request. If
  520. // you just want the service response, call the EnableKey method directly
  521. // instead.
  522. //
  523. // Note: You must call the "Send" method on the returned request object in order
  524. // to execute the request.
  525. //
  526. // // Example sending a request using the EnableKeyRequest method.
  527. // req, resp := client.EnableKeyRequest(params)
  528. //
  529. // err := req.Send()
  530. // if err == nil { // resp is now filled
  531. // fmt.Println(resp)
  532. // }
  533. //
  534. func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput) {
  535. op := &request.Operation{
  536. Name: opEnableKey,
  537. HTTPMethod: "POST",
  538. HTTPPath: "/",
  539. }
  540. if input == nil {
  541. input = &EnableKeyInput{}
  542. }
  543. req = c.newRequest(op, input, output)
  544. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  545. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  546. output = &EnableKeyOutput{}
  547. req.Data = output
  548. return
  549. }
  550. // Marks a key as enabled, thereby permitting its use.
  551. func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) {
  552. req, out := c.EnableKeyRequest(input)
  553. err := req.Send()
  554. return out, err
  555. }
  556. const opEnableKeyRotation = "EnableKeyRotation"
  557. // EnableKeyRotationRequest generates a "aws/request.Request" representing the
  558. // client's request for the EnableKeyRotation operation. The "output" return
  559. // value can be used to capture response data after the request's "Send" method
  560. // is called.
  561. //
  562. // Creating a request object using this method should be used when you want to inject
  563. // custom logic into the request's lifecycle using a custom handler, or if you want to
  564. // access properties on the request object before or after sending the request. If
  565. // you just want the service response, call the EnableKeyRotation method directly
  566. // instead.
  567. //
  568. // Note: You must call the "Send" method on the returned request object in order
  569. // to execute the request.
  570. //
  571. // // Example sending a request using the EnableKeyRotationRequest method.
  572. // req, resp := client.EnableKeyRotationRequest(params)
  573. //
  574. // err := req.Send()
  575. // if err == nil { // resp is now filled
  576. // fmt.Println(resp)
  577. // }
  578. //
  579. func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput) {
  580. op := &request.Operation{
  581. Name: opEnableKeyRotation,
  582. HTTPMethod: "POST",
  583. HTTPPath: "/",
  584. }
  585. if input == nil {
  586. input = &EnableKeyRotationInput{}
  587. }
  588. req = c.newRequest(op, input, output)
  589. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  590. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  591. output = &EnableKeyRotationOutput{}
  592. req.Data = output
  593. return
  594. }
  595. // Enables rotation of the specified customer master key.
  596. func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) {
  597. req, out := c.EnableKeyRotationRequest(input)
  598. err := req.Send()
  599. return out, err
  600. }
  601. const opEncrypt = "Encrypt"
  602. // EncryptRequest generates a "aws/request.Request" representing the
  603. // client's request for the Encrypt operation. The "output" return
  604. // value can be used to capture response data after the request's "Send" method
  605. // is called.
  606. //
  607. // Creating a request object using this method should be used when you want to inject
  608. // custom logic into the request's lifecycle using a custom handler, or if you want to
  609. // access properties on the request object before or after sending the request. If
  610. // you just want the service response, call the Encrypt method directly
  611. // instead.
  612. //
  613. // Note: You must call the "Send" method on the returned request object in order
  614. // to execute the request.
  615. //
  616. // // Example sending a request using the EncryptRequest method.
  617. // req, resp := client.EncryptRequest(params)
  618. //
  619. // err := req.Send()
  620. // if err == nil { // resp is now filled
  621. // fmt.Println(resp)
  622. // }
  623. //
  624. func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput) {
  625. op := &request.Operation{
  626. Name: opEncrypt,
  627. HTTPMethod: "POST",
  628. HTTPPath: "/",
  629. }
  630. if input == nil {
  631. input = &EncryptInput{}
  632. }
  633. req = c.newRequest(op, input, output)
  634. output = &EncryptOutput{}
  635. req.Data = output
  636. return
  637. }
  638. // Encrypts plaintext into ciphertext by using a customer master key. The Encrypt
  639. // function has two primary use cases:
  640. //
  641. // You can encrypt up to 4 KB of arbitrary data such as an RSA key, a database
  642. // password, or other sensitive customer information.
  643. //
  644. // If you are moving encrypted data from one region to another, you can use
  645. // this API to encrypt in the new region the plaintext data key that was used
  646. // to encrypt the data in the original region. This provides you with an encrypted
  647. // copy of the data key that can be decrypted in the new region and used there
  648. // to decrypt the encrypted data.
  649. //
  650. // Unless you are moving encrypted data from one region to another, you don't
  651. // use this function to encrypt a generated data key within a region. You retrieve
  652. // data keys already encrypted by calling the GenerateDataKey or GenerateDataKeyWithoutPlaintext
  653. // function. Data keys don't need to be encrypted again by calling Encrypt.
  654. //
  655. // If you want to encrypt data locally in your application, you can use the
  656. // GenerateDataKey function to return a plaintext data encryption key and a
  657. // copy of the key encrypted under the customer master key (CMK) of your choosing.
  658. func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) {
  659. req, out := c.EncryptRequest(input)
  660. err := req.Send()
  661. return out, err
  662. }
  663. const opGenerateDataKey = "GenerateDataKey"
  664. // GenerateDataKeyRequest generates a "aws/request.Request" representing the
  665. // client's request for the GenerateDataKey operation. The "output" return
  666. // value can be used to capture response data after the request's "Send" method
  667. // is called.
  668. //
  669. // Creating a request object using this method should be used when you want to inject
  670. // custom logic into the request's lifecycle using a custom handler, or if you want to
  671. // access properties on the request object before or after sending the request. If
  672. // you just want the service response, call the GenerateDataKey method directly
  673. // instead.
  674. //
  675. // Note: You must call the "Send" method on the returned request object in order
  676. // to execute the request.
  677. //
  678. // // Example sending a request using the GenerateDataKeyRequest method.
  679. // req, resp := client.GenerateDataKeyRequest(params)
  680. //
  681. // err := req.Send()
  682. // if err == nil { // resp is now filled
  683. // fmt.Println(resp)
  684. // }
  685. //
  686. func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput) {
  687. op := &request.Operation{
  688. Name: opGenerateDataKey,
  689. HTTPMethod: "POST",
  690. HTTPPath: "/",
  691. }
  692. if input == nil {
  693. input = &GenerateDataKeyInput{}
  694. }
  695. req = c.newRequest(op, input, output)
  696. output = &GenerateDataKeyOutput{}
  697. req.Data = output
  698. return
  699. }
  700. // Generates a data key that you can use in your application to locally encrypt
  701. // data. This call returns a plaintext version of the key in the Plaintext field
  702. // of the response object and an encrypted copy of the key in the CiphertextBlob
  703. // field. The key is encrypted by using the master key specified by the KeyId
  704. // field. To decrypt the encrypted key, pass it to the Decrypt API.
  705. //
  706. // We recommend that you use the following pattern to locally encrypt data:
  707. // call the GenerateDataKey API, use the key returned in the Plaintext response
  708. // field to locally encrypt data, and then erase the plaintext data key from
  709. // memory. Store the encrypted data key (contained in the CiphertextBlob field)
  710. // alongside of the locally encrypted data.
  711. //
  712. // You should not call the Encrypt function to re-encrypt your data keys within
  713. // a region. GenerateDataKey always returns the data key encrypted and tied
  714. // to the customer master key that will be used to decrypt it. There is no need
  715. // to decrypt it twice.
  716. //
  717. // If you decide to use the optional EncryptionContext parameter, you must
  718. // also store the context in full or at least store enough information along
  719. // with the encrypted data to be able to reconstruct the context when submitting
  720. // the ciphertext to the Decrypt API. It is a good practice to choose a context
  721. // that you can reconstruct on the fly to better secure the ciphertext. For
  722. // more information about how this parameter is used, see Encryption Context
  723. // (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
  724. //
  725. // To decrypt data, pass the encrypted data key to the Decrypt API. Decrypt
  726. // uses the associated master key to decrypt the encrypted data key and returns
  727. // it as plaintext. Use the plaintext data key to locally decrypt your data
  728. // and then erase the key from memory. You must specify the encryption context,
  729. // if any, that you specified when you generated the key. The encryption context
  730. // is logged by CloudTrail, and you can use this log to help track the use of
  731. // particular data.
  732. func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) {
  733. req, out := c.GenerateDataKeyRequest(input)
  734. err := req.Send()
  735. return out, err
  736. }
  737. const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext"
  738. // GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the
  739. // client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return
  740. // value can be used to capture response data after the request's "Send" method
  741. // is called.
  742. //
  743. // Creating a request object using this method should be used when you want to inject
  744. // custom logic into the request's lifecycle using a custom handler, or if you want to
  745. // access properties on the request object before or after sending the request. If
  746. // you just want the service response, call the GenerateDataKeyWithoutPlaintext method directly
  747. // instead.
  748. //
  749. // Note: You must call the "Send" method on the returned request object in order
  750. // to execute the request.
  751. //
  752. // // Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method.
  753. // req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params)
  754. //
  755. // err := req.Send()
  756. // if err == nil { // resp is now filled
  757. // fmt.Println(resp)
  758. // }
  759. //
  760. func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) {
  761. op := &request.Operation{
  762. Name: opGenerateDataKeyWithoutPlaintext,
  763. HTTPMethod: "POST",
  764. HTTPPath: "/",
  765. }
  766. if input == nil {
  767. input = &GenerateDataKeyWithoutPlaintextInput{}
  768. }
  769. req = c.newRequest(op, input, output)
  770. output = &GenerateDataKeyWithoutPlaintextOutput{}
  771. req.Data = output
  772. return
  773. }
  774. // Returns a data key encrypted by a customer master key without the plaintext
  775. // copy of that key. Otherwise, this API functions exactly like GenerateDataKey.
  776. // You can use this API to, for example, satisfy an audit requirement that an
  777. // encrypted key be made available without exposing the plaintext copy of that
  778. // key.
  779. func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) {
  780. req, out := c.GenerateDataKeyWithoutPlaintextRequest(input)
  781. err := req.Send()
  782. return out, err
  783. }
  784. const opGenerateRandom = "GenerateRandom"
  785. // GenerateRandomRequest generates a "aws/request.Request" representing the
  786. // client's request for the GenerateRandom operation. The "output" return
  787. // value can be used to capture response data after the request's "Send" method
  788. // is called.
  789. //
  790. // Creating a request object using this method should be used when you want to inject
  791. // custom logic into the request's lifecycle using a custom handler, or if you want to
  792. // access properties on the request object before or after sending the request. If
  793. // you just want the service response, call the GenerateRandom method directly
  794. // instead.
  795. //
  796. // Note: You must call the "Send" method on the returned request object in order
  797. // to execute the request.
  798. //
  799. // // Example sending a request using the GenerateRandomRequest method.
  800. // req, resp := client.GenerateRandomRequest(params)
  801. //
  802. // err := req.Send()
  803. // if err == nil { // resp is now filled
  804. // fmt.Println(resp)
  805. // }
  806. //
  807. func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) {
  808. op := &request.Operation{
  809. Name: opGenerateRandom,
  810. HTTPMethod: "POST",
  811. HTTPPath: "/",
  812. }
  813. if input == nil {
  814. input = &GenerateRandomInput{}
  815. }
  816. req = c.newRequest(op, input, output)
  817. output = &GenerateRandomOutput{}
  818. req.Data = output
  819. return
  820. }
  821. // Generates an unpredictable byte string.
  822. func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) {
  823. req, out := c.GenerateRandomRequest(input)
  824. err := req.Send()
  825. return out, err
  826. }
  827. const opGetKeyPolicy = "GetKeyPolicy"
  828. // GetKeyPolicyRequest generates a "aws/request.Request" representing the
  829. // client's request for the GetKeyPolicy operation. The "output" return
  830. // value can be used to capture response data after the request's "Send" method
  831. // is called.
  832. //
  833. // Creating a request object using this method should be used when you want to inject
  834. // custom logic into the request's lifecycle using a custom handler, or if you want to
  835. // access properties on the request object before or after sending the request. If
  836. // you just want the service response, call the GetKeyPolicy method directly
  837. // instead.
  838. //
  839. // Note: You must call the "Send" method on the returned request object in order
  840. // to execute the request.
  841. //
  842. // // Example sending a request using the GetKeyPolicyRequest method.
  843. // req, resp := client.GetKeyPolicyRequest(params)
  844. //
  845. // err := req.Send()
  846. // if err == nil { // resp is now filled
  847. // fmt.Println(resp)
  848. // }
  849. //
  850. func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) {
  851. op := &request.Operation{
  852. Name: opGetKeyPolicy,
  853. HTTPMethod: "POST",
  854. HTTPPath: "/",
  855. }
  856. if input == nil {
  857. input = &GetKeyPolicyInput{}
  858. }
  859. req = c.newRequest(op, input, output)
  860. output = &GetKeyPolicyOutput{}
  861. req.Data = output
  862. return
  863. }
  864. // Retrieves a policy attached to the specified key.
  865. func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) {
  866. req, out := c.GetKeyPolicyRequest(input)
  867. err := req.Send()
  868. return out, err
  869. }
  870. const opGetKeyRotationStatus = "GetKeyRotationStatus"
  871. // GetKeyRotationStatusRequest generates a "aws/request.Request" representing the
  872. // client's request for the GetKeyRotationStatus operation. The "output" return
  873. // value can be used to capture response data after the request's "Send" method
  874. // is called.
  875. //
  876. // Creating a request object using this method should be used when you want to inject
  877. // custom logic into the request's lifecycle using a custom handler, or if you want to
  878. // access properties on the request object before or after sending the request. If
  879. // you just want the service response, call the GetKeyRotationStatus method directly
  880. // instead.
  881. //
  882. // Note: You must call the "Send" method on the returned request object in order
  883. // to execute the request.
  884. //
  885. // // Example sending a request using the GetKeyRotationStatusRequest method.
  886. // req, resp := client.GetKeyRotationStatusRequest(params)
  887. //
  888. // err := req.Send()
  889. // if err == nil { // resp is now filled
  890. // fmt.Println(resp)
  891. // }
  892. //
  893. func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput) {
  894. op := &request.Operation{
  895. Name: opGetKeyRotationStatus,
  896. HTTPMethod: "POST",
  897. HTTPPath: "/",
  898. }
  899. if input == nil {
  900. input = &GetKeyRotationStatusInput{}
  901. }
  902. req = c.newRequest(op, input, output)
  903. output = &GetKeyRotationStatusOutput{}
  904. req.Data = output
  905. return
  906. }
  907. // Retrieves a Boolean value that indicates whether key rotation is enabled
  908. // for the specified key.
  909. func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) {
  910. req, out := c.GetKeyRotationStatusRequest(input)
  911. err := req.Send()
  912. return out, err
  913. }
  914. const opGetParametersForImport = "GetParametersForImport"
  915. // GetParametersForImportRequest generates a "aws/request.Request" representing the
  916. // client's request for the GetParametersForImport operation. The "output" return
  917. // value can be used to capture response data after the request's "Send" method
  918. // is called.
  919. //
  920. // Creating a request object using this method should be used when you want to inject
  921. // custom logic into the request's lifecycle using a custom handler, or if you want to
  922. // access properties on the request object before or after sending the request. If
  923. // you just want the service response, call the GetParametersForImport method directly
  924. // instead.
  925. //
  926. // Note: You must call the "Send" method on the returned request object in order
  927. // to execute the request.
  928. //
  929. // // Example sending a request using the GetParametersForImportRequest method.
  930. // req, resp := client.GetParametersForImportRequest(params)
  931. //
  932. // err := req.Send()
  933. // if err == nil { // resp is now filled
  934. // fmt.Println(resp)
  935. // }
  936. //
  937. func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) (req *request.Request, output *GetParametersForImportOutput) {
  938. op := &request.Operation{
  939. Name: opGetParametersForImport,
  940. HTTPMethod: "POST",
  941. HTTPPath: "/",
  942. }
  943. if input == nil {
  944. input = &GetParametersForImportInput{}
  945. }
  946. req = c.newRequest(op, input, output)
  947. output = &GetParametersForImportOutput{}
  948. req.Data = output
  949. return
  950. }
  951. // Returns the items you need in order to import key material into AWS KMS from
  952. // your existing key management infrastructure. For more information about importing
  953. // key material into AWS KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  954. // in the AWS Key Management Service Developer Guide.
  955. //
  956. // You must specify the key ID of the customer master key (CMK) into which
  957. // you will import key material. This CMK's Origin must be EXTERNAL. You must
  958. // also specify the wrapping algorithm and type of wrapping key (public key)
  959. // that you will use to encrypt the key material.
  960. //
  961. // This operation returns a public key and an import token. Use the public
  962. // key to encrypt the key material. Store the import token to send with a subsequent
  963. // ImportKeyMaterial request. The public key and import token from the same
  964. // response must be used together. These items are valid for 24 hours, after
  965. // which they cannot be used for a subsequent ImportKeyMaterial request. To
  966. // retrieve new ones, send another GetParametersForImport request.
  967. func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) {
  968. req, out := c.GetParametersForImportRequest(input)
  969. err := req.Send()
  970. return out, err
  971. }
  972. const opImportKeyMaterial = "ImportKeyMaterial"
  973. // ImportKeyMaterialRequest generates a "aws/request.Request" representing the
  974. // client's request for the ImportKeyMaterial operation. The "output" return
  975. // value can be used to capture response data after the request's "Send" method
  976. // is called.
  977. //
  978. // Creating a request object using this method should be used when you want to inject
  979. // custom logic into the request's lifecycle using a custom handler, or if you want to
  980. // access properties on the request object before or after sending the request. If
  981. // you just want the service response, call the ImportKeyMaterial method directly
  982. // instead.
  983. //
  984. // Note: You must call the "Send" method on the returned request object in order
  985. // to execute the request.
  986. //
  987. // // Example sending a request using the ImportKeyMaterialRequest method.
  988. // req, resp := client.ImportKeyMaterialRequest(params)
  989. //
  990. // err := req.Send()
  991. // if err == nil { // resp is now filled
  992. // fmt.Println(resp)
  993. // }
  994. //
  995. func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *request.Request, output *ImportKeyMaterialOutput) {
  996. op := &request.Operation{
  997. Name: opImportKeyMaterial,
  998. HTTPMethod: "POST",
  999. HTTPPath: "/",
  1000. }
  1001. if input == nil {
  1002. input = &ImportKeyMaterialInput{}
  1003. }
  1004. req = c.newRequest(op, input, output)
  1005. output = &ImportKeyMaterialOutput{}
  1006. req.Data = output
  1007. return
  1008. }
  1009. // Imports key material into an AWS KMS customer master key (CMK) from your
  1010. // existing key management infrastructure. For more information about importing
  1011. // key material into AWS KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  1012. // in the AWS Key Management Service Developer Guide.
  1013. //
  1014. // You must specify the key ID of the CMK to import the key material into.
  1015. // This CMK's Origin must be EXTERNAL. You must also send an import token and
  1016. // the encrypted key material. Send the import token that you received in the
  1017. // same GetParametersForImport response that contained the public key that you
  1018. // used to encrypt the key material. You must also specify whether the key material
  1019. // expires and if so, when. When the key material expires, AWS KMS deletes the
  1020. // key material and the CMK becomes unusable. To use the CMK again, you can
  1021. // reimport the same key material. If you set an expiration date, you can change
  1022. // it only by reimporting the same key material and specifying a new expiration
  1023. // date.
  1024. //
  1025. // When this operation is successful, the specified CMK's key state changes
  1026. // to Enabled, and you can use the CMK.
  1027. //
  1028. // After you successfully import key material into a CMK, you can reimport
  1029. // the same key material into that CMK, but you cannot import different key
  1030. // material.
  1031. func (c *KMS) ImportKeyMaterial(input *ImportKeyMaterialInput) (*ImportKeyMaterialOutput, error) {
  1032. req, out := c.ImportKeyMaterialRequest(input)
  1033. err := req.Send()
  1034. return out, err
  1035. }
  1036. const opListAliases = "ListAliases"
  1037. // ListAliasesRequest generates a "aws/request.Request" representing the
  1038. // client's request for the ListAliases operation. The "output" return
  1039. // value can be used to capture response data after the request's "Send" method
  1040. // is called.
  1041. //
  1042. // Creating a request object using this method should be used when you want to inject
  1043. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1044. // access properties on the request object before or after sending the request. If
  1045. // you just want the service response, call the ListAliases method directly
  1046. // instead.
  1047. //
  1048. // Note: You must call the "Send" method on the returned request object in order
  1049. // to execute the request.
  1050. //
  1051. // // Example sending a request using the ListAliasesRequest method.
  1052. // req, resp := client.ListAliasesRequest(params)
  1053. //
  1054. // err := req.Send()
  1055. // if err == nil { // resp is now filled
  1056. // fmt.Println(resp)
  1057. // }
  1058. //
  1059. func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) {
  1060. op := &request.Operation{
  1061. Name: opListAliases,
  1062. HTTPMethod: "POST",
  1063. HTTPPath: "/",
  1064. Paginator: &request.Paginator{
  1065. InputTokens: []string{"Marker"},
  1066. OutputTokens: []string{"NextMarker"},
  1067. LimitToken: "Limit",
  1068. TruncationToken: "Truncated",
  1069. },
  1070. }
  1071. if input == nil {
  1072. input = &ListAliasesInput{}
  1073. }
  1074. req = c.newRequest(op, input, output)
  1075. output = &ListAliasesOutput{}
  1076. req.Data = output
  1077. return
  1078. }
  1079. // Lists all of the key aliases in the account.
  1080. func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) {
  1081. req, out := c.ListAliasesRequest(input)
  1082. err := req.Send()
  1083. return out, err
  1084. }
  1085. // ListAliasesPages iterates over the pages of a ListAliases operation,
  1086. // calling the "fn" function with the response data for each page. To stop
  1087. // iterating, return false from the fn function.
  1088. //
  1089. // See ListAliases method for more information on how to use this operation.
  1090. //
  1091. // Note: This operation can generate multiple requests to a service.
  1092. //
  1093. // // Example iterating over at most 3 pages of a ListAliases operation.
  1094. // pageNum := 0
  1095. // err := client.ListAliasesPages(params,
  1096. // func(page *ListAliasesOutput, lastPage bool) bool {
  1097. // pageNum++
  1098. // fmt.Println(page)
  1099. // return pageNum <= 3
  1100. // })
  1101. //
  1102. func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(p *ListAliasesOutput, lastPage bool) (shouldContinue bool)) error {
  1103. page, _ := c.ListAliasesRequest(input)
  1104. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1105. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1106. return fn(p.(*ListAliasesOutput), lastPage)
  1107. })
  1108. }
  1109. const opListGrants = "ListGrants"
  1110. // ListGrantsRequest generates a "aws/request.Request" representing the
  1111. // client's request for the ListGrants operation. The "output" return
  1112. // value can be used to capture response data after the request's "Send" method
  1113. // is called.
  1114. //
  1115. // Creating a request object using this method should be used when you want to inject
  1116. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1117. // access properties on the request object before or after sending the request. If
  1118. // you just want the service response, call the ListGrants method directly
  1119. // instead.
  1120. //
  1121. // Note: You must call the "Send" method on the returned request object in order
  1122. // to execute the request.
  1123. //
  1124. // // Example sending a request using the ListGrantsRequest method.
  1125. // req, resp := client.ListGrantsRequest(params)
  1126. //
  1127. // err := req.Send()
  1128. // if err == nil { // resp is now filled
  1129. // fmt.Println(resp)
  1130. // }
  1131. //
  1132. func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse) {
  1133. op := &request.Operation{
  1134. Name: opListGrants,
  1135. HTTPMethod: "POST",
  1136. HTTPPath: "/",
  1137. Paginator: &request.Paginator{
  1138. InputTokens: []string{"Marker"},
  1139. OutputTokens: []string{"NextMarker"},
  1140. LimitToken: "Limit",
  1141. TruncationToken: "Truncated",
  1142. },
  1143. }
  1144. if input == nil {
  1145. input = &ListGrantsInput{}
  1146. }
  1147. req = c.newRequest(op, input, output)
  1148. output = &ListGrantsResponse{}
  1149. req.Data = output
  1150. return
  1151. }
  1152. // List the grants for a specified key.
  1153. func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) {
  1154. req, out := c.ListGrantsRequest(input)
  1155. err := req.Send()
  1156. return out, err
  1157. }
  1158. // ListGrantsPages iterates over the pages of a ListGrants operation,
  1159. // calling the "fn" function with the response data for each page. To stop
  1160. // iterating, return false from the fn function.
  1161. //
  1162. // See ListGrants method for more information on how to use this operation.
  1163. //
  1164. // Note: This operation can generate multiple requests to a service.
  1165. //
  1166. // // Example iterating over at most 3 pages of a ListGrants operation.
  1167. // pageNum := 0
  1168. // err := client.ListGrantsPages(params,
  1169. // func(page *ListGrantsResponse, lastPage bool) bool {
  1170. // pageNum++
  1171. // fmt.Println(page)
  1172. // return pageNum <= 3
  1173. // })
  1174. //
  1175. func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(p *ListGrantsResponse, lastPage bool) (shouldContinue bool)) error {
  1176. page, _ := c.ListGrantsRequest(input)
  1177. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1178. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1179. return fn(p.(*ListGrantsResponse), lastPage)
  1180. })
  1181. }
  1182. const opListKeyPolicies = "ListKeyPolicies"
  1183. // ListKeyPoliciesRequest generates a "aws/request.Request" representing the
  1184. // client's request for the ListKeyPolicies operation. The "output" return
  1185. // value can be used to capture response data after the request's "Send" method
  1186. // is called.
  1187. //
  1188. // Creating a request object using this method should be used when you want to inject
  1189. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1190. // access properties on the request object before or after sending the request. If
  1191. // you just want the service response, call the ListKeyPolicies method directly
  1192. // instead.
  1193. //
  1194. // Note: You must call the "Send" method on the returned request object in order
  1195. // to execute the request.
  1196. //
  1197. // // Example sending a request using the ListKeyPoliciesRequest method.
  1198. // req, resp := client.ListKeyPoliciesRequest(params)
  1199. //
  1200. // err := req.Send()
  1201. // if err == nil { // resp is now filled
  1202. // fmt.Println(resp)
  1203. // }
  1204. //
  1205. func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput) {
  1206. op := &request.Operation{
  1207. Name: opListKeyPolicies,
  1208. HTTPMethod: "POST",
  1209. HTTPPath: "/",
  1210. Paginator: &request.Paginator{
  1211. InputTokens: []string{"Marker"},
  1212. OutputTokens: []string{"NextMarker"},
  1213. LimitToken: "Limit",
  1214. TruncationToken: "Truncated",
  1215. },
  1216. }
  1217. if input == nil {
  1218. input = &ListKeyPoliciesInput{}
  1219. }
  1220. req = c.newRequest(op, input, output)
  1221. output = &ListKeyPoliciesOutput{}
  1222. req.Data = output
  1223. return
  1224. }
  1225. // Retrieves a list of policies attached to a key.
  1226. func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) {
  1227. req, out := c.ListKeyPoliciesRequest(input)
  1228. err := req.Send()
  1229. return out, err
  1230. }
  1231. // ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation,
  1232. // calling the "fn" function with the response data for each page. To stop
  1233. // iterating, return false from the fn function.
  1234. //
  1235. // See ListKeyPolicies method for more information on how to use this operation.
  1236. //
  1237. // Note: This operation can generate multiple requests to a service.
  1238. //
  1239. // // Example iterating over at most 3 pages of a ListKeyPolicies operation.
  1240. // pageNum := 0
  1241. // err := client.ListKeyPoliciesPages(params,
  1242. // func(page *ListKeyPoliciesOutput, lastPage bool) bool {
  1243. // pageNum++
  1244. // fmt.Println(page)
  1245. // return pageNum <= 3
  1246. // })
  1247. //
  1248. func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(p *ListKeyPoliciesOutput, lastPage bool) (shouldContinue bool)) error {
  1249. page, _ := c.ListKeyPoliciesRequest(input)
  1250. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1251. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1252. return fn(p.(*ListKeyPoliciesOutput), lastPage)
  1253. })
  1254. }
  1255. const opListKeys = "ListKeys"
  1256. // ListKeysRequest generates a "aws/request.Request" representing the
  1257. // client's request for the ListKeys operation. The "output" return
  1258. // value can be used to capture response data after the request's "Send" method
  1259. // is called.
  1260. //
  1261. // Creating a request object using this method should be used when you want to inject
  1262. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1263. // access properties on the request object before or after sending the request. If
  1264. // you just want the service response, call the ListKeys method directly
  1265. // instead.
  1266. //
  1267. // Note: You must call the "Send" method on the returned request object in order
  1268. // to execute the request.
  1269. //
  1270. // // Example sending a request using the ListKeysRequest method.
  1271. // req, resp := client.ListKeysRequest(params)
  1272. //
  1273. // err := req.Send()
  1274. // if err == nil { // resp is now filled
  1275. // fmt.Println(resp)
  1276. // }
  1277. //
  1278. func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) {
  1279. op := &request.Operation{
  1280. Name: opListKeys,
  1281. HTTPMethod: "POST",
  1282. HTTPPath: "/",
  1283. Paginator: &request.Paginator{
  1284. InputTokens: []string{"Marker"},
  1285. OutputTokens: []string{"NextMarker"},
  1286. LimitToken: "Limit",
  1287. TruncationToken: "Truncated",
  1288. },
  1289. }
  1290. if input == nil {
  1291. input = &ListKeysInput{}
  1292. }
  1293. req = c.newRequest(op, input, output)
  1294. output = &ListKeysOutput{}
  1295. req.Data = output
  1296. return
  1297. }
  1298. // Lists the customer master keys.
  1299. func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) {
  1300. req, out := c.ListKeysRequest(input)
  1301. err := req.Send()
  1302. return out, err
  1303. }
  1304. // ListKeysPages iterates over the pages of a ListKeys operation,
  1305. // calling the "fn" function with the response data for each page. To stop
  1306. // iterating, return false from the fn function.
  1307. //
  1308. // See ListKeys method for more information on how to use this operation.
  1309. //
  1310. // Note: This operation can generate multiple requests to a service.
  1311. //
  1312. // // Example iterating over at most 3 pages of a ListKeys operation.
  1313. // pageNum := 0
  1314. // err := client.ListKeysPages(params,
  1315. // func(page *ListKeysOutput, lastPage bool) bool {
  1316. // pageNum++
  1317. // fmt.Println(page)
  1318. // return pageNum <= 3
  1319. // })
  1320. //
  1321. func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(p *ListKeysOutput, lastPage bool) (shouldContinue bool)) error {
  1322. page, _ := c.ListKeysRequest(input)
  1323. page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator"))
  1324. return page.EachPage(func(p interface{}, lastPage bool) bool {
  1325. return fn(p.(*ListKeysOutput), lastPage)
  1326. })
  1327. }
  1328. const opListRetirableGrants = "ListRetirableGrants"
  1329. // ListRetirableGrantsRequest generates a "aws/request.Request" representing the
  1330. // client's request for the ListRetirableGrants operation. The "output" return
  1331. // value can be used to capture response data after the request's "Send" method
  1332. // is called.
  1333. //
  1334. // Creating a request object using this method should be used when you want to inject
  1335. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1336. // access properties on the request object before or after sending the request. If
  1337. // you just want the service response, call the ListRetirableGrants method directly
  1338. // instead.
  1339. //
  1340. // Note: You must call the "Send" method on the returned request object in order
  1341. // to execute the request.
  1342. //
  1343. // // Example sending a request using the ListRetirableGrantsRequest method.
  1344. // req, resp := client.ListRetirableGrantsRequest(params)
  1345. //
  1346. // err := req.Send()
  1347. // if err == nil { // resp is now filled
  1348. // fmt.Println(resp)
  1349. // }
  1350. //
  1351. func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse) {
  1352. op := &request.Operation{
  1353. Name: opListRetirableGrants,
  1354. HTTPMethod: "POST",
  1355. HTTPPath: "/",
  1356. }
  1357. if input == nil {
  1358. input = &ListRetirableGrantsInput{}
  1359. }
  1360. req = c.newRequest(op, input, output)
  1361. output = &ListGrantsResponse{}
  1362. req.Data = output
  1363. return
  1364. }
  1365. // Returns a list of all grants for which the grant's RetiringPrincipal matches
  1366. // the one specified.
  1367. //
  1368. // A typical use is to list all grants that you are able to retire. To retire
  1369. // a grant, use RetireGrant.
  1370. func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error) {
  1371. req, out := c.ListRetirableGrantsRequest(input)
  1372. err := req.Send()
  1373. return out, err
  1374. }
  1375. const opPutKeyPolicy = "PutKeyPolicy"
  1376. // PutKeyPolicyRequest generates a "aws/request.Request" representing the
  1377. // client's request for the PutKeyPolicy operation. The "output" return
  1378. // value can be used to capture response data after the request's "Send" method
  1379. // is called.
  1380. //
  1381. // Creating a request object using this method should be used when you want to inject
  1382. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1383. // access properties on the request object before or after sending the request. If
  1384. // you just want the service response, call the PutKeyPolicy method directly
  1385. // instead.
  1386. //
  1387. // Note: You must call the "Send" method on the returned request object in order
  1388. // to execute the request.
  1389. //
  1390. // // Example sending a request using the PutKeyPolicyRequest method.
  1391. // req, resp := client.PutKeyPolicyRequest(params)
  1392. //
  1393. // err := req.Send()
  1394. // if err == nil { // resp is now filled
  1395. // fmt.Println(resp)
  1396. // }
  1397. //
  1398. func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput) {
  1399. op := &request.Operation{
  1400. Name: opPutKeyPolicy,
  1401. HTTPMethod: "POST",
  1402. HTTPPath: "/",
  1403. }
  1404. if input == nil {
  1405. input = &PutKeyPolicyInput{}
  1406. }
  1407. req = c.newRequest(op, input, output)
  1408. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1409. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1410. output = &PutKeyPolicyOutput{}
  1411. req.Data = output
  1412. return
  1413. }
  1414. // Attaches a key policy to the specified customer master key (CMK).
  1415. //
  1416. // For more information about key policies, see Key Policies (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)
  1417. // in the AWS Key Management Service Developer Guide.
  1418. func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) {
  1419. req, out := c.PutKeyPolicyRequest(input)
  1420. err := req.Send()
  1421. return out, err
  1422. }
  1423. const opReEncrypt = "ReEncrypt"
  1424. // ReEncryptRequest generates a "aws/request.Request" representing the
  1425. // client's request for the ReEncrypt operation. The "output" return
  1426. // value can be used to capture response data after the request's "Send" method
  1427. // is called.
  1428. //
  1429. // Creating a request object using this method should be used when you want to inject
  1430. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1431. // access properties on the request object before or after sending the request. If
  1432. // you just want the service response, call the ReEncrypt method directly
  1433. // instead.
  1434. //
  1435. // Note: You must call the "Send" method on the returned request object in order
  1436. // to execute the request.
  1437. //
  1438. // // Example sending a request using the ReEncryptRequest method.
  1439. // req, resp := client.ReEncryptRequest(params)
  1440. //
  1441. // err := req.Send()
  1442. // if err == nil { // resp is now filled
  1443. // fmt.Println(resp)
  1444. // }
  1445. //
  1446. func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput) {
  1447. op := &request.Operation{
  1448. Name: opReEncrypt,
  1449. HTTPMethod: "POST",
  1450. HTTPPath: "/",
  1451. }
  1452. if input == nil {
  1453. input = &ReEncryptInput{}
  1454. }
  1455. req = c.newRequest(op, input, output)
  1456. output = &ReEncryptOutput{}
  1457. req.Data = output
  1458. return
  1459. }
  1460. // Encrypts data on the server side with a new customer master key without exposing
  1461. // the plaintext of the data on the client side. The data is first decrypted
  1462. // and then encrypted. This operation can also be used to change the encryption
  1463. // context of a ciphertext.
  1464. //
  1465. // Unlike other actions, ReEncrypt is authorized twice - once as ReEncryptFrom
  1466. // on the source key and once as ReEncryptTo on the destination key. We therefore
  1467. // recommend that you include the "action":"kms:ReEncrypt*" statement in your
  1468. // key policies to permit re-encryption from or to the key. The statement is
  1469. // included automatically when you authorize use of the key through the console
  1470. // but must be included manually when you set a policy by using the PutKeyPolicy
  1471. // function.
  1472. func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) {
  1473. req, out := c.ReEncryptRequest(input)
  1474. err := req.Send()
  1475. return out, err
  1476. }
  1477. const opRetireGrant = "RetireGrant"
  1478. // RetireGrantRequest generates a "aws/request.Request" representing the
  1479. // client's request for the RetireGrant operation. The "output" return
  1480. // value can be used to capture response data after the request's "Send" method
  1481. // is called.
  1482. //
  1483. // Creating a request object using this method should be used when you want to inject
  1484. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1485. // access properties on the request object before or after sending the request. If
  1486. // you just want the service response, call the RetireGrant method directly
  1487. // instead.
  1488. //
  1489. // Note: You must call the "Send" method on the returned request object in order
  1490. // to execute the request.
  1491. //
  1492. // // Example sending a request using the RetireGrantRequest method.
  1493. // req, resp := client.RetireGrantRequest(params)
  1494. //
  1495. // err := req.Send()
  1496. // if err == nil { // resp is now filled
  1497. // fmt.Println(resp)
  1498. // }
  1499. //
  1500. func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput) {
  1501. op := &request.Operation{
  1502. Name: opRetireGrant,
  1503. HTTPMethod: "POST",
  1504. HTTPPath: "/",
  1505. }
  1506. if input == nil {
  1507. input = &RetireGrantInput{}
  1508. }
  1509. req = c.newRequest(op, input, output)
  1510. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1511. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1512. output = &RetireGrantOutput{}
  1513. req.Data = output
  1514. return
  1515. }
  1516. // Retires a grant. You can retire a grant when you're done using it to clean
  1517. // up. You should revoke a grant when you intend to actively deny operations
  1518. // that depend on it. The following are permitted to call this API:
  1519. //
  1520. // The account that created the grant
  1521. //
  1522. // The RetiringPrincipal, if present
  1523. //
  1524. // The GranteePrincipal, if RetireGrant is a grantee operation
  1525. //
  1526. // The grant to retire must be identified by its grant token or by a combination
  1527. // of the key ARN and the grant ID. A grant token is a unique variable-length
  1528. // base64-encoded string. A grant ID is a 64 character unique identifier of
  1529. // a grant. Both are returned by the CreateGrant function.
  1530. func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) {
  1531. req, out := c.RetireGrantRequest(input)
  1532. err := req.Send()
  1533. return out, err
  1534. }
  1535. const opRevokeGrant = "RevokeGrant"
  1536. // RevokeGrantRequest generates a "aws/request.Request" representing the
  1537. // client's request for the RevokeGrant operation. The "output" return
  1538. // value can be used to capture response data after the request's "Send" method
  1539. // is called.
  1540. //
  1541. // Creating a request object using this method should be used when you want to inject
  1542. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1543. // access properties on the request object before or after sending the request. If
  1544. // you just want the service response, call the RevokeGrant method directly
  1545. // instead.
  1546. //
  1547. // Note: You must call the "Send" method on the returned request object in order
  1548. // to execute the request.
  1549. //
  1550. // // Example sending a request using the RevokeGrantRequest method.
  1551. // req, resp := client.RevokeGrantRequest(params)
  1552. //
  1553. // err := req.Send()
  1554. // if err == nil { // resp is now filled
  1555. // fmt.Println(resp)
  1556. // }
  1557. //
  1558. func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput) {
  1559. op := &request.Operation{
  1560. Name: opRevokeGrant,
  1561. HTTPMethod: "POST",
  1562. HTTPPath: "/",
  1563. }
  1564. if input == nil {
  1565. input = &RevokeGrantInput{}
  1566. }
  1567. req = c.newRequest(op, input, output)
  1568. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1569. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1570. output = &RevokeGrantOutput{}
  1571. req.Data = output
  1572. return
  1573. }
  1574. // Revokes a grant. You can revoke a grant to actively deny operations that
  1575. // depend on it.
  1576. func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) {
  1577. req, out := c.RevokeGrantRequest(input)
  1578. err := req.Send()
  1579. return out, err
  1580. }
  1581. const opScheduleKeyDeletion = "ScheduleKeyDeletion"
  1582. // ScheduleKeyDeletionRequest generates a "aws/request.Request" representing the
  1583. // client's request for the ScheduleKeyDeletion operation. The "output" return
  1584. // value can be used to capture response data after the request's "Send" method
  1585. // is called.
  1586. //
  1587. // Creating a request object using this method should be used when you want to inject
  1588. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1589. // access properties on the request object before or after sending the request. If
  1590. // you just want the service response, call the ScheduleKeyDeletion method directly
  1591. // instead.
  1592. //
  1593. // Note: You must call the "Send" method on the returned request object in order
  1594. // to execute the request.
  1595. //
  1596. // // Example sending a request using the ScheduleKeyDeletionRequest method.
  1597. // req, resp := client.ScheduleKeyDeletionRequest(params)
  1598. //
  1599. // err := req.Send()
  1600. // if err == nil { // resp is now filled
  1601. // fmt.Println(resp)
  1602. // }
  1603. //
  1604. func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput) {
  1605. op := &request.Operation{
  1606. Name: opScheduleKeyDeletion,
  1607. HTTPMethod: "POST",
  1608. HTTPPath: "/",
  1609. }
  1610. if input == nil {
  1611. input = &ScheduleKeyDeletionInput{}
  1612. }
  1613. req = c.newRequest(op, input, output)
  1614. output = &ScheduleKeyDeletionOutput{}
  1615. req.Data = output
  1616. return
  1617. }
  1618. // Schedules the deletion of a customer master key (CMK). You may provide a
  1619. // waiting period, specified in days, before deletion occurs. If you do not
  1620. // provide a waiting period, the default period of 30 days is used. When this
  1621. // operation is successful, the state of the CMK changes to PendingDeletion.
  1622. // Before the waiting period ends, you can use CancelKeyDeletion to cancel the
  1623. // deletion of the CMK. After the waiting period ends, AWS KMS deletes the CMK
  1624. // and all AWS KMS data associated with it, including all aliases that point
  1625. // to it.
  1626. //
  1627. // Deleting a CMK is a destructive and potentially dangerous operation. When
  1628. // a CMK is deleted, all data that was encrypted under the CMK is rendered unrecoverable.
  1629. // To restrict the use of a CMK without deleting it, use DisableKey.
  1630. //
  1631. // For more information about scheduling a CMK for deletion, see Deleting
  1632. // Customer Master Keys (http://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html)
  1633. // in the AWS Key Management Service Developer Guide.
  1634. func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) {
  1635. req, out := c.ScheduleKeyDeletionRequest(input)
  1636. err := req.Send()
  1637. return out, err
  1638. }
  1639. const opUpdateAlias = "UpdateAlias"
  1640. // UpdateAliasRequest generates a "aws/request.Request" representing the
  1641. // client's request for the UpdateAlias operation. The "output" return
  1642. // value can be used to capture response data after the request's "Send" method
  1643. // is called.
  1644. //
  1645. // Creating a request object using this method should be used when you want to inject
  1646. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1647. // access properties on the request object before or after sending the request. If
  1648. // you just want the service response, call the UpdateAlias method directly
  1649. // instead.
  1650. //
  1651. // Note: You must call the "Send" method on the returned request object in order
  1652. // to execute the request.
  1653. //
  1654. // // Example sending a request using the UpdateAliasRequest method.
  1655. // req, resp := client.UpdateAliasRequest(params)
  1656. //
  1657. // err := req.Send()
  1658. // if err == nil { // resp is now filled
  1659. // fmt.Println(resp)
  1660. // }
  1661. //
  1662. func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) {
  1663. op := &request.Operation{
  1664. Name: opUpdateAlias,
  1665. HTTPMethod: "POST",
  1666. HTTPPath: "/",
  1667. }
  1668. if input == nil {
  1669. input = &UpdateAliasInput{}
  1670. }
  1671. req = c.newRequest(op, input, output)
  1672. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1673. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1674. output = &UpdateAliasOutput{}
  1675. req.Data = output
  1676. return
  1677. }
  1678. // Updates an alias to map it to a different key.
  1679. //
  1680. // An alias is not a property of a key. Therefore, an alias can be mapped to
  1681. // and unmapped from an existing key without changing the properties of the
  1682. // key.
  1683. //
  1684. // An alias name can contain only alphanumeric characters, forward slashes
  1685. // (/), underscores (_), and dashes (-). An alias must start with the word "alias"
  1686. // followed by a forward slash (alias/). An alias that begins with "aws" after
  1687. // the forward slash (alias/aws...) is reserved by Amazon Web Services (AWS).
  1688. //
  1689. // The alias and the key it is mapped to must be in the same AWS account and
  1690. // the same region.
  1691. func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) {
  1692. req, out := c.UpdateAliasRequest(input)
  1693. err := req.Send()
  1694. return out, err
  1695. }
  1696. const opUpdateKeyDescription = "UpdateKeyDescription"
  1697. // UpdateKeyDescriptionRequest generates a "aws/request.Request" representing the
  1698. // client's request for the UpdateKeyDescription operation. The "output" return
  1699. // value can be used to capture response data after the request's "Send" method
  1700. // is called.
  1701. //
  1702. // Creating a request object using this method should be used when you want to inject
  1703. // custom logic into the request's lifecycle using a custom handler, or if you want to
  1704. // access properties on the request object before or after sending the request. If
  1705. // you just want the service response, call the UpdateKeyDescription method directly
  1706. // instead.
  1707. //
  1708. // Note: You must call the "Send" method on the returned request object in order
  1709. // to execute the request.
  1710. //
  1711. // // Example sending a request using the UpdateKeyDescriptionRequest method.
  1712. // req, resp := client.UpdateKeyDescriptionRequest(params)
  1713. //
  1714. // err := req.Send()
  1715. // if err == nil { // resp is now filled
  1716. // fmt.Println(resp)
  1717. // }
  1718. //
  1719. func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput) {
  1720. op := &request.Operation{
  1721. Name: opUpdateKeyDescription,
  1722. HTTPMethod: "POST",
  1723. HTTPPath: "/",
  1724. }
  1725. if input == nil {
  1726. input = &UpdateKeyDescriptionInput{}
  1727. }
  1728. req = c.newRequest(op, input, output)
  1729. req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
  1730. req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
  1731. output = &UpdateKeyDescriptionOutput{}
  1732. req.Data = output
  1733. return
  1734. }
  1735. // Updates the description of a key.
  1736. func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) {
  1737. req, out := c.UpdateKeyDescriptionRequest(input)
  1738. err := req.Send()
  1739. return out, err
  1740. }
  1741. // Contains information about an alias.
  1742. type AliasListEntry struct {
  1743. _ struct{} `type:"structure"`
  1744. // String that contains the key ARN.
  1745. AliasArn *string `min:"20" type:"string"`
  1746. // String that contains the alias.
  1747. AliasName *string `min:"1" type:"string"`
  1748. // String that contains the key identifier pointed to by the alias.
  1749. TargetKeyId *string `min:"1" type:"string"`
  1750. }
  1751. // String returns the string representation
  1752. func (s AliasListEntry) String() string {
  1753. return awsutil.Prettify(s)
  1754. }
  1755. // GoString returns the string representation
  1756. func (s AliasListEntry) GoString() string {
  1757. return s.String()
  1758. }
  1759. type CancelKeyDeletionInput struct {
  1760. _ struct{} `type:"structure"`
  1761. // The unique identifier for the customer master key (CMK) for which to cancel
  1762. // deletion.
  1763. //
  1764. // To specify this value, use the unique key ID or the Amazon Resource Name
  1765. // (ARN) of the CMK. Examples:
  1766. //
  1767. // Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  1768. //
  1769. // Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  1770. //
  1771. // To obtain the unique key ID and key ARN for a given CMK, use ListKeys
  1772. // or DescribeKey.
  1773. KeyId *string `min:"1" type:"string" required:"true"`
  1774. }
  1775. // String returns the string representation
  1776. func (s CancelKeyDeletionInput) String() string {
  1777. return awsutil.Prettify(s)
  1778. }
  1779. // GoString returns the string representation
  1780. func (s CancelKeyDeletionInput) GoString() string {
  1781. return s.String()
  1782. }
  1783. // Validate inspects the fields of the type to determine if they are valid.
  1784. func (s *CancelKeyDeletionInput) Validate() error {
  1785. invalidParams := request.ErrInvalidParams{Context: "CancelKeyDeletionInput"}
  1786. if s.KeyId == nil {
  1787. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  1788. }
  1789. if s.KeyId != nil && len(*s.KeyId) < 1 {
  1790. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  1791. }
  1792. if invalidParams.Len() > 0 {
  1793. return invalidParams
  1794. }
  1795. return nil
  1796. }
  1797. type CancelKeyDeletionOutput struct {
  1798. _ struct{} `type:"structure"`
  1799. // The unique identifier of the master key for which deletion is canceled.
  1800. KeyId *string `min:"1" type:"string"`
  1801. }
  1802. // String returns the string representation
  1803. func (s CancelKeyDeletionOutput) String() string {
  1804. return awsutil.Prettify(s)
  1805. }
  1806. // GoString returns the string representation
  1807. func (s CancelKeyDeletionOutput) GoString() string {
  1808. return s.String()
  1809. }
  1810. type CreateAliasInput struct {
  1811. _ struct{} `type:"structure"`
  1812. // String that contains the display name. The name must start with the word
  1813. // "alias" followed by a forward slash (alias/). Aliases that begin with "alias/AWS"
  1814. // are reserved.
  1815. AliasName *string `min:"1" type:"string" required:"true"`
  1816. // An identifier of the key for which you are creating the alias. This value
  1817. // cannot be another alias but can be a globally unique identifier or a fully
  1818. // specified ARN to a key.
  1819. //
  1820. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  1821. //
  1822. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  1823. TargetKeyId *string `min:"1" type:"string" required:"true"`
  1824. }
  1825. // String returns the string representation
  1826. func (s CreateAliasInput) String() string {
  1827. return awsutil.Prettify(s)
  1828. }
  1829. // GoString returns the string representation
  1830. func (s CreateAliasInput) GoString() string {
  1831. return s.String()
  1832. }
  1833. // Validate inspects the fields of the type to determine if they are valid.
  1834. func (s *CreateAliasInput) Validate() error {
  1835. invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"}
  1836. if s.AliasName == nil {
  1837. invalidParams.Add(request.NewErrParamRequired("AliasName"))
  1838. }
  1839. if s.AliasName != nil && len(*s.AliasName) < 1 {
  1840. invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
  1841. }
  1842. if s.TargetKeyId == nil {
  1843. invalidParams.Add(request.NewErrParamRequired("TargetKeyId"))
  1844. }
  1845. if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 {
  1846. invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1))
  1847. }
  1848. if invalidParams.Len() > 0 {
  1849. return invalidParams
  1850. }
  1851. return nil
  1852. }
  1853. type CreateAliasOutput struct {
  1854. _ struct{} `type:"structure"`
  1855. }
  1856. // String returns the string representation
  1857. func (s CreateAliasOutput) String() string {
  1858. return awsutil.Prettify(s)
  1859. }
  1860. // GoString returns the string representation
  1861. func (s CreateAliasOutput) GoString() string {
  1862. return s.String()
  1863. }
  1864. type CreateGrantInput struct {
  1865. _ struct{} `type:"structure"`
  1866. // The conditions under which the operations permitted by the grant are allowed.
  1867. //
  1868. // You can use this value to allow the operations permitted by the grant only
  1869. // when a specified encryption context is present. For more information, see
  1870. // Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html)
  1871. // in the AWS Key Management Service Developer Guide.
  1872. Constraints *GrantConstraints `type:"structure"`
  1873. // A list of grant tokens.
  1874. //
  1875. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  1876. // in the AWS Key Management Service Developer Guide.
  1877. GrantTokens []*string `type:"list"`
  1878. // The principal that is given permission to perform the operations that the
  1879. // grant permits.
  1880. //
  1881. // To specify the principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  1882. // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM
  1883. // users, federated users, and assumed role users. For examples of the ARN syntax
  1884. // to use for specifying a principal, see AWS Identity and Access Management
  1885. // (IAM) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
  1886. // in the Example ARNs section of the AWS General Reference.
  1887. GranteePrincipal *string `min:"1" type:"string" required:"true"`
  1888. // The unique identifier for the customer master key (CMK) that the grant applies
  1889. // to.
  1890. //
  1891. // To specify this value, use the globally unique key ID or the Amazon Resource
  1892. // Name (ARN) of the key. Examples:
  1893. //
  1894. // Globally unique key ID: 12345678-1234-1234-1234-123456789012
  1895. //
  1896. // Key ARN: arn:aws:kms:us-west-2:123456789012:key/12345678-1234-1234-1234-123456789012
  1897. KeyId *string `min:"1" type:"string" required:"true"`
  1898. // A friendly name for identifying the grant. Use this value to prevent unintended
  1899. // creation of duplicate grants when retrying this request.
  1900. //
  1901. // When this value is absent, all CreateGrant requests result in a new grant
  1902. // with a unique GrantId even if all the supplied parameters are identical.
  1903. // This can result in unintended duplicates when you retry the CreateGrant request.
  1904. //
  1905. // When this value is present, you can retry a CreateGrant request with identical
  1906. // parameters; if the grant already exists, the original GrantId is returned
  1907. // without creating a new grant. Note that the returned grant token is unique
  1908. // with every CreateGrant request, even when a duplicate GrantId is returned.
  1909. // All grant tokens obtained in this way can be used interchangeably.
  1910. Name *string `min:"1" type:"string"`
  1911. // A list of operations that the grant permits. The list can contain any combination
  1912. // of one or more of the following values:
  1913. //
  1914. // Decrypt
  1915. //
  1916. // Encrypt
  1917. //
  1918. // GenerateDataKey
  1919. //
  1920. // GenerateDataKeyWithoutPlaintext
  1921. //
  1922. // ReEncryptFrom (http://docs.aws.amazon.com/kms/latest/APIReference/API_ReEncrypt.html)
  1923. //
  1924. // ReEncryptTo (http://docs.aws.amazon.com/kms/latest/APIReference/API_ReEncrypt.html)
  1925. //
  1926. // CreateGrant
  1927. //
  1928. // RetireGrant
  1929. //
  1930. // DescribeKey
  1931. Operations []*string `type:"list"`
  1932. // The principal that is given permission to retire the grant by using RetireGrant
  1933. // operation.
  1934. //
  1935. // To specify the principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  1936. // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM
  1937. // users, federated users, and assumed role users. For examples of the ARN syntax
  1938. // to use for specifying a principal, see AWS Identity and Access Management
  1939. // (IAM) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
  1940. // in the Example ARNs section of the AWS General Reference.
  1941. RetiringPrincipal *string `min:"1" type:"string"`
  1942. }
  1943. // String returns the string representation
  1944. func (s CreateGrantInput) String() string {
  1945. return awsutil.Prettify(s)
  1946. }
  1947. // GoString returns the string representation
  1948. func (s CreateGrantInput) GoString() string {
  1949. return s.String()
  1950. }
  1951. // Validate inspects the fields of the type to determine if they are valid.
  1952. func (s *CreateGrantInput) Validate() error {
  1953. invalidParams := request.ErrInvalidParams{Context: "CreateGrantInput"}
  1954. if s.GranteePrincipal == nil {
  1955. invalidParams.Add(request.NewErrParamRequired("GranteePrincipal"))
  1956. }
  1957. if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 {
  1958. invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1))
  1959. }
  1960. if s.KeyId == nil {
  1961. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  1962. }
  1963. if s.KeyId != nil && len(*s.KeyId) < 1 {
  1964. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  1965. }
  1966. if s.Name != nil && len(*s.Name) < 1 {
  1967. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  1968. }
  1969. if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 {
  1970. invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1))
  1971. }
  1972. if invalidParams.Len() > 0 {
  1973. return invalidParams
  1974. }
  1975. return nil
  1976. }
  1977. type CreateGrantOutput struct {
  1978. _ struct{} `type:"structure"`
  1979. // The unique identifier for the grant.
  1980. //
  1981. // You can use the GrantId in a subsequent RetireGrant or RevokeGrant operation.
  1982. GrantId *string `min:"1" type:"string"`
  1983. // The grant token.
  1984. //
  1985. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  1986. // in the AWS Key Management Service Developer Guide.
  1987. GrantToken *string `min:"1" type:"string"`
  1988. }
  1989. // String returns the string representation
  1990. func (s CreateGrantOutput) String() string {
  1991. return awsutil.Prettify(s)
  1992. }
  1993. // GoString returns the string representation
  1994. func (s CreateGrantOutput) GoString() string {
  1995. return s.String()
  1996. }
  1997. type CreateKeyInput struct {
  1998. _ struct{} `type:"structure"`
  1999. // A flag to indicate whether to bypass the key policy lockout safety check.
  2000. //
  2001. // Setting this value to true increases the likelihood that the CMK becomes
  2002. // unmanageable. Do not set this value to true indiscriminately.
  2003. //
  2004. // For more information, refer to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  2005. // section in the AWS Key Management Service Developer Guide.
  2006. //
  2007. // Use this parameter only when you include a policy in the request and you
  2008. // intend to prevent the principal making the request from making a subsequent
  2009. // PutKeyPolicy request on the CMK.
  2010. //
  2011. // The default value is false.
  2012. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
  2013. // A description of the CMK.
  2014. //
  2015. // Use a description that helps you decide whether the CMK is appropriate for
  2016. // a task.
  2017. Description *string `type:"string"`
  2018. // The intended use of the CMK.
  2019. //
  2020. // You can use CMKs only for symmetric encryption and decryption.
  2021. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  2022. // The source of the CMK's key material.
  2023. //
  2024. // The default is AWS_KMS, which means AWS KMS creates the key material. When
  2025. // this parameter is set to EXTERNAL, the request creates a CMK without key
  2026. // material so that you can import key material from your existing key management
  2027. // infrastructure. For more information about importing key material into AWS
  2028. // KMS, see Importing Key Material (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  2029. // in the AWS Key Management Service Developer Guide.
  2030. //
  2031. // The CMK's Origin is immutable and is set when the CMK is created.
  2032. Origin *string `type:"string" enum:"OriginType"`
  2033. // The key policy to attach to the CMK.
  2034. //
  2035. // If you specify a policy and do not set BypassPolicyLockoutSafetyCheck to
  2036. // true, the policy must meet the following criteria:
  2037. //
  2038. // It must allow the principal making the CreateKey request to make a subsequent
  2039. // PutKeyPolicy request on the CMK. This reduces the likelihood that the CMK
  2040. // becomes unmanageable. For more information, refer to the scenario in the
  2041. // Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  2042. // section in the AWS Key Management Service Developer Guide.
  2043. //
  2044. // The principal(s) specified in the key policy must exist and be visible
  2045. // to AWS KMS. When you create a new AWS principal (for example, an IAM user
  2046. // or role), you might need to enforce a delay before specifying the new principal
  2047. // in a key policy because the new principal might not immediately be visible
  2048. // to AWS KMS. For more information, see Changes that I make are not always
  2049. // immediately visible (http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency)
  2050. // in the IAM User Guide.
  2051. //
  2052. // If you do not specify a policy, AWS KMS attaches a default key policy
  2053. // to the CMK. For more information, see Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default)
  2054. // in the AWS Key Management Service Developer Guide.
  2055. //
  2056. // The policy size limit is 32 KiB (32768 bytes).
  2057. Policy *string `min:"1" type:"string"`
  2058. }
  2059. // String returns the string representation
  2060. func (s CreateKeyInput) String() string {
  2061. return awsutil.Prettify(s)
  2062. }
  2063. // GoString returns the string representation
  2064. func (s CreateKeyInput) GoString() string {
  2065. return s.String()
  2066. }
  2067. // Validate inspects the fields of the type to determine if they are valid.
  2068. func (s *CreateKeyInput) Validate() error {
  2069. invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"}
  2070. if s.Policy != nil && len(*s.Policy) < 1 {
  2071. invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
  2072. }
  2073. if invalidParams.Len() > 0 {
  2074. return invalidParams
  2075. }
  2076. return nil
  2077. }
  2078. type CreateKeyOutput struct {
  2079. _ struct{} `type:"structure"`
  2080. // Metadata associated with the CMK.
  2081. KeyMetadata *KeyMetadata `type:"structure"`
  2082. }
  2083. // String returns the string representation
  2084. func (s CreateKeyOutput) String() string {
  2085. return awsutil.Prettify(s)
  2086. }
  2087. // GoString returns the string representation
  2088. func (s CreateKeyOutput) GoString() string {
  2089. return s.String()
  2090. }
  2091. type DecryptInput struct {
  2092. _ struct{} `type:"structure"`
  2093. // Ciphertext to be decrypted. The blob includes metadata.
  2094. //
  2095. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  2096. CiphertextBlob []byte `min:"1" type:"blob" required:"true"`
  2097. // The encryption context. If this was specified in the Encrypt function, it
  2098. // must be specified here or the decryption operation will fail. For more information,
  2099. // see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
  2100. EncryptionContext map[string]*string `type:"map"`
  2101. // A list of grant tokens.
  2102. //
  2103. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  2104. // in the AWS Key Management Service Developer Guide.
  2105. GrantTokens []*string `type:"list"`
  2106. }
  2107. // String returns the string representation
  2108. func (s DecryptInput) String() string {
  2109. return awsutil.Prettify(s)
  2110. }
  2111. // GoString returns the string representation
  2112. func (s DecryptInput) GoString() string {
  2113. return s.String()
  2114. }
  2115. // Validate inspects the fields of the type to determine if they are valid.
  2116. func (s *DecryptInput) Validate() error {
  2117. invalidParams := request.ErrInvalidParams{Context: "DecryptInput"}
  2118. if s.CiphertextBlob == nil {
  2119. invalidParams.Add(request.NewErrParamRequired("CiphertextBlob"))
  2120. }
  2121. if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
  2122. invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1))
  2123. }
  2124. if invalidParams.Len() > 0 {
  2125. return invalidParams
  2126. }
  2127. return nil
  2128. }
  2129. type DecryptOutput struct {
  2130. _ struct{} `type:"structure"`
  2131. // ARN of the key used to perform the decryption. This value is returned if
  2132. // no errors are encountered during the operation.
  2133. KeyId *string `min:"1" type:"string"`
  2134. // Decrypted plaintext data. This value may not be returned if the customer
  2135. // master key is not available or if you didn't have permission to use it.
  2136. //
  2137. // Plaintext is automatically base64 encoded/decoded by the SDK.
  2138. Plaintext []byte `min:"1" type:"blob"`
  2139. }
  2140. // String returns the string representation
  2141. func (s DecryptOutput) String() string {
  2142. return awsutil.Prettify(s)
  2143. }
  2144. // GoString returns the string representation
  2145. func (s DecryptOutput) GoString() string {
  2146. return s.String()
  2147. }
  2148. type DeleteAliasInput struct {
  2149. _ struct{} `type:"structure"`
  2150. // The alias to be deleted. The name must start with the word "alias" followed
  2151. // by a forward slash (alias/). Aliases that begin with "alias/AWS" are reserved.
  2152. AliasName *string `min:"1" type:"string" required:"true"`
  2153. }
  2154. // String returns the string representation
  2155. func (s DeleteAliasInput) String() string {
  2156. return awsutil.Prettify(s)
  2157. }
  2158. // GoString returns the string representation
  2159. func (s DeleteAliasInput) GoString() string {
  2160. return s.String()
  2161. }
  2162. // Validate inspects the fields of the type to determine if they are valid.
  2163. func (s *DeleteAliasInput) Validate() error {
  2164. invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"}
  2165. if s.AliasName == nil {
  2166. invalidParams.Add(request.NewErrParamRequired("AliasName"))
  2167. }
  2168. if s.AliasName != nil && len(*s.AliasName) < 1 {
  2169. invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
  2170. }
  2171. if invalidParams.Len() > 0 {
  2172. return invalidParams
  2173. }
  2174. return nil
  2175. }
  2176. type DeleteAliasOutput struct {
  2177. _ struct{} `type:"structure"`
  2178. }
  2179. // String returns the string representation
  2180. func (s DeleteAliasOutput) String() string {
  2181. return awsutil.Prettify(s)
  2182. }
  2183. // GoString returns the string representation
  2184. func (s DeleteAliasOutput) GoString() string {
  2185. return s.String()
  2186. }
  2187. type DeleteImportedKeyMaterialInput struct {
  2188. _ struct{} `type:"structure"`
  2189. // The identifier of the CMK whose key material to delete. The CMK's Origin
  2190. // must be EXTERNAL.
  2191. //
  2192. // A valid identifier is the unique key ID or the Amazon Resource Name (ARN)
  2193. // of the CMK. Examples:
  2194. //
  2195. // Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  2196. //
  2197. // Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  2198. KeyId *string `min:"1" type:"string" required:"true"`
  2199. }
  2200. // String returns the string representation
  2201. func (s DeleteImportedKeyMaterialInput) String() string {
  2202. return awsutil.Prettify(s)
  2203. }
  2204. // GoString returns the string representation
  2205. func (s DeleteImportedKeyMaterialInput) GoString() string {
  2206. return s.String()
  2207. }
  2208. // Validate inspects the fields of the type to determine if they are valid.
  2209. func (s *DeleteImportedKeyMaterialInput) Validate() error {
  2210. invalidParams := request.ErrInvalidParams{Context: "DeleteImportedKeyMaterialInput"}
  2211. if s.KeyId == nil {
  2212. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2213. }
  2214. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2215. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2216. }
  2217. if invalidParams.Len() > 0 {
  2218. return invalidParams
  2219. }
  2220. return nil
  2221. }
  2222. type DeleteImportedKeyMaterialOutput struct {
  2223. _ struct{} `type:"structure"`
  2224. }
  2225. // String returns the string representation
  2226. func (s DeleteImportedKeyMaterialOutput) String() string {
  2227. return awsutil.Prettify(s)
  2228. }
  2229. // GoString returns the string representation
  2230. func (s DeleteImportedKeyMaterialOutput) GoString() string {
  2231. return s.String()
  2232. }
  2233. type DescribeKeyInput struct {
  2234. _ struct{} `type:"structure"`
  2235. // A list of grant tokens.
  2236. //
  2237. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  2238. // in the AWS Key Management Service Developer Guide.
  2239. GrantTokens []*string `type:"list"`
  2240. // A unique identifier for the customer master key. This value can be a globally
  2241. // unique identifier, a fully specified ARN to either an alias or a key, or
  2242. // an alias name prefixed by "alias/".
  2243. //
  2244. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2245. //
  2246. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  2247. //
  2248. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2249. //
  2250. // Alias Name Example - alias/MyAliasName
  2251. KeyId *string `min:"1" type:"string" required:"true"`
  2252. }
  2253. // String returns the string representation
  2254. func (s DescribeKeyInput) String() string {
  2255. return awsutil.Prettify(s)
  2256. }
  2257. // GoString returns the string representation
  2258. func (s DescribeKeyInput) GoString() string {
  2259. return s.String()
  2260. }
  2261. // Validate inspects the fields of the type to determine if they are valid.
  2262. func (s *DescribeKeyInput) Validate() error {
  2263. invalidParams := request.ErrInvalidParams{Context: "DescribeKeyInput"}
  2264. if s.KeyId == nil {
  2265. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2266. }
  2267. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2268. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2269. }
  2270. if invalidParams.Len() > 0 {
  2271. return invalidParams
  2272. }
  2273. return nil
  2274. }
  2275. type DescribeKeyOutput struct {
  2276. _ struct{} `type:"structure"`
  2277. // Metadata associated with the key.
  2278. KeyMetadata *KeyMetadata `type:"structure"`
  2279. }
  2280. // String returns the string representation
  2281. func (s DescribeKeyOutput) String() string {
  2282. return awsutil.Prettify(s)
  2283. }
  2284. // GoString returns the string representation
  2285. func (s DescribeKeyOutput) GoString() string {
  2286. return s.String()
  2287. }
  2288. type DisableKeyInput struct {
  2289. _ struct{} `type:"structure"`
  2290. // A unique identifier for the CMK.
  2291. //
  2292. // Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example:
  2293. //
  2294. // Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  2295. //
  2296. // ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  2297. KeyId *string `min:"1" type:"string" required:"true"`
  2298. }
  2299. // String returns the string representation
  2300. func (s DisableKeyInput) String() string {
  2301. return awsutil.Prettify(s)
  2302. }
  2303. // GoString returns the string representation
  2304. func (s DisableKeyInput) GoString() string {
  2305. return s.String()
  2306. }
  2307. // Validate inspects the fields of the type to determine if they are valid.
  2308. func (s *DisableKeyInput) Validate() error {
  2309. invalidParams := request.ErrInvalidParams{Context: "DisableKeyInput"}
  2310. if s.KeyId == nil {
  2311. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2312. }
  2313. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2314. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2315. }
  2316. if invalidParams.Len() > 0 {
  2317. return invalidParams
  2318. }
  2319. return nil
  2320. }
  2321. type DisableKeyOutput struct {
  2322. _ struct{} `type:"structure"`
  2323. }
  2324. // String returns the string representation
  2325. func (s DisableKeyOutput) String() string {
  2326. return awsutil.Prettify(s)
  2327. }
  2328. // GoString returns the string representation
  2329. func (s DisableKeyOutput) GoString() string {
  2330. return s.String()
  2331. }
  2332. type DisableKeyRotationInput struct {
  2333. _ struct{} `type:"structure"`
  2334. // A unique identifier for the customer master key. This value can be a globally
  2335. // unique identifier or the fully specified ARN to a key.
  2336. //
  2337. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2338. //
  2339. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2340. KeyId *string `min:"1" type:"string" required:"true"`
  2341. }
  2342. // String returns the string representation
  2343. func (s DisableKeyRotationInput) String() string {
  2344. return awsutil.Prettify(s)
  2345. }
  2346. // GoString returns the string representation
  2347. func (s DisableKeyRotationInput) GoString() string {
  2348. return s.String()
  2349. }
  2350. // Validate inspects the fields of the type to determine if they are valid.
  2351. func (s *DisableKeyRotationInput) Validate() error {
  2352. invalidParams := request.ErrInvalidParams{Context: "DisableKeyRotationInput"}
  2353. if s.KeyId == nil {
  2354. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2355. }
  2356. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2357. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2358. }
  2359. if invalidParams.Len() > 0 {
  2360. return invalidParams
  2361. }
  2362. return nil
  2363. }
  2364. type DisableKeyRotationOutput struct {
  2365. _ struct{} `type:"structure"`
  2366. }
  2367. // String returns the string representation
  2368. func (s DisableKeyRotationOutput) String() string {
  2369. return awsutil.Prettify(s)
  2370. }
  2371. // GoString returns the string representation
  2372. func (s DisableKeyRotationOutput) GoString() string {
  2373. return s.String()
  2374. }
  2375. type EnableKeyInput struct {
  2376. _ struct{} `type:"structure"`
  2377. // A unique identifier for the customer master key. This value can be a globally
  2378. // unique identifier or the fully specified ARN to a key.
  2379. //
  2380. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2381. //
  2382. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2383. KeyId *string `min:"1" type:"string" required:"true"`
  2384. }
  2385. // String returns the string representation
  2386. func (s EnableKeyInput) String() string {
  2387. return awsutil.Prettify(s)
  2388. }
  2389. // GoString returns the string representation
  2390. func (s EnableKeyInput) GoString() string {
  2391. return s.String()
  2392. }
  2393. // Validate inspects the fields of the type to determine if they are valid.
  2394. func (s *EnableKeyInput) Validate() error {
  2395. invalidParams := request.ErrInvalidParams{Context: "EnableKeyInput"}
  2396. if s.KeyId == nil {
  2397. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2398. }
  2399. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2400. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2401. }
  2402. if invalidParams.Len() > 0 {
  2403. return invalidParams
  2404. }
  2405. return nil
  2406. }
  2407. type EnableKeyOutput struct {
  2408. _ struct{} `type:"structure"`
  2409. }
  2410. // String returns the string representation
  2411. func (s EnableKeyOutput) String() string {
  2412. return awsutil.Prettify(s)
  2413. }
  2414. // GoString returns the string representation
  2415. func (s EnableKeyOutput) GoString() string {
  2416. return s.String()
  2417. }
  2418. type EnableKeyRotationInput struct {
  2419. _ struct{} `type:"structure"`
  2420. // A unique identifier for the customer master key. This value can be a globally
  2421. // unique identifier or the fully specified ARN to a key.
  2422. //
  2423. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2424. //
  2425. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2426. KeyId *string `min:"1" type:"string" required:"true"`
  2427. }
  2428. // String returns the string representation
  2429. func (s EnableKeyRotationInput) String() string {
  2430. return awsutil.Prettify(s)
  2431. }
  2432. // GoString returns the string representation
  2433. func (s EnableKeyRotationInput) GoString() string {
  2434. return s.String()
  2435. }
  2436. // Validate inspects the fields of the type to determine if they are valid.
  2437. func (s *EnableKeyRotationInput) Validate() error {
  2438. invalidParams := request.ErrInvalidParams{Context: "EnableKeyRotationInput"}
  2439. if s.KeyId == nil {
  2440. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2441. }
  2442. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2443. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2444. }
  2445. if invalidParams.Len() > 0 {
  2446. return invalidParams
  2447. }
  2448. return nil
  2449. }
  2450. type EnableKeyRotationOutput struct {
  2451. _ struct{} `type:"structure"`
  2452. }
  2453. // String returns the string representation
  2454. func (s EnableKeyRotationOutput) String() string {
  2455. return awsutil.Prettify(s)
  2456. }
  2457. // GoString returns the string representation
  2458. func (s EnableKeyRotationOutput) GoString() string {
  2459. return s.String()
  2460. }
  2461. type EncryptInput struct {
  2462. _ struct{} `type:"structure"`
  2463. // Name/value pair that specifies the encryption context to be used for authenticated
  2464. // encryption. If used here, the same value must be supplied to the Decrypt
  2465. // API or decryption will fail. For more information, see Encryption Context
  2466. // (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html).
  2467. EncryptionContext map[string]*string `type:"map"`
  2468. // A list of grant tokens.
  2469. //
  2470. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  2471. // in the AWS Key Management Service Developer Guide.
  2472. GrantTokens []*string `type:"list"`
  2473. // A unique identifier for the customer master key. This value can be a globally
  2474. // unique identifier, a fully specified ARN to either an alias or a key, or
  2475. // an alias name prefixed by "alias/".
  2476. //
  2477. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2478. //
  2479. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  2480. //
  2481. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2482. //
  2483. // Alias Name Example - alias/MyAliasName
  2484. KeyId *string `min:"1" type:"string" required:"true"`
  2485. // Data to be encrypted.
  2486. //
  2487. // Plaintext is automatically base64 encoded/decoded by the SDK.
  2488. Plaintext []byte `min:"1" type:"blob" required:"true"`
  2489. }
  2490. // String returns the string representation
  2491. func (s EncryptInput) String() string {
  2492. return awsutil.Prettify(s)
  2493. }
  2494. // GoString returns the string representation
  2495. func (s EncryptInput) GoString() string {
  2496. return s.String()
  2497. }
  2498. // Validate inspects the fields of the type to determine if they are valid.
  2499. func (s *EncryptInput) Validate() error {
  2500. invalidParams := request.ErrInvalidParams{Context: "EncryptInput"}
  2501. if s.KeyId == nil {
  2502. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2503. }
  2504. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2505. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2506. }
  2507. if s.Plaintext == nil {
  2508. invalidParams.Add(request.NewErrParamRequired("Plaintext"))
  2509. }
  2510. if s.Plaintext != nil && len(s.Plaintext) < 1 {
  2511. invalidParams.Add(request.NewErrParamMinLen("Plaintext", 1))
  2512. }
  2513. if invalidParams.Len() > 0 {
  2514. return invalidParams
  2515. }
  2516. return nil
  2517. }
  2518. type EncryptOutput struct {
  2519. _ struct{} `type:"structure"`
  2520. // The encrypted plaintext. If you are using the CLI, the value is Base64 encoded.
  2521. // Otherwise, it is not encoded.
  2522. //
  2523. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  2524. CiphertextBlob []byte `min:"1" type:"blob"`
  2525. // The ID of the key used during encryption.
  2526. KeyId *string `min:"1" type:"string"`
  2527. }
  2528. // String returns the string representation
  2529. func (s EncryptOutput) String() string {
  2530. return awsutil.Prettify(s)
  2531. }
  2532. // GoString returns the string representation
  2533. func (s EncryptOutput) GoString() string {
  2534. return s.String()
  2535. }
  2536. type GenerateDataKeyInput struct {
  2537. _ struct{} `type:"structure"`
  2538. // Name/value pair that contains additional data to be authenticated during
  2539. // the encryption and decryption processes that use the key. This value is logged
  2540. // by AWS CloudTrail to provide context around the data encrypted by the key.
  2541. EncryptionContext map[string]*string `type:"map"`
  2542. // A list of grant tokens.
  2543. //
  2544. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  2545. // in the AWS Key Management Service Developer Guide.
  2546. GrantTokens []*string `type:"list"`
  2547. // A unique identifier for the customer master key. This value can be a globally
  2548. // unique identifier, a fully specified ARN to either an alias or a key, or
  2549. // an alias name prefixed by "alias/".
  2550. //
  2551. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2552. //
  2553. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  2554. //
  2555. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2556. //
  2557. // Alias Name Example - alias/MyAliasName
  2558. KeyId *string `min:"1" type:"string" required:"true"`
  2559. // Value that identifies the encryption algorithm and key size to generate a
  2560. // data key for. Currently this can be AES_128 or AES_256.
  2561. KeySpec *string `type:"string" enum:"DataKeySpec"`
  2562. // Integer that contains the number of bytes to generate. Common values are
  2563. // 128, 256, 512, and 1024. 1024 is the current limit. We recommend that you
  2564. // use the KeySpec parameter instead.
  2565. NumberOfBytes *int64 `min:"1" type:"integer"`
  2566. }
  2567. // String returns the string representation
  2568. func (s GenerateDataKeyInput) String() string {
  2569. return awsutil.Prettify(s)
  2570. }
  2571. // GoString returns the string representation
  2572. func (s GenerateDataKeyInput) GoString() string {
  2573. return s.String()
  2574. }
  2575. // Validate inspects the fields of the type to determine if they are valid.
  2576. func (s *GenerateDataKeyInput) Validate() error {
  2577. invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyInput"}
  2578. if s.KeyId == nil {
  2579. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2580. }
  2581. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2582. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2583. }
  2584. if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
  2585. invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
  2586. }
  2587. if invalidParams.Len() > 0 {
  2588. return invalidParams
  2589. }
  2590. return nil
  2591. }
  2592. type GenerateDataKeyOutput struct {
  2593. _ struct{} `type:"structure"`
  2594. // Ciphertext that contains the encrypted data key. You must store the blob
  2595. // and enough information to reconstruct the encryption context so that the
  2596. // data encrypted by using the key can later be decrypted. You must provide
  2597. // both the ciphertext blob and the encryption context to the Decrypt API to
  2598. // recover the plaintext data key and decrypt the object.
  2599. //
  2600. // If you are using the CLI, the value is Base64 encoded. Otherwise, it is
  2601. // not encoded.
  2602. //
  2603. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  2604. CiphertextBlob []byte `min:"1" type:"blob"`
  2605. // System generated unique identifier of the key to be used to decrypt the encrypted
  2606. // copy of the data key.
  2607. KeyId *string `min:"1" type:"string"`
  2608. // Plaintext that contains the data key. Use this for encryption and decryption
  2609. // and then remove it from memory as soon as possible.
  2610. //
  2611. // Plaintext is automatically base64 encoded/decoded by the SDK.
  2612. Plaintext []byte `min:"1" type:"blob"`
  2613. }
  2614. // String returns the string representation
  2615. func (s GenerateDataKeyOutput) String() string {
  2616. return awsutil.Prettify(s)
  2617. }
  2618. // GoString returns the string representation
  2619. func (s GenerateDataKeyOutput) GoString() string {
  2620. return s.String()
  2621. }
  2622. type GenerateDataKeyWithoutPlaintextInput struct {
  2623. _ struct{} `type:"structure"`
  2624. // Name:value pair that contains additional data to be authenticated during
  2625. // the encryption and decryption processes.
  2626. EncryptionContext map[string]*string `type:"map"`
  2627. // A list of grant tokens.
  2628. //
  2629. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  2630. // in the AWS Key Management Service Developer Guide.
  2631. GrantTokens []*string `type:"list"`
  2632. // A unique identifier for the customer master key. This value can be a globally
  2633. // unique identifier, a fully specified ARN to either an alias or a key, or
  2634. // an alias name prefixed by "alias/".
  2635. //
  2636. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2637. //
  2638. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  2639. //
  2640. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2641. //
  2642. // Alias Name Example - alias/MyAliasName
  2643. KeyId *string `min:"1" type:"string" required:"true"`
  2644. // Value that identifies the encryption algorithm and key size. Currently this
  2645. // can be AES_128 or AES_256.
  2646. KeySpec *string `type:"string" enum:"DataKeySpec"`
  2647. // Integer that contains the number of bytes to generate. Common values are
  2648. // 128, 256, 512, 1024 and so on. We recommend that you use the KeySpec parameter
  2649. // instead.
  2650. NumberOfBytes *int64 `min:"1" type:"integer"`
  2651. }
  2652. // String returns the string representation
  2653. func (s GenerateDataKeyWithoutPlaintextInput) String() string {
  2654. return awsutil.Prettify(s)
  2655. }
  2656. // GoString returns the string representation
  2657. func (s GenerateDataKeyWithoutPlaintextInput) GoString() string {
  2658. return s.String()
  2659. }
  2660. // Validate inspects the fields of the type to determine if they are valid.
  2661. func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error {
  2662. invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyWithoutPlaintextInput"}
  2663. if s.KeyId == nil {
  2664. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2665. }
  2666. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2667. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2668. }
  2669. if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
  2670. invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
  2671. }
  2672. if invalidParams.Len() > 0 {
  2673. return invalidParams
  2674. }
  2675. return nil
  2676. }
  2677. type GenerateDataKeyWithoutPlaintextOutput struct {
  2678. _ struct{} `type:"structure"`
  2679. // Ciphertext that contains the wrapped data key. You must store the blob and
  2680. // encryption context so that the key can be used in a future decrypt operation.
  2681. //
  2682. // If you are using the CLI, the value is Base64 encoded. Otherwise, it is
  2683. // not encoded.
  2684. //
  2685. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  2686. CiphertextBlob []byte `min:"1" type:"blob"`
  2687. // System generated unique identifier of the key to be used to decrypt the encrypted
  2688. // copy of the data key.
  2689. KeyId *string `min:"1" type:"string"`
  2690. }
  2691. // String returns the string representation
  2692. func (s GenerateDataKeyWithoutPlaintextOutput) String() string {
  2693. return awsutil.Prettify(s)
  2694. }
  2695. // GoString returns the string representation
  2696. func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string {
  2697. return s.String()
  2698. }
  2699. type GenerateRandomInput struct {
  2700. _ struct{} `type:"structure"`
  2701. // Integer that contains the number of bytes to generate. Common values are
  2702. // 128, 256, 512, 1024 and so on. The current limit is 1024 bytes.
  2703. NumberOfBytes *int64 `min:"1" type:"integer"`
  2704. }
  2705. // String returns the string representation
  2706. func (s GenerateRandomInput) String() string {
  2707. return awsutil.Prettify(s)
  2708. }
  2709. // GoString returns the string representation
  2710. func (s GenerateRandomInput) GoString() string {
  2711. return s.String()
  2712. }
  2713. // Validate inspects the fields of the type to determine if they are valid.
  2714. func (s *GenerateRandomInput) Validate() error {
  2715. invalidParams := request.ErrInvalidParams{Context: "GenerateRandomInput"}
  2716. if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
  2717. invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
  2718. }
  2719. if invalidParams.Len() > 0 {
  2720. return invalidParams
  2721. }
  2722. return nil
  2723. }
  2724. type GenerateRandomOutput struct {
  2725. _ struct{} `type:"structure"`
  2726. // Plaintext that contains the unpredictable byte string.
  2727. //
  2728. // Plaintext is automatically base64 encoded/decoded by the SDK.
  2729. Plaintext []byte `min:"1" type:"blob"`
  2730. }
  2731. // String returns the string representation
  2732. func (s GenerateRandomOutput) String() string {
  2733. return awsutil.Prettify(s)
  2734. }
  2735. // GoString returns the string representation
  2736. func (s GenerateRandomOutput) GoString() string {
  2737. return s.String()
  2738. }
  2739. type GetKeyPolicyInput struct {
  2740. _ struct{} `type:"structure"`
  2741. // A unique identifier for the customer master key. This value can be a globally
  2742. // unique identifier or the fully specified ARN to a key.
  2743. //
  2744. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2745. //
  2746. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2747. KeyId *string `min:"1" type:"string" required:"true"`
  2748. // String that contains the name of the policy. Currently, this must be "default".
  2749. // Policy names can be discovered by calling ListKeyPolicies.
  2750. PolicyName *string `min:"1" type:"string" required:"true"`
  2751. }
  2752. // String returns the string representation
  2753. func (s GetKeyPolicyInput) String() string {
  2754. return awsutil.Prettify(s)
  2755. }
  2756. // GoString returns the string representation
  2757. func (s GetKeyPolicyInput) GoString() string {
  2758. return s.String()
  2759. }
  2760. // Validate inspects the fields of the type to determine if they are valid.
  2761. func (s *GetKeyPolicyInput) Validate() error {
  2762. invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"}
  2763. if s.KeyId == nil {
  2764. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2765. }
  2766. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2767. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2768. }
  2769. if s.PolicyName == nil {
  2770. invalidParams.Add(request.NewErrParamRequired("PolicyName"))
  2771. }
  2772. if s.PolicyName != nil && len(*s.PolicyName) < 1 {
  2773. invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
  2774. }
  2775. if invalidParams.Len() > 0 {
  2776. return invalidParams
  2777. }
  2778. return nil
  2779. }
  2780. type GetKeyPolicyOutput struct {
  2781. _ struct{} `type:"structure"`
  2782. // A policy document in JSON format.
  2783. Policy *string `min:"1" type:"string"`
  2784. }
  2785. // String returns the string representation
  2786. func (s GetKeyPolicyOutput) String() string {
  2787. return awsutil.Prettify(s)
  2788. }
  2789. // GoString returns the string representation
  2790. func (s GetKeyPolicyOutput) GoString() string {
  2791. return s.String()
  2792. }
  2793. type GetKeyRotationStatusInput struct {
  2794. _ struct{} `type:"structure"`
  2795. // A unique identifier for the customer master key. This value can be a globally
  2796. // unique identifier or the fully specified ARN to a key.
  2797. //
  2798. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  2799. //
  2800. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  2801. KeyId *string `min:"1" type:"string" required:"true"`
  2802. }
  2803. // String returns the string representation
  2804. func (s GetKeyRotationStatusInput) String() string {
  2805. return awsutil.Prettify(s)
  2806. }
  2807. // GoString returns the string representation
  2808. func (s GetKeyRotationStatusInput) GoString() string {
  2809. return s.String()
  2810. }
  2811. // Validate inspects the fields of the type to determine if they are valid.
  2812. func (s *GetKeyRotationStatusInput) Validate() error {
  2813. invalidParams := request.ErrInvalidParams{Context: "GetKeyRotationStatusInput"}
  2814. if s.KeyId == nil {
  2815. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2816. }
  2817. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2818. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2819. }
  2820. if invalidParams.Len() > 0 {
  2821. return invalidParams
  2822. }
  2823. return nil
  2824. }
  2825. type GetKeyRotationStatusOutput struct {
  2826. _ struct{} `type:"structure"`
  2827. // A Boolean value that specifies whether key rotation is enabled.
  2828. KeyRotationEnabled *bool `type:"boolean"`
  2829. }
  2830. // String returns the string representation
  2831. func (s GetKeyRotationStatusOutput) String() string {
  2832. return awsutil.Prettify(s)
  2833. }
  2834. // GoString returns the string representation
  2835. func (s GetKeyRotationStatusOutput) GoString() string {
  2836. return s.String()
  2837. }
  2838. type GetParametersForImportInput struct {
  2839. _ struct{} `type:"structure"`
  2840. // The identifier of the CMK into which you will import key material. The CMK's
  2841. // Origin must be EXTERNAL.
  2842. //
  2843. // A valid identifier is the unique key ID or the Amazon Resource Name (ARN)
  2844. // of the CMK. Examples:
  2845. //
  2846. // Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  2847. //
  2848. // Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  2849. KeyId *string `min:"1" type:"string" required:"true"`
  2850. // The algorithm you will use to encrypt the key material before importing it
  2851. // with ImportKeyMaterial. For more information, see Encrypt the Key Material
  2852. // (http://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-encrypt-key-material.html)
  2853. // in the AWS Key Management Service Developer Guide.
  2854. WrappingAlgorithm *string `type:"string" required:"true" enum:"AlgorithmSpec"`
  2855. // The type of wrapping key (public key) to return in the response. Only 2048-bit
  2856. // RSA public keys are supported.
  2857. WrappingKeySpec *string `type:"string" required:"true" enum:"WrappingKeySpec"`
  2858. }
  2859. // String returns the string representation
  2860. func (s GetParametersForImportInput) String() string {
  2861. return awsutil.Prettify(s)
  2862. }
  2863. // GoString returns the string representation
  2864. func (s GetParametersForImportInput) GoString() string {
  2865. return s.String()
  2866. }
  2867. // Validate inspects the fields of the type to determine if they are valid.
  2868. func (s *GetParametersForImportInput) Validate() error {
  2869. invalidParams := request.ErrInvalidParams{Context: "GetParametersForImportInput"}
  2870. if s.KeyId == nil {
  2871. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  2872. }
  2873. if s.KeyId != nil && len(*s.KeyId) < 1 {
  2874. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  2875. }
  2876. if s.WrappingAlgorithm == nil {
  2877. invalidParams.Add(request.NewErrParamRequired("WrappingAlgorithm"))
  2878. }
  2879. if s.WrappingKeySpec == nil {
  2880. invalidParams.Add(request.NewErrParamRequired("WrappingKeySpec"))
  2881. }
  2882. if invalidParams.Len() > 0 {
  2883. return invalidParams
  2884. }
  2885. return nil
  2886. }
  2887. type GetParametersForImportOutput struct {
  2888. _ struct{} `type:"structure"`
  2889. // The import token to send in a subsequent ImportKeyMaterial request.
  2890. //
  2891. // ImportToken is automatically base64 encoded/decoded by the SDK.
  2892. ImportToken []byte `min:"1" type:"blob"`
  2893. // The identifier of the CMK to use in a subsequent ImportKeyMaterial request.
  2894. // This is the same CMK specified in the GetParametersForImport request.
  2895. KeyId *string `min:"1" type:"string"`
  2896. // The time at which the import token and public key are no longer valid. After
  2897. // this time, you cannot use them to make an ImportKeyMaterial request and you
  2898. // must send another GetParametersForImport request to retrieve new ones.
  2899. ParametersValidTo *time.Time `type:"timestamp" timestampFormat:"unix"`
  2900. // The public key to use to encrypt the key material before importing it with
  2901. // ImportKeyMaterial.
  2902. //
  2903. // PublicKey is automatically base64 encoded/decoded by the SDK.
  2904. PublicKey []byte `min:"1" type:"blob"`
  2905. }
  2906. // String returns the string representation
  2907. func (s GetParametersForImportOutput) String() string {
  2908. return awsutil.Prettify(s)
  2909. }
  2910. // GoString returns the string representation
  2911. func (s GetParametersForImportOutput) GoString() string {
  2912. return s.String()
  2913. }
  2914. // A structure for specifying the conditions under which the operations permitted
  2915. // by the grant are allowed.
  2916. //
  2917. // You can use this structure to allow the operations permitted by the grant
  2918. // only when a specified encryption context is present. For more information
  2919. // about encryption context, see Encryption Context (http://docs.aws.amazon.com/kms/latest/developerguide/encrypt-context.html)
  2920. // in the AWS Key Management Service Developer Guide.
  2921. type GrantConstraints struct {
  2922. _ struct{} `type:"structure"`
  2923. // Contains a list of key-value pairs that must be present in the encryption
  2924. // context of a subsequent operation permitted by the grant. When a subsequent
  2925. // operation permitted by the grant includes an encryption context that matches
  2926. // this list, the grant allows the operation. Otherwise, the operation is not
  2927. // allowed.
  2928. EncryptionContextEquals map[string]*string `type:"map"`
  2929. // Contains a list of key-value pairs, a subset of which must be present in
  2930. // the encryption context of a subsequent operation permitted by the grant.
  2931. // When a subsequent operation permitted by the grant includes an encryption
  2932. // context that matches this list or is a subset of this list, the grant allows
  2933. // the operation. Otherwise, the operation is not allowed.
  2934. EncryptionContextSubset map[string]*string `type:"map"`
  2935. }
  2936. // String returns the string representation
  2937. func (s GrantConstraints) String() string {
  2938. return awsutil.Prettify(s)
  2939. }
  2940. // GoString returns the string representation
  2941. func (s GrantConstraints) GoString() string {
  2942. return s.String()
  2943. }
  2944. // Contains information about an entry in a list of grants.
  2945. type GrantListEntry struct {
  2946. _ struct{} `type:"structure"`
  2947. // The conditions under which the grant's operations are allowed.
  2948. Constraints *GrantConstraints `type:"structure"`
  2949. // The date and time when the grant was created.
  2950. CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"`
  2951. // The unique identifier for the grant.
  2952. GrantId *string `min:"1" type:"string"`
  2953. // The principal that receives the grant's permissions.
  2954. GranteePrincipal *string `min:"1" type:"string"`
  2955. // The AWS account under which the grant was issued.
  2956. IssuingAccount *string `min:"1" type:"string"`
  2957. // The unique identifier for the customer master key (CMK) to which the grant
  2958. // applies.
  2959. KeyId *string `min:"1" type:"string"`
  2960. // The friendly name that identifies the grant. If a name was provided in the
  2961. // CreateGrant request, that name is returned. Otherwise this value is null.
  2962. Name *string `min:"1" type:"string"`
  2963. // The list of operations permitted by the grant.
  2964. Operations []*string `type:"list"`
  2965. // The principal that can retire the grant.
  2966. RetiringPrincipal *string `min:"1" type:"string"`
  2967. }
  2968. // String returns the string representation
  2969. func (s GrantListEntry) String() string {
  2970. return awsutil.Prettify(s)
  2971. }
  2972. // GoString returns the string representation
  2973. func (s GrantListEntry) GoString() string {
  2974. return s.String()
  2975. }
  2976. type ImportKeyMaterialInput struct {
  2977. _ struct{} `type:"structure"`
  2978. // The encrypted key material to import. It must be encrypted with the public
  2979. // key that you received in the response to a previous GetParametersForImport
  2980. // request, using the wrapping algorithm that you specified in that request.
  2981. //
  2982. // EncryptedKeyMaterial is automatically base64 encoded/decoded by the SDK.
  2983. EncryptedKeyMaterial []byte `min:"1" type:"blob" required:"true"`
  2984. // Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES,
  2985. // in which case you must include the ValidTo parameter. When this parameter
  2986. // is set to KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the ValidTo parameter.
  2987. ExpirationModel *string `type:"string" enum:"ExpirationModelType"`
  2988. // The import token that you received in the response to a previous GetParametersForImport
  2989. // request. It must be from the same response that contained the public key
  2990. // that you used to encrypt the key material.
  2991. //
  2992. // ImportToken is automatically base64 encoded/decoded by the SDK.
  2993. ImportToken []byte `min:"1" type:"blob" required:"true"`
  2994. // The identifier of the CMK to import the key material into. The CMK's Origin
  2995. // must be EXTERNAL.
  2996. //
  2997. // A valid identifier is the unique key ID or the Amazon Resource Name (ARN)
  2998. // of the CMK. Examples:
  2999. //
  3000. // Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  3001. //
  3002. // Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  3003. KeyId *string `min:"1" type:"string" required:"true"`
  3004. // The time at which the imported key material expires. When the key material
  3005. // expires, AWS KMS deletes the key material and the CMK becomes unusable. You
  3006. // must omit this parameter when the ExpirationModel parameter is set to KEY_MATERIAL_DOES_NOT_EXPIRE.
  3007. // Otherwise it is required.
  3008. ValidTo *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"`
  3009. }
  3010. // String returns the string representation
  3011. func (s ImportKeyMaterialInput) String() string {
  3012. return awsutil.Prettify(s)
  3013. }
  3014. // GoString returns the string representation
  3015. func (s ImportKeyMaterialInput) GoString() string {
  3016. return s.String()
  3017. }
  3018. // Validate inspects the fields of the type to determine if they are valid.
  3019. func (s *ImportKeyMaterialInput) Validate() error {
  3020. invalidParams := request.ErrInvalidParams{Context: "ImportKeyMaterialInput"}
  3021. if s.EncryptedKeyMaterial == nil {
  3022. invalidParams.Add(request.NewErrParamRequired("EncryptedKeyMaterial"))
  3023. }
  3024. if s.EncryptedKeyMaterial != nil && len(s.EncryptedKeyMaterial) < 1 {
  3025. invalidParams.Add(request.NewErrParamMinLen("EncryptedKeyMaterial", 1))
  3026. }
  3027. if s.ImportToken == nil {
  3028. invalidParams.Add(request.NewErrParamRequired("ImportToken"))
  3029. }
  3030. if s.ImportToken != nil && len(s.ImportToken) < 1 {
  3031. invalidParams.Add(request.NewErrParamMinLen("ImportToken", 1))
  3032. }
  3033. if s.KeyId == nil {
  3034. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3035. }
  3036. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3037. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3038. }
  3039. if s.ValidTo == nil {
  3040. invalidParams.Add(request.NewErrParamRequired("ValidTo"))
  3041. }
  3042. if invalidParams.Len() > 0 {
  3043. return invalidParams
  3044. }
  3045. return nil
  3046. }
  3047. type ImportKeyMaterialOutput struct {
  3048. _ struct{} `type:"structure"`
  3049. }
  3050. // String returns the string representation
  3051. func (s ImportKeyMaterialOutput) String() string {
  3052. return awsutil.Prettify(s)
  3053. }
  3054. // GoString returns the string representation
  3055. func (s ImportKeyMaterialOutput) GoString() string {
  3056. return s.String()
  3057. }
  3058. // Contains information about each entry in the key list.
  3059. type KeyListEntry struct {
  3060. _ struct{} `type:"structure"`
  3061. // ARN of the key.
  3062. KeyArn *string `min:"20" type:"string"`
  3063. // Unique identifier of the key.
  3064. KeyId *string `min:"1" type:"string"`
  3065. }
  3066. // String returns the string representation
  3067. func (s KeyListEntry) String() string {
  3068. return awsutil.Prettify(s)
  3069. }
  3070. // GoString returns the string representation
  3071. func (s KeyListEntry) GoString() string {
  3072. return s.String()
  3073. }
  3074. // Contains metadata about a customer master key (CMK).
  3075. //
  3076. // This data type is used as a response element for the CreateKey and DescribeKey
  3077. // operations.
  3078. type KeyMetadata struct {
  3079. _ struct{} `type:"structure"`
  3080. // The twelve-digit account ID of the AWS account that owns the CMK.
  3081. AWSAccountId *string `type:"string"`
  3082. // The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management
  3083. // Service (AWS KMS) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms)
  3084. // in the Example ARNs section of the AWS General Reference.
  3085. Arn *string `min:"20" type:"string"`
  3086. // The date and time when the CMK was created.
  3087. CreationDate *time.Time `type:"timestamp" timestampFormat:"unix"`
  3088. // The date and time after which AWS KMS deletes the CMK. This value is present
  3089. // only when KeyState is PendingDeletion, otherwise this value is omitted.
  3090. DeletionDate *time.Time `type:"timestamp" timestampFormat:"unix"`
  3091. // The description of the CMK.
  3092. Description *string `type:"string"`
  3093. // Specifies whether the CMK is enabled. When KeyState is Enabled this value
  3094. // is true, otherwise it is false.
  3095. Enabled *bool `type:"boolean"`
  3096. // Specifies whether the CMK's key material expires. This value is present only
  3097. // when Origin is EXTERNAL, otherwise this value is omitted.
  3098. ExpirationModel *string `type:"string" enum:"ExpirationModelType"`
  3099. // The globally unique identifier for the CMK.
  3100. KeyId *string `min:"1" type:"string" required:"true"`
  3101. // The state of the CMK.
  3102. //
  3103. // For more information about how key state affects the use of a CMK, see How
  3104. // Key State Affects the Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3105. // in the AWS Key Management Service Developer Guide.
  3106. KeyState *string `type:"string" enum:"KeyState"`
  3107. // The cryptographic operations for which you can use the CMK. Currently the
  3108. // only allowed value is ENCRYPT_DECRYPT, which means you can use the CMK for
  3109. // the Encrypt and Decrypt operations.
  3110. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  3111. // The source of the CMK's key material. When this value is AWS_KMS, AWS KMS
  3112. // created the key material. When this value is EXTERNAL, the key material was
  3113. // imported from your existing key management infrastructure or the CMK lacks
  3114. // key material.
  3115. Origin *string `type:"string" enum:"OriginType"`
  3116. // The time at which the imported key material expires. When the key material
  3117. // expires, AWS KMS deletes the key material and the CMK becomes unusable. This
  3118. // value is present only for CMKs whose Origin is EXTERNAL and whose ExpirationModel
  3119. // is KEY_MATERIAL_EXPIRES, otherwise this value is omitted.
  3120. ValidTo *time.Time `type:"timestamp" timestampFormat:"unix"`
  3121. }
  3122. // String returns the string representation
  3123. func (s KeyMetadata) String() string {
  3124. return awsutil.Prettify(s)
  3125. }
  3126. // GoString returns the string representation
  3127. func (s KeyMetadata) GoString() string {
  3128. return s.String()
  3129. }
  3130. type ListAliasesInput struct {
  3131. _ struct{} `type:"structure"`
  3132. // When paginating results, specify the maximum number of items to return in
  3133. // the response. If additional items exist beyond the number you specify, the
  3134. // Truncated element in the response is set to true.
  3135. //
  3136. // This value is optional. If you include a value, it must be between 1 and
  3137. // 100, inclusive. If you do not include a value, it defaults to 50.
  3138. Limit *int64 `min:"1" type:"integer"`
  3139. // Use this parameter only when paginating results and only in a subsequent
  3140. // request after you receive a response with truncated results. Set it to the
  3141. // value of NextMarker from the response you just received.
  3142. Marker *string `min:"1" type:"string"`
  3143. }
  3144. // String returns the string representation
  3145. func (s ListAliasesInput) String() string {
  3146. return awsutil.Prettify(s)
  3147. }
  3148. // GoString returns the string representation
  3149. func (s ListAliasesInput) GoString() string {
  3150. return s.String()
  3151. }
  3152. // Validate inspects the fields of the type to determine if they are valid.
  3153. func (s *ListAliasesInput) Validate() error {
  3154. invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"}
  3155. if s.Limit != nil && *s.Limit < 1 {
  3156. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3157. }
  3158. if s.Marker != nil && len(*s.Marker) < 1 {
  3159. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  3160. }
  3161. if invalidParams.Len() > 0 {
  3162. return invalidParams
  3163. }
  3164. return nil
  3165. }
  3166. type ListAliasesOutput struct {
  3167. _ struct{} `type:"structure"`
  3168. // A list of key aliases in the user's account.
  3169. Aliases []*AliasListEntry `type:"list"`
  3170. // When Truncated is true, this value is present and contains the value to use
  3171. // for the Marker parameter in a subsequent pagination request.
  3172. NextMarker *string `min:"1" type:"string"`
  3173. // A flag that indicates whether there are more items in the list. If your results
  3174. // were truncated, you can use the Marker parameter to make a subsequent pagination
  3175. // request to retrieve more items in the list.
  3176. Truncated *bool `type:"boolean"`
  3177. }
  3178. // String returns the string representation
  3179. func (s ListAliasesOutput) String() string {
  3180. return awsutil.Prettify(s)
  3181. }
  3182. // GoString returns the string representation
  3183. func (s ListAliasesOutput) GoString() string {
  3184. return s.String()
  3185. }
  3186. type ListGrantsInput struct {
  3187. _ struct{} `type:"structure"`
  3188. // A unique identifier for the customer master key. This value can be a globally
  3189. // unique identifier or the fully specified ARN to a key.
  3190. //
  3191. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3192. //
  3193. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3194. KeyId *string `min:"1" type:"string" required:"true"`
  3195. // When paginating results, specify the maximum number of items to return in
  3196. // the response. If additional items exist beyond the number you specify, the
  3197. // Truncated element in the response is set to true.
  3198. //
  3199. // This value is optional. If you include a value, it must be between 1 and
  3200. // 100, inclusive. If you do not include a value, it defaults to 50.
  3201. Limit *int64 `min:"1" type:"integer"`
  3202. // Use this parameter only when paginating results and only in a subsequent
  3203. // request after you receive a response with truncated results. Set it to the
  3204. // value of NextMarker from the response you just received.
  3205. Marker *string `min:"1" type:"string"`
  3206. }
  3207. // String returns the string representation
  3208. func (s ListGrantsInput) String() string {
  3209. return awsutil.Prettify(s)
  3210. }
  3211. // GoString returns the string representation
  3212. func (s ListGrantsInput) GoString() string {
  3213. return s.String()
  3214. }
  3215. // Validate inspects the fields of the type to determine if they are valid.
  3216. func (s *ListGrantsInput) Validate() error {
  3217. invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"}
  3218. if s.KeyId == nil {
  3219. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3220. }
  3221. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3222. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3223. }
  3224. if s.Limit != nil && *s.Limit < 1 {
  3225. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3226. }
  3227. if s.Marker != nil && len(*s.Marker) < 1 {
  3228. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  3229. }
  3230. if invalidParams.Len() > 0 {
  3231. return invalidParams
  3232. }
  3233. return nil
  3234. }
  3235. type ListGrantsResponse struct {
  3236. _ struct{} `type:"structure"`
  3237. // A list of grants.
  3238. Grants []*GrantListEntry `type:"list"`
  3239. // When Truncated is true, this value is present and contains the value to use
  3240. // for the Marker parameter in a subsequent pagination request.
  3241. NextMarker *string `min:"1" type:"string"`
  3242. // A flag that indicates whether there are more items in the list. If your results
  3243. // were truncated, you can use the Marker parameter to make a subsequent pagination
  3244. // request to retrieve more items in the list.
  3245. Truncated *bool `type:"boolean"`
  3246. }
  3247. // String returns the string representation
  3248. func (s ListGrantsResponse) String() string {
  3249. return awsutil.Prettify(s)
  3250. }
  3251. // GoString returns the string representation
  3252. func (s ListGrantsResponse) GoString() string {
  3253. return s.String()
  3254. }
  3255. type ListKeyPoliciesInput struct {
  3256. _ struct{} `type:"structure"`
  3257. // A unique identifier for the customer master key. This value can be a globally
  3258. // unique identifier, a fully specified ARN to either an alias or a key, or
  3259. // an alias name prefixed by "alias/".
  3260. //
  3261. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3262. //
  3263. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  3264. //
  3265. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3266. //
  3267. // Alias Name Example - alias/MyAliasName
  3268. KeyId *string `min:"1" type:"string" required:"true"`
  3269. // When paginating results, specify the maximum number of items to return in
  3270. // the response. If additional items exist beyond the number you specify, the
  3271. // Truncated element in the response is set to true.
  3272. //
  3273. // This value is optional. If you include a value, it must be between 1 and
  3274. // 1000, inclusive. If you do not include a value, it defaults to 100.
  3275. //
  3276. // Currently only 1 policy can be attached to a key.
  3277. Limit *int64 `min:"1" type:"integer"`
  3278. // Use this parameter only when paginating results and only in a subsequent
  3279. // request after you receive a response with truncated results. Set it to the
  3280. // value of NextMarker from the response you just received.
  3281. Marker *string `min:"1" type:"string"`
  3282. }
  3283. // String returns the string representation
  3284. func (s ListKeyPoliciesInput) String() string {
  3285. return awsutil.Prettify(s)
  3286. }
  3287. // GoString returns the string representation
  3288. func (s ListKeyPoliciesInput) GoString() string {
  3289. return s.String()
  3290. }
  3291. // Validate inspects the fields of the type to determine if they are valid.
  3292. func (s *ListKeyPoliciesInput) Validate() error {
  3293. invalidParams := request.ErrInvalidParams{Context: "ListKeyPoliciesInput"}
  3294. if s.KeyId == nil {
  3295. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3296. }
  3297. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3298. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3299. }
  3300. if s.Limit != nil && *s.Limit < 1 {
  3301. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3302. }
  3303. if s.Marker != nil && len(*s.Marker) < 1 {
  3304. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  3305. }
  3306. if invalidParams.Len() > 0 {
  3307. return invalidParams
  3308. }
  3309. return nil
  3310. }
  3311. type ListKeyPoliciesOutput struct {
  3312. _ struct{} `type:"structure"`
  3313. // When Truncated is true, this value is present and contains the value to use
  3314. // for the Marker parameter in a subsequent pagination request.
  3315. NextMarker *string `min:"1" type:"string"`
  3316. // A list of policy names. Currently, there is only one policy and it is named
  3317. // "Default".
  3318. PolicyNames []*string `type:"list"`
  3319. // A flag that indicates whether there are more items in the list. If your results
  3320. // were truncated, you can use the Marker parameter to make a subsequent pagination
  3321. // request to retrieve more items in the list.
  3322. Truncated *bool `type:"boolean"`
  3323. }
  3324. // String returns the string representation
  3325. func (s ListKeyPoliciesOutput) String() string {
  3326. return awsutil.Prettify(s)
  3327. }
  3328. // GoString returns the string representation
  3329. func (s ListKeyPoliciesOutput) GoString() string {
  3330. return s.String()
  3331. }
  3332. type ListKeysInput struct {
  3333. _ struct{} `type:"structure"`
  3334. // When paginating results, specify the maximum number of items to return in
  3335. // the response. If additional items exist beyond the number you specify, the
  3336. // Truncated element in the response is set to true.
  3337. //
  3338. // This value is optional. If you include a value, it must be between 1 and
  3339. // 1000, inclusive. If you do not include a value, it defaults to 100.
  3340. Limit *int64 `min:"1" type:"integer"`
  3341. // Use this parameter only when paginating results and only in a subsequent
  3342. // request after you receive a response with truncated results. Set it to the
  3343. // value of NextMarker from the response you just received.
  3344. Marker *string `min:"1" type:"string"`
  3345. }
  3346. // String returns the string representation
  3347. func (s ListKeysInput) String() string {
  3348. return awsutil.Prettify(s)
  3349. }
  3350. // GoString returns the string representation
  3351. func (s ListKeysInput) GoString() string {
  3352. return s.String()
  3353. }
  3354. // Validate inspects the fields of the type to determine if they are valid.
  3355. func (s *ListKeysInput) Validate() error {
  3356. invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"}
  3357. if s.Limit != nil && *s.Limit < 1 {
  3358. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3359. }
  3360. if s.Marker != nil && len(*s.Marker) < 1 {
  3361. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  3362. }
  3363. if invalidParams.Len() > 0 {
  3364. return invalidParams
  3365. }
  3366. return nil
  3367. }
  3368. type ListKeysOutput struct {
  3369. _ struct{} `type:"structure"`
  3370. // A list of keys.
  3371. Keys []*KeyListEntry `type:"list"`
  3372. // When Truncated is true, this value is present and contains the value to use
  3373. // for the Marker parameter in a subsequent pagination request.
  3374. NextMarker *string `min:"1" type:"string"`
  3375. // A flag that indicates whether there are more items in the list. If your results
  3376. // were truncated, you can use the Marker parameter to make a subsequent pagination
  3377. // request to retrieve more items in the list.
  3378. Truncated *bool `type:"boolean"`
  3379. }
  3380. // String returns the string representation
  3381. func (s ListKeysOutput) String() string {
  3382. return awsutil.Prettify(s)
  3383. }
  3384. // GoString returns the string representation
  3385. func (s ListKeysOutput) GoString() string {
  3386. return s.String()
  3387. }
  3388. type ListRetirableGrantsInput struct {
  3389. _ struct{} `type:"structure"`
  3390. // When paginating results, specify the maximum number of items to return in
  3391. // the response. If additional items exist beyond the number you specify, the
  3392. // Truncated element in the response is set to true.
  3393. //
  3394. // This value is optional. If you include a value, it must be between 1 and
  3395. // 100, inclusive. If you do not include a value, it defaults to 50.
  3396. Limit *int64 `min:"1" type:"integer"`
  3397. // Use this parameter only when paginating results and only in a subsequent
  3398. // request after you receive a response with truncated results. Set it to the
  3399. // value of NextMarker from the response you just received.
  3400. Marker *string `min:"1" type:"string"`
  3401. // The retiring principal for which to list grants.
  3402. //
  3403. // To specify the retiring principal, use the Amazon Resource Name (ARN) (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  3404. // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM
  3405. // users, federated users, and assumed role users. For examples of the ARN syntax
  3406. // for specifying a principal, see AWS Identity and Access Management (IAM)
  3407. // (http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
  3408. // in the Example ARNs section of the Amazon Web Services General Reference.
  3409. RetiringPrincipal *string `min:"1" type:"string" required:"true"`
  3410. }
  3411. // String returns the string representation
  3412. func (s ListRetirableGrantsInput) String() string {
  3413. return awsutil.Prettify(s)
  3414. }
  3415. // GoString returns the string representation
  3416. func (s ListRetirableGrantsInput) GoString() string {
  3417. return s.String()
  3418. }
  3419. // Validate inspects the fields of the type to determine if they are valid.
  3420. func (s *ListRetirableGrantsInput) Validate() error {
  3421. invalidParams := request.ErrInvalidParams{Context: "ListRetirableGrantsInput"}
  3422. if s.Limit != nil && *s.Limit < 1 {
  3423. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  3424. }
  3425. if s.Marker != nil && len(*s.Marker) < 1 {
  3426. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  3427. }
  3428. if s.RetiringPrincipal == nil {
  3429. invalidParams.Add(request.NewErrParamRequired("RetiringPrincipal"))
  3430. }
  3431. if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 {
  3432. invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1))
  3433. }
  3434. if invalidParams.Len() > 0 {
  3435. return invalidParams
  3436. }
  3437. return nil
  3438. }
  3439. type PutKeyPolicyInput struct {
  3440. _ struct{} `type:"structure"`
  3441. // A flag to indicate whether to bypass the key policy lockout safety check.
  3442. //
  3443. // Setting this value to true increases the likelihood that the CMK becomes
  3444. // unmanageable. Do not set this value to true indiscriminately.
  3445. //
  3446. // For more information, refer to the scenario in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  3447. // section in the AWS Key Management Service Developer Guide.
  3448. //
  3449. // Use this parameter only when you intend to prevent the principal making
  3450. // the request from making a subsequent PutKeyPolicy request on the CMK.
  3451. //
  3452. // The default value is false.
  3453. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
  3454. // A unique identifier for the CMK.
  3455. //
  3456. // Use the CMK's unique identifier or its Amazon Resource Name (ARN). For example:
  3457. //
  3458. // Unique ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  3459. //
  3460. // ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  3461. KeyId *string `min:"1" type:"string" required:"true"`
  3462. // The key policy to attach to the CMK.
  3463. //
  3464. // If you do not set BypassPolicyLockoutSafetyCheck to true, the policy must
  3465. // meet the following criteria:
  3466. //
  3467. // It must allow the principal making the PutKeyPolicy request to make a
  3468. // subsequent PutKeyPolicy request on the CMK. This reduces the likelihood that
  3469. // the CMK becomes unmanageable. For more information, refer to the scenario
  3470. // in the Default Key Policy (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  3471. // section in the AWS Key Management Service Developer Guide.
  3472. //
  3473. // The principal(s) specified in the key policy must exist and be visible
  3474. // to AWS KMS. When you create a new AWS principal (for example, an IAM user
  3475. // or role), you might need to enforce a delay before specifying the new principal
  3476. // in a key policy because the new principal might not immediately be visible
  3477. // to AWS KMS. For more information, see Changes that I make are not always
  3478. // immediately visible (http://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency)
  3479. // in the IAM User Guide.
  3480. //
  3481. // The policy size limit is 32 KiB (32768 bytes).
  3482. Policy *string `min:"1" type:"string" required:"true"`
  3483. // The name of the key policy.
  3484. //
  3485. // This value must be default.
  3486. PolicyName *string `min:"1" type:"string" required:"true"`
  3487. }
  3488. // String returns the string representation
  3489. func (s PutKeyPolicyInput) String() string {
  3490. return awsutil.Prettify(s)
  3491. }
  3492. // GoString returns the string representation
  3493. func (s PutKeyPolicyInput) GoString() string {
  3494. return s.String()
  3495. }
  3496. // Validate inspects the fields of the type to determine if they are valid.
  3497. func (s *PutKeyPolicyInput) Validate() error {
  3498. invalidParams := request.ErrInvalidParams{Context: "PutKeyPolicyInput"}
  3499. if s.KeyId == nil {
  3500. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3501. }
  3502. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3503. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3504. }
  3505. if s.Policy == nil {
  3506. invalidParams.Add(request.NewErrParamRequired("Policy"))
  3507. }
  3508. if s.Policy != nil && len(*s.Policy) < 1 {
  3509. invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
  3510. }
  3511. if s.PolicyName == nil {
  3512. invalidParams.Add(request.NewErrParamRequired("PolicyName"))
  3513. }
  3514. if s.PolicyName != nil && len(*s.PolicyName) < 1 {
  3515. invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
  3516. }
  3517. if invalidParams.Len() > 0 {
  3518. return invalidParams
  3519. }
  3520. return nil
  3521. }
  3522. type PutKeyPolicyOutput struct {
  3523. _ struct{} `type:"structure"`
  3524. }
  3525. // String returns the string representation
  3526. func (s PutKeyPolicyOutput) String() string {
  3527. return awsutil.Prettify(s)
  3528. }
  3529. // GoString returns the string representation
  3530. func (s PutKeyPolicyOutput) GoString() string {
  3531. return s.String()
  3532. }
  3533. type ReEncryptInput struct {
  3534. _ struct{} `type:"structure"`
  3535. // Ciphertext of the data to re-encrypt.
  3536. //
  3537. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  3538. CiphertextBlob []byte `min:"1" type:"blob" required:"true"`
  3539. // Encryption context to be used when the data is re-encrypted.
  3540. DestinationEncryptionContext map[string]*string `type:"map"`
  3541. // A unique identifier for the customer master key used to re-encrypt the data.
  3542. // This value can be a globally unique identifier, a fully specified ARN to
  3543. // either an alias or a key, or an alias name prefixed by "alias/".
  3544. //
  3545. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3546. //
  3547. // Alias ARN Example - arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
  3548. //
  3549. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3550. //
  3551. // Alias Name Example - alias/MyAliasName
  3552. DestinationKeyId *string `min:"1" type:"string" required:"true"`
  3553. // A list of grant tokens.
  3554. //
  3555. // For more information, see Grant Tokens (http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  3556. // in the AWS Key Management Service Developer Guide.
  3557. GrantTokens []*string `type:"list"`
  3558. // Encryption context used to encrypt and decrypt the data specified in the
  3559. // CiphertextBlob parameter.
  3560. SourceEncryptionContext map[string]*string `type:"map"`
  3561. }
  3562. // String returns the string representation
  3563. func (s ReEncryptInput) String() string {
  3564. return awsutil.Prettify(s)
  3565. }
  3566. // GoString returns the string representation
  3567. func (s ReEncryptInput) GoString() string {
  3568. return s.String()
  3569. }
  3570. // Validate inspects the fields of the type to determine if they are valid.
  3571. func (s *ReEncryptInput) Validate() error {
  3572. invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"}
  3573. if s.CiphertextBlob == nil {
  3574. invalidParams.Add(request.NewErrParamRequired("CiphertextBlob"))
  3575. }
  3576. if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
  3577. invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1))
  3578. }
  3579. if s.DestinationKeyId == nil {
  3580. invalidParams.Add(request.NewErrParamRequired("DestinationKeyId"))
  3581. }
  3582. if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 {
  3583. invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1))
  3584. }
  3585. if invalidParams.Len() > 0 {
  3586. return invalidParams
  3587. }
  3588. return nil
  3589. }
  3590. type ReEncryptOutput struct {
  3591. _ struct{} `type:"structure"`
  3592. // The re-encrypted data. If you are using the CLI, the value is Base64 encoded.
  3593. // Otherwise, it is not encoded.
  3594. //
  3595. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  3596. CiphertextBlob []byte `min:"1" type:"blob"`
  3597. // Unique identifier of the key used to re-encrypt the data.
  3598. KeyId *string `min:"1" type:"string"`
  3599. // Unique identifier of the key used to originally encrypt the data.
  3600. SourceKeyId *string `min:"1" type:"string"`
  3601. }
  3602. // String returns the string representation
  3603. func (s ReEncryptOutput) String() string {
  3604. return awsutil.Prettify(s)
  3605. }
  3606. // GoString returns the string representation
  3607. func (s ReEncryptOutput) GoString() string {
  3608. return s.String()
  3609. }
  3610. type RetireGrantInput struct {
  3611. _ struct{} `type:"structure"`
  3612. // Unique identifier of the grant to be retired. The grant ID is returned by
  3613. // the CreateGrant function.
  3614. //
  3615. // Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123
  3616. GrantId *string `min:"1" type:"string"`
  3617. // Token that identifies the grant to be retired.
  3618. GrantToken *string `min:"1" type:"string"`
  3619. // A unique identifier for the customer master key associated with the grant.
  3620. // This value can be a globally unique identifier or a fully specified ARN of
  3621. // the key.
  3622. //
  3623. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3624. //
  3625. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3626. KeyId *string `min:"1" type:"string"`
  3627. }
  3628. // String returns the string representation
  3629. func (s RetireGrantInput) String() string {
  3630. return awsutil.Prettify(s)
  3631. }
  3632. // GoString returns the string representation
  3633. func (s RetireGrantInput) GoString() string {
  3634. return s.String()
  3635. }
  3636. // Validate inspects the fields of the type to determine if they are valid.
  3637. func (s *RetireGrantInput) Validate() error {
  3638. invalidParams := request.ErrInvalidParams{Context: "RetireGrantInput"}
  3639. if s.GrantId != nil && len(*s.GrantId) < 1 {
  3640. invalidParams.Add(request.NewErrParamMinLen("GrantId", 1))
  3641. }
  3642. if s.GrantToken != nil && len(*s.GrantToken) < 1 {
  3643. invalidParams.Add(request.NewErrParamMinLen("GrantToken", 1))
  3644. }
  3645. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3646. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3647. }
  3648. if invalidParams.Len() > 0 {
  3649. return invalidParams
  3650. }
  3651. return nil
  3652. }
  3653. type RetireGrantOutput struct {
  3654. _ struct{} `type:"structure"`
  3655. }
  3656. // String returns the string representation
  3657. func (s RetireGrantOutput) String() string {
  3658. return awsutil.Prettify(s)
  3659. }
  3660. // GoString returns the string representation
  3661. func (s RetireGrantOutput) GoString() string {
  3662. return s.String()
  3663. }
  3664. type RevokeGrantInput struct {
  3665. _ struct{} `type:"structure"`
  3666. // Identifier of the grant to be revoked.
  3667. GrantId *string `min:"1" type:"string" required:"true"`
  3668. // A unique identifier for the customer master key associated with the grant.
  3669. // This value can be a globally unique identifier or the fully specified ARN
  3670. // to a key.
  3671. //
  3672. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3673. //
  3674. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3675. KeyId *string `min:"1" type:"string" required:"true"`
  3676. }
  3677. // String returns the string representation
  3678. func (s RevokeGrantInput) String() string {
  3679. return awsutil.Prettify(s)
  3680. }
  3681. // GoString returns the string representation
  3682. func (s RevokeGrantInput) GoString() string {
  3683. return s.String()
  3684. }
  3685. // Validate inspects the fields of the type to determine if they are valid.
  3686. func (s *RevokeGrantInput) Validate() error {
  3687. invalidParams := request.ErrInvalidParams{Context: "RevokeGrantInput"}
  3688. if s.GrantId == nil {
  3689. invalidParams.Add(request.NewErrParamRequired("GrantId"))
  3690. }
  3691. if s.GrantId != nil && len(*s.GrantId) < 1 {
  3692. invalidParams.Add(request.NewErrParamMinLen("GrantId", 1))
  3693. }
  3694. if s.KeyId == nil {
  3695. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3696. }
  3697. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3698. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3699. }
  3700. if invalidParams.Len() > 0 {
  3701. return invalidParams
  3702. }
  3703. return nil
  3704. }
  3705. type RevokeGrantOutput struct {
  3706. _ struct{} `type:"structure"`
  3707. }
  3708. // String returns the string representation
  3709. func (s RevokeGrantOutput) String() string {
  3710. return awsutil.Prettify(s)
  3711. }
  3712. // GoString returns the string representation
  3713. func (s RevokeGrantOutput) GoString() string {
  3714. return s.String()
  3715. }
  3716. type ScheduleKeyDeletionInput struct {
  3717. _ struct{} `type:"structure"`
  3718. // The unique identifier for the customer master key (CMK) to delete.
  3719. //
  3720. // To specify this value, use the unique key ID or the Amazon Resource Name
  3721. // (ARN) of the CMK. Examples:
  3722. //
  3723. // Unique key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  3724. //
  3725. // Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  3726. //
  3727. // To obtain the unique key ID and key ARN for a given CMK, use ListKeys
  3728. // or DescribeKey.
  3729. KeyId *string `min:"1" type:"string" required:"true"`
  3730. // The waiting period, specified in number of days. After the waiting period
  3731. // ends, AWS KMS deletes the customer master key (CMK).
  3732. //
  3733. // This value is optional. If you include a value, it must be between 7 and
  3734. // 30, inclusive. If you do not include a value, it defaults to 30.
  3735. PendingWindowInDays *int64 `min:"1" type:"integer"`
  3736. }
  3737. // String returns the string representation
  3738. func (s ScheduleKeyDeletionInput) String() string {
  3739. return awsutil.Prettify(s)
  3740. }
  3741. // GoString returns the string representation
  3742. func (s ScheduleKeyDeletionInput) GoString() string {
  3743. return s.String()
  3744. }
  3745. // Validate inspects the fields of the type to determine if they are valid.
  3746. func (s *ScheduleKeyDeletionInput) Validate() error {
  3747. invalidParams := request.ErrInvalidParams{Context: "ScheduleKeyDeletionInput"}
  3748. if s.KeyId == nil {
  3749. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3750. }
  3751. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3752. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3753. }
  3754. if s.PendingWindowInDays != nil && *s.PendingWindowInDays < 1 {
  3755. invalidParams.Add(request.NewErrParamMinValue("PendingWindowInDays", 1))
  3756. }
  3757. if invalidParams.Len() > 0 {
  3758. return invalidParams
  3759. }
  3760. return nil
  3761. }
  3762. type ScheduleKeyDeletionOutput struct {
  3763. _ struct{} `type:"structure"`
  3764. // The date and time after which AWS KMS deletes the customer master key (CMK).
  3765. DeletionDate *time.Time `type:"timestamp" timestampFormat:"unix"`
  3766. // The unique identifier of the customer master key (CMK) for which deletion
  3767. // is scheduled.
  3768. KeyId *string `min:"1" type:"string"`
  3769. }
  3770. // String returns the string representation
  3771. func (s ScheduleKeyDeletionOutput) String() string {
  3772. return awsutil.Prettify(s)
  3773. }
  3774. // GoString returns the string representation
  3775. func (s ScheduleKeyDeletionOutput) GoString() string {
  3776. return s.String()
  3777. }
  3778. type UpdateAliasInput struct {
  3779. _ struct{} `type:"structure"`
  3780. // String that contains the name of the alias to be modified. The name must
  3781. // start with the word "alias" followed by a forward slash (alias/). Aliases
  3782. // that begin with "alias/aws" are reserved.
  3783. AliasName *string `min:"1" type:"string" required:"true"`
  3784. // Unique identifier of the customer master key to be mapped to the alias. This
  3785. // value can be a globally unique identifier or the fully specified ARN of a
  3786. // key.
  3787. //
  3788. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3789. //
  3790. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3791. //
  3792. // You can call ListAliases to verify that the alias is mapped to the correct
  3793. // TargetKeyId.
  3794. TargetKeyId *string `min:"1" type:"string" required:"true"`
  3795. }
  3796. // String returns the string representation
  3797. func (s UpdateAliasInput) String() string {
  3798. return awsutil.Prettify(s)
  3799. }
  3800. // GoString returns the string representation
  3801. func (s UpdateAliasInput) GoString() string {
  3802. return s.String()
  3803. }
  3804. // Validate inspects the fields of the type to determine if they are valid.
  3805. func (s *UpdateAliasInput) Validate() error {
  3806. invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"}
  3807. if s.AliasName == nil {
  3808. invalidParams.Add(request.NewErrParamRequired("AliasName"))
  3809. }
  3810. if s.AliasName != nil && len(*s.AliasName) < 1 {
  3811. invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
  3812. }
  3813. if s.TargetKeyId == nil {
  3814. invalidParams.Add(request.NewErrParamRequired("TargetKeyId"))
  3815. }
  3816. if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 {
  3817. invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1))
  3818. }
  3819. if invalidParams.Len() > 0 {
  3820. return invalidParams
  3821. }
  3822. return nil
  3823. }
  3824. type UpdateAliasOutput struct {
  3825. _ struct{} `type:"structure"`
  3826. }
  3827. // String returns the string representation
  3828. func (s UpdateAliasOutput) String() string {
  3829. return awsutil.Prettify(s)
  3830. }
  3831. // GoString returns the string representation
  3832. func (s UpdateAliasOutput) GoString() string {
  3833. return s.String()
  3834. }
  3835. type UpdateKeyDescriptionInput struct {
  3836. _ struct{} `type:"structure"`
  3837. // New description for the key.
  3838. Description *string `type:"string" required:"true"`
  3839. // A unique identifier for the customer master key. This value can be a globally
  3840. // unique identifier or the fully specified ARN to a key.
  3841. //
  3842. // Key ARN Example - arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
  3843. //
  3844. // Globally Unique Key ID Example - 12345678-1234-1234-1234-123456789012
  3845. KeyId *string `min:"1" type:"string" required:"true"`
  3846. }
  3847. // String returns the string representation
  3848. func (s UpdateKeyDescriptionInput) String() string {
  3849. return awsutil.Prettify(s)
  3850. }
  3851. // GoString returns the string representation
  3852. func (s UpdateKeyDescriptionInput) GoString() string {
  3853. return s.String()
  3854. }
  3855. // Validate inspects the fields of the type to determine if they are valid.
  3856. func (s *UpdateKeyDescriptionInput) Validate() error {
  3857. invalidParams := request.ErrInvalidParams{Context: "UpdateKeyDescriptionInput"}
  3858. if s.Description == nil {
  3859. invalidParams.Add(request.NewErrParamRequired("Description"))
  3860. }
  3861. if s.KeyId == nil {
  3862. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  3863. }
  3864. if s.KeyId != nil && len(*s.KeyId) < 1 {
  3865. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  3866. }
  3867. if invalidParams.Len() > 0 {
  3868. return invalidParams
  3869. }
  3870. return nil
  3871. }
  3872. type UpdateKeyDescriptionOutput struct {
  3873. _ struct{} `type:"structure"`
  3874. }
  3875. // String returns the string representation
  3876. func (s UpdateKeyDescriptionOutput) String() string {
  3877. return awsutil.Prettify(s)
  3878. }
  3879. // GoString returns the string representation
  3880. func (s UpdateKeyDescriptionOutput) GoString() string {
  3881. return s.String()
  3882. }
  3883. const (
  3884. // @enum AlgorithmSpec
  3885. AlgorithmSpecRsaesPkcs1V15 = "RSAES_PKCS1_V1_5"
  3886. // @enum AlgorithmSpec
  3887. AlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1"
  3888. // @enum AlgorithmSpec
  3889. AlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256"
  3890. )
  3891. const (
  3892. // @enum DataKeySpec
  3893. DataKeySpecAes256 = "AES_256"
  3894. // @enum DataKeySpec
  3895. DataKeySpecAes128 = "AES_128"
  3896. )
  3897. const (
  3898. // @enum ExpirationModelType
  3899. ExpirationModelTypeKeyMaterialExpires = "KEY_MATERIAL_EXPIRES"
  3900. // @enum ExpirationModelType
  3901. ExpirationModelTypeKeyMaterialDoesNotExpire = "KEY_MATERIAL_DOES_NOT_EXPIRE"
  3902. )
  3903. const (
  3904. // @enum GrantOperation
  3905. GrantOperationDecrypt = "Decrypt"
  3906. // @enum GrantOperation
  3907. GrantOperationEncrypt = "Encrypt"
  3908. // @enum GrantOperation
  3909. GrantOperationGenerateDataKey = "GenerateDataKey"
  3910. // @enum GrantOperation
  3911. GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext"
  3912. // @enum GrantOperation
  3913. GrantOperationReEncryptFrom = "ReEncryptFrom"
  3914. // @enum GrantOperation
  3915. GrantOperationReEncryptTo = "ReEncryptTo"
  3916. // @enum GrantOperation
  3917. GrantOperationCreateGrant = "CreateGrant"
  3918. // @enum GrantOperation
  3919. GrantOperationRetireGrant = "RetireGrant"
  3920. // @enum GrantOperation
  3921. GrantOperationDescribeKey = "DescribeKey"
  3922. )
  3923. const (
  3924. // @enum KeyState
  3925. KeyStateEnabled = "Enabled"
  3926. // @enum KeyState
  3927. KeyStateDisabled = "Disabled"
  3928. // @enum KeyState
  3929. KeyStatePendingDeletion = "PendingDeletion"
  3930. // @enum KeyState
  3931. KeyStatePendingImport = "PendingImport"
  3932. )
  3933. const (
  3934. // @enum KeyUsageType
  3935. KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT"
  3936. )
  3937. const (
  3938. // @enum OriginType
  3939. OriginTypeAwsKms = "AWS_KMS"
  3940. // @enum OriginType
  3941. OriginTypeExternal = "EXTERNAL"
  3942. )
  3943. const (
  3944. // @enum WrappingKeySpec
  3945. WrappingKeySpecRsa2048 = "RSA_2048"
  3946. )