api.go 535 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package kms
  3. import (
  4. "fmt"
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
  11. )
  12. const opCancelKeyDeletion = "CancelKeyDeletion"
  13. // CancelKeyDeletionRequest generates a "aws/request.Request" representing the
  14. // client's request for the CancelKeyDeletion operation. The "output" return
  15. // value will be populated with the request's response once the request completes
  16. // successfully.
  17. //
  18. // Use "Send" method on the returned Request to send the API call to the service.
  19. // the "output" return value is not valid until after Send returns without error.
  20. //
  21. // See CancelKeyDeletion for more information on using the CancelKeyDeletion
  22. // API call, and error handling.
  23. //
  24. // This method is useful when you want to inject custom logic or configuration
  25. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  26. //
  27. //
  28. // // Example sending a request using the CancelKeyDeletionRequest method.
  29. // req, resp := client.CancelKeyDeletionRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion
  37. func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *request.Request, output *CancelKeyDeletionOutput) {
  38. op := &request.Operation{
  39. Name: opCancelKeyDeletion,
  40. HTTPMethod: "POST",
  41. HTTPPath: "/",
  42. }
  43. if input == nil {
  44. input = &CancelKeyDeletionInput{}
  45. }
  46. output = &CancelKeyDeletionOutput{}
  47. req = c.newRequest(op, input, output)
  48. return
  49. }
  50. // CancelKeyDeletion API operation for AWS Key Management Service.
  51. //
  52. // Cancels the deletion of a customer master key (CMK). When this operation
  53. // succeeds, the key state of the CMK is Disabled. To enable the CMK, use EnableKey.
  54. // You cannot perform this operation on a CMK in a different AWS account.
  55. //
  56. // For more information about scheduling and canceling deletion of a CMK, see
  57. // Deleting Customer Master Keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html)
  58. // in the AWS Key Management Service Developer Guide.
  59. //
  60. // The CMK that you use for this operation must be in a compatible key state.
  61. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  62. // in the AWS Key Management Service Developer Guide.
  63. //
  64. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  65. // with awserr.Error's Code and Message methods to get detailed information about
  66. // the error.
  67. //
  68. // See the AWS API reference guide for AWS Key Management Service's
  69. // API operation CancelKeyDeletion for usage and error information.
  70. //
  71. // Returned Error Types:
  72. // * NotFoundException
  73. // The request was rejected because the specified entity or resource could not
  74. // be found.
  75. //
  76. // * InvalidArnException
  77. // The request was rejected because a specified ARN, or an ARN in a key policy,
  78. // is not valid.
  79. //
  80. // * DependencyTimeoutException
  81. // The system timed out while trying to fulfill the request. The request can
  82. // be retried.
  83. //
  84. // * InternalException
  85. // The request was rejected because an internal exception occurred. The request
  86. // can be retried.
  87. //
  88. // * InvalidStateException
  89. // The request was rejected because the state of the specified resource is not
  90. // valid for this request.
  91. //
  92. // For more information about how key state affects the use of a CMK, see How
  93. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  94. // in the AWS Key Management Service Developer Guide .
  95. //
  96. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion
  97. func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) {
  98. req, out := c.CancelKeyDeletionRequest(input)
  99. return out, req.Send()
  100. }
  101. // CancelKeyDeletionWithContext is the same as CancelKeyDeletion with the addition of
  102. // the ability to pass a context and additional request options.
  103. //
  104. // See CancelKeyDeletion for details on how to use this API operation.
  105. //
  106. // The context must be non-nil and will be used for request cancellation. If
  107. // the context is nil a panic will occur. In the future the SDK may create
  108. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  109. // for more information on using Contexts.
  110. func (c *KMS) CancelKeyDeletionWithContext(ctx aws.Context, input *CancelKeyDeletionInput, opts ...request.Option) (*CancelKeyDeletionOutput, error) {
  111. req, out := c.CancelKeyDeletionRequest(input)
  112. req.SetContext(ctx)
  113. req.ApplyOptions(opts...)
  114. return out, req.Send()
  115. }
  116. const opConnectCustomKeyStore = "ConnectCustomKeyStore"
  117. // ConnectCustomKeyStoreRequest generates a "aws/request.Request" representing the
  118. // client's request for the ConnectCustomKeyStore operation. The "output" return
  119. // value will be populated with the request's response once the request completes
  120. // successfully.
  121. //
  122. // Use "Send" method on the returned Request to send the API call to the service.
  123. // the "output" return value is not valid until after Send returns without error.
  124. //
  125. // See ConnectCustomKeyStore for more information on using the ConnectCustomKeyStore
  126. // API call, and error handling.
  127. //
  128. // This method is useful when you want to inject custom logic or configuration
  129. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  130. //
  131. //
  132. // // Example sending a request using the ConnectCustomKeyStoreRequest method.
  133. // req, resp := client.ConnectCustomKeyStoreRequest(params)
  134. //
  135. // err := req.Send()
  136. // if err == nil { // resp is now filled
  137. // fmt.Println(resp)
  138. // }
  139. //
  140. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ConnectCustomKeyStore
  141. func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (req *request.Request, output *ConnectCustomKeyStoreOutput) {
  142. op := &request.Operation{
  143. Name: opConnectCustomKeyStore,
  144. HTTPMethod: "POST",
  145. HTTPPath: "/",
  146. }
  147. if input == nil {
  148. input = &ConnectCustomKeyStoreInput{}
  149. }
  150. output = &ConnectCustomKeyStoreOutput{}
  151. req = c.newRequest(op, input, output)
  152. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  153. return
  154. }
  155. // ConnectCustomKeyStore API operation for AWS Key Management Service.
  156. //
  157. // Connects or reconnects a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  158. // to its associated AWS CloudHSM cluster.
  159. //
  160. // The custom key store must be connected before you can create customer master
  161. // keys (CMKs) in the key store or use the CMKs it contains. You can disconnect
  162. // and reconnect a custom key store at any time.
  163. //
  164. // To connect a custom key store, its associated AWS CloudHSM cluster must have
  165. // at least one active HSM. To get the number of active HSMs in a cluster, use
  166. // the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  167. // operation. To add HSMs to the cluster, use the CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  168. // operation.
  169. //
  170. // The connection process can take an extended amount of time to complete; up
  171. // to 20 minutes. This operation starts the connection process, but it does
  172. // not wait for it to complete. When it succeeds, this operation quickly returns
  173. // an HTTP 200 response and a JSON object with no properties. However, this
  174. // response does not indicate that the custom key store is connected. To get
  175. // the connection state of the custom key store, use the DescribeCustomKeyStores
  176. // operation.
  177. //
  178. // During the connection process, AWS KMS finds the AWS CloudHSM cluster that
  179. // is associated with the custom key store, creates the connection infrastructure,
  180. // connects to the cluster, logs into the AWS CloudHSM client as the kmsuser
  181. // crypto user (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser)
  182. // (CU), and rotates its password.
  183. //
  184. // The ConnectCustomKeyStore operation might fail for various reasons. To find
  185. // the reason, use the DescribeCustomKeyStores operation and see the ConnectionErrorCode
  186. // in the response. For help interpreting the ConnectionErrorCode, see CustomKeyStoresListEntry.
  187. //
  188. // To fix the failure, use the DisconnectCustomKeyStore operation to disconnect
  189. // the custom key store, correct the error, use the UpdateCustomKeyStore operation
  190. // if necessary, and then use ConnectCustomKeyStore again.
  191. //
  192. // If you are having trouble connecting or disconnecting a custom key store,
  193. // see Troubleshooting a Custom Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html)
  194. // in the AWS Key Management Service Developer Guide.
  195. //
  196. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  197. // with awserr.Error's Code and Message methods to get detailed information about
  198. // the error.
  199. //
  200. // See the AWS API reference guide for AWS Key Management Service's
  201. // API operation ConnectCustomKeyStore for usage and error information.
  202. //
  203. // Returned Error Types:
  204. // * CloudHsmClusterNotActiveException
  205. // The request was rejected because the AWS CloudHSM cluster that is associated
  206. // with the custom key store is not active. Initialize and activate the cluster
  207. // and try the command again. For detailed instructions, see Getting Started
  208. // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
  209. // in the AWS CloudHSM User Guide.
  210. //
  211. // * CustomKeyStoreInvalidStateException
  212. // The request was rejected because of the ConnectionState of the custom key
  213. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  214. // operation.
  215. //
  216. // This exception is thrown under the following conditions:
  217. //
  218. // * You requested the CreateKey or GenerateRandom operation in a custom
  219. // key store that is not connected. These operations are valid only when
  220. // the custom key store ConnectionState is CONNECTED.
  221. //
  222. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  223. // on a custom key store that is not disconnected. This operation is valid
  224. // only when the custom key store ConnectionState is DISCONNECTED.
  225. //
  226. // * You requested the ConnectCustomKeyStore operation on a custom key store
  227. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  228. // for all other ConnectionState values.
  229. //
  230. // * CustomKeyStoreNotFoundException
  231. // The request was rejected because AWS KMS cannot find a custom key store with
  232. // the specified key store name or ID.
  233. //
  234. // * InternalException
  235. // The request was rejected because an internal exception occurred. The request
  236. // can be retried.
  237. //
  238. // * CloudHsmClusterInvalidConfigurationException
  239. // The request was rejected because the associated AWS CloudHSM cluster did
  240. // not meet the configuration requirements for a custom key store.
  241. //
  242. // * The cluster must be configured with private subnets in at least two
  243. // different Availability Zones in the Region.
  244. //
  245. // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  246. // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
  247. // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
  248. // rules and the Destination in the outbound rules must match the security
  249. // group ID. These rules are set by default when you create the cluster.
  250. // Do not delete or change them. To get information about a particular security
  251. // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
  252. // operation.
  253. //
  254. // * The cluster must contain at least as many HSMs as the operation requires.
  255. // To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  256. // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
  257. // operations, the AWS CloudHSM cluster must have at least two active HSMs,
  258. // each in a different Availability Zone. For the ConnectCustomKeyStore operation,
  259. // the AWS CloudHSM must contain at least one active HSM.
  260. //
  261. // For information about the requirements for an AWS CloudHSM cluster that is
  262. // associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  263. // in the AWS Key Management Service Developer Guide. For information about
  264. // creating a private subnet for an AWS CloudHSM cluster, see Create a Private
  265. // Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
  266. // in the AWS CloudHSM User Guide. For information about cluster security groups,
  267. // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  268. // in the AWS CloudHSM User Guide .
  269. //
  270. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ConnectCustomKeyStore
  271. func (c *KMS) ConnectCustomKeyStore(input *ConnectCustomKeyStoreInput) (*ConnectCustomKeyStoreOutput, error) {
  272. req, out := c.ConnectCustomKeyStoreRequest(input)
  273. return out, req.Send()
  274. }
  275. // ConnectCustomKeyStoreWithContext is the same as ConnectCustomKeyStore with the addition of
  276. // the ability to pass a context and additional request options.
  277. //
  278. // See ConnectCustomKeyStore for details on how to use this API operation.
  279. //
  280. // The context must be non-nil and will be used for request cancellation. If
  281. // the context is nil a panic will occur. In the future the SDK may create
  282. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  283. // for more information on using Contexts.
  284. func (c *KMS) ConnectCustomKeyStoreWithContext(ctx aws.Context, input *ConnectCustomKeyStoreInput, opts ...request.Option) (*ConnectCustomKeyStoreOutput, error) {
  285. req, out := c.ConnectCustomKeyStoreRequest(input)
  286. req.SetContext(ctx)
  287. req.ApplyOptions(opts...)
  288. return out, req.Send()
  289. }
  290. const opCreateAlias = "CreateAlias"
  291. // CreateAliasRequest generates a "aws/request.Request" representing the
  292. // client's request for the CreateAlias operation. The "output" return
  293. // value will be populated with the request's response once the request completes
  294. // successfully.
  295. //
  296. // Use "Send" method on the returned Request to send the API call to the service.
  297. // the "output" return value is not valid until after Send returns without error.
  298. //
  299. // See CreateAlias for more information on using the CreateAlias
  300. // API call, and error handling.
  301. //
  302. // This method is useful when you want to inject custom logic or configuration
  303. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  304. //
  305. //
  306. // // Example sending a request using the CreateAliasRequest method.
  307. // req, resp := client.CreateAliasRequest(params)
  308. //
  309. // err := req.Send()
  310. // if err == nil { // resp is now filled
  311. // fmt.Println(resp)
  312. // }
  313. //
  314. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias
  315. func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, output *CreateAliasOutput) {
  316. op := &request.Operation{
  317. Name: opCreateAlias,
  318. HTTPMethod: "POST",
  319. HTTPPath: "/",
  320. }
  321. if input == nil {
  322. input = &CreateAliasInput{}
  323. }
  324. output = &CreateAliasOutput{}
  325. req = c.newRequest(op, input, output)
  326. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  327. return
  328. }
  329. // CreateAlias API operation for AWS Key Management Service.
  330. //
  331. // Creates a display name for a customer managed customer master key (CMK).
  332. // You can use an alias to identify a CMK in cryptographic operations, such
  333. // as Encrypt and GenerateDataKey. You can change the CMK associated with the
  334. // alias at any time.
  335. //
  336. // Aliases are easier to remember than key IDs. They can also help to simplify
  337. // your applications. For example, if you use an alias in your code, you can
  338. // change the CMK your code uses by associating a given alias with a different
  339. // CMK.
  340. //
  341. // To run the same code in multiple AWS regions, use an alias in your code,
  342. // such as alias/ApplicationKey. Then, in each AWS Region, create an alias/ApplicationKey
  343. // alias that is associated with a CMK in that Region. When you run your code,
  344. // it uses the alias/ApplicationKey CMK for that AWS Region without any Region-specific
  345. // code.
  346. //
  347. // This operation does not return a response. To get the alias that you created,
  348. // use the ListAliases operation.
  349. //
  350. // To use aliases successfully, be aware of the following information.
  351. //
  352. // * Each alias points to only one CMK at a time, although a single CMK can
  353. // have multiple aliases. The alias and its associated CMK must be in the
  354. // same AWS account and Region.
  355. //
  356. // * You can associate an alias with any customer managed CMK in the same
  357. // AWS account and Region. However, you do not have permission to associate
  358. // an alias with an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk)
  359. // or an AWS owned CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk).
  360. //
  361. // * To change the CMK associated with an alias, use the UpdateAlias operation.
  362. // The current CMK and the new CMK must be the same type (both symmetric
  363. // or both asymmetric) and they must have the same key usage (ENCRYPT_DECRYPT
  364. // or SIGN_VERIFY). This restriction prevents cryptographic errors in code
  365. // that uses aliases.
  366. //
  367. // * The alias name must begin with alias/ followed by a name, such as alias/ExampleAlias.
  368. // It can contain only alphanumeric characters, forward slashes (/), underscores
  369. // (_), and dashes (-). The alias name cannot begin with alias/aws/. The
  370. // alias/aws/ prefix is reserved for AWS managed CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk).
  371. //
  372. // * The alias name must be unique within an AWS Region. However, you can
  373. // use the same alias name in multiple Regions of the same AWS account. Each
  374. // instance of the alias is associated with a CMK in its Region.
  375. //
  376. // * After you create an alias, you cannot change its alias name. However,
  377. // you can use the DeleteAlias operation to delete the alias and then create
  378. // a new alias with the desired name.
  379. //
  380. // * You can use an alias name or alias ARN to identify a CMK in AWS KMS
  381. // cryptographic operations and in the DescribeKey operation. However, you
  382. // cannot use alias names or alias ARNs in API operations that manage CMKs,
  383. // such as DisableKey or GetKeyPolicy. For information about the valid CMK
  384. // identifiers for each AWS KMS API operation, see the descriptions of the
  385. // KeyId parameter in the API operation documentation.
  386. //
  387. // Because an alias is not a property of a CMK, you can delete and change the
  388. // aliases of a CMK without affecting the CMK. Also, aliases do not appear in
  389. // the response from the DescribeKey operation. To get the aliases and alias
  390. // ARNs of CMKs in each AWS account and Region, use the ListAliases operation.
  391. //
  392. // The CMK that you use for this operation must be in a compatible key state.
  393. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  394. // in the AWS Key Management Service Developer Guide.
  395. //
  396. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  397. // with awserr.Error's Code and Message methods to get detailed information about
  398. // the error.
  399. //
  400. // See the AWS API reference guide for AWS Key Management Service's
  401. // API operation CreateAlias for usage and error information.
  402. //
  403. // Returned Error Types:
  404. // * DependencyTimeoutException
  405. // The system timed out while trying to fulfill the request. The request can
  406. // be retried.
  407. //
  408. // * AlreadyExistsException
  409. // The request was rejected because it attempted to create a resource that already
  410. // exists.
  411. //
  412. // * NotFoundException
  413. // The request was rejected because the specified entity or resource could not
  414. // be found.
  415. //
  416. // * InvalidAliasNameException
  417. // The request was rejected because the specified alias name is not valid.
  418. //
  419. // * InternalException
  420. // The request was rejected because an internal exception occurred. The request
  421. // can be retried.
  422. //
  423. // * LimitExceededException
  424. // The request was rejected because a limit was exceeded. For more information,
  425. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  426. // in the AWS Key Management Service Developer Guide.
  427. //
  428. // * InvalidStateException
  429. // The request was rejected because the state of the specified resource is not
  430. // valid for this request.
  431. //
  432. // For more information about how key state affects the use of a CMK, see How
  433. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  434. // in the AWS Key Management Service Developer Guide .
  435. //
  436. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias
  437. func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) {
  438. req, out := c.CreateAliasRequest(input)
  439. return out, req.Send()
  440. }
  441. // CreateAliasWithContext is the same as CreateAlias with the addition of
  442. // the ability to pass a context and additional request options.
  443. //
  444. // See CreateAlias for details on how to use this API operation.
  445. //
  446. // The context must be non-nil and will be used for request cancellation. If
  447. // the context is nil a panic will occur. In the future the SDK may create
  448. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  449. // for more information on using Contexts.
  450. func (c *KMS) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) {
  451. req, out := c.CreateAliasRequest(input)
  452. req.SetContext(ctx)
  453. req.ApplyOptions(opts...)
  454. return out, req.Send()
  455. }
  456. const opCreateCustomKeyStore = "CreateCustomKeyStore"
  457. // CreateCustomKeyStoreRequest generates a "aws/request.Request" representing the
  458. // client's request for the CreateCustomKeyStore operation. The "output" return
  459. // value will be populated with the request's response once the request completes
  460. // successfully.
  461. //
  462. // Use "Send" method on the returned Request to send the API call to the service.
  463. // the "output" return value is not valid until after Send returns without error.
  464. //
  465. // See CreateCustomKeyStore for more information on using the CreateCustomKeyStore
  466. // API call, and error handling.
  467. //
  468. // This method is useful when you want to inject custom logic or configuration
  469. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  470. //
  471. //
  472. // // Example sending a request using the CreateCustomKeyStoreRequest method.
  473. // req, resp := client.CreateCustomKeyStoreRequest(params)
  474. //
  475. // err := req.Send()
  476. // if err == nil { // resp is now filled
  477. // fmt.Println(resp)
  478. // }
  479. //
  480. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateCustomKeyStore
  481. func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req *request.Request, output *CreateCustomKeyStoreOutput) {
  482. op := &request.Operation{
  483. Name: opCreateCustomKeyStore,
  484. HTTPMethod: "POST",
  485. HTTPPath: "/",
  486. }
  487. if input == nil {
  488. input = &CreateCustomKeyStoreInput{}
  489. }
  490. output = &CreateCustomKeyStoreOutput{}
  491. req = c.newRequest(op, input, output)
  492. return
  493. }
  494. // CreateCustomKeyStore API operation for AWS Key Management Service.
  495. //
  496. // Creates a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  497. // that is associated with an AWS CloudHSM cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/clusters.html)
  498. // that you own and manage.
  499. //
  500. // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  501. // feature in AWS KMS, which combines the convenience and extensive integration
  502. // of AWS KMS with the isolation and control of a single-tenant key store.
  503. //
  504. // Before you create the custom key store, you must assemble the required elements,
  505. // including an AWS CloudHSM cluster that fulfills the requirements for a custom
  506. // key store. For details about the required elements, see Assemble the Prerequisites
  507. // (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  508. // in the AWS Key Management Service Developer Guide.
  509. //
  510. // When the operation completes successfully, it returns the ID of the new custom
  511. // key store. Before you can use your new custom key store, you need to use
  512. // the ConnectCustomKeyStore operation to connect the new key store to its AWS
  513. // CloudHSM cluster. Even if you are not going to use your custom key store
  514. // immediately, you might want to connect it to verify that all settings are
  515. // correct and then disconnect it until you are ready to use it.
  516. //
  517. // For help with failures, see Troubleshooting a Custom Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html)
  518. // in the AWS Key Management Service Developer Guide.
  519. //
  520. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  521. // with awserr.Error's Code and Message methods to get detailed information about
  522. // the error.
  523. //
  524. // See the AWS API reference guide for AWS Key Management Service's
  525. // API operation CreateCustomKeyStore for usage and error information.
  526. //
  527. // Returned Error Types:
  528. // * CloudHsmClusterInUseException
  529. // The request was rejected because the specified AWS CloudHSM cluster is already
  530. // associated with a custom key store or it shares a backup history with a cluster
  531. // that is associated with a custom key store. Each custom key store must be
  532. // associated with a different AWS CloudHSM cluster.
  533. //
  534. // Clusters that share a backup history have the same cluster certificate. To
  535. // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  536. // operation.
  537. //
  538. // * CustomKeyStoreNameInUseException
  539. // The request was rejected because the specified custom key store name is already
  540. // assigned to another custom key store in the account. Try again with a custom
  541. // key store name that is unique in the account.
  542. //
  543. // * CloudHsmClusterNotFoundException
  544. // The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster
  545. // with the specified cluster ID. Retry the request with a different cluster
  546. // ID.
  547. //
  548. // * InternalException
  549. // The request was rejected because an internal exception occurred. The request
  550. // can be retried.
  551. //
  552. // * CloudHsmClusterNotActiveException
  553. // The request was rejected because the AWS CloudHSM cluster that is associated
  554. // with the custom key store is not active. Initialize and activate the cluster
  555. // and try the command again. For detailed instructions, see Getting Started
  556. // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
  557. // in the AWS CloudHSM User Guide.
  558. //
  559. // * IncorrectTrustAnchorException
  560. // The request was rejected because the trust anchor certificate in the request
  561. // is not the trust anchor certificate for the specified AWS CloudHSM cluster.
  562. //
  563. // When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr),
  564. // you create the trust anchor certificate and save it in the customerCA.crt
  565. // file.
  566. //
  567. // * CloudHsmClusterInvalidConfigurationException
  568. // The request was rejected because the associated AWS CloudHSM cluster did
  569. // not meet the configuration requirements for a custom key store.
  570. //
  571. // * The cluster must be configured with private subnets in at least two
  572. // different Availability Zones in the Region.
  573. //
  574. // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  575. // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
  576. // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
  577. // rules and the Destination in the outbound rules must match the security
  578. // group ID. These rules are set by default when you create the cluster.
  579. // Do not delete or change them. To get information about a particular security
  580. // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
  581. // operation.
  582. //
  583. // * The cluster must contain at least as many HSMs as the operation requires.
  584. // To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  585. // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
  586. // operations, the AWS CloudHSM cluster must have at least two active HSMs,
  587. // each in a different Availability Zone. For the ConnectCustomKeyStore operation,
  588. // the AWS CloudHSM must contain at least one active HSM.
  589. //
  590. // For information about the requirements for an AWS CloudHSM cluster that is
  591. // associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  592. // in the AWS Key Management Service Developer Guide. For information about
  593. // creating a private subnet for an AWS CloudHSM cluster, see Create a Private
  594. // Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
  595. // in the AWS CloudHSM User Guide. For information about cluster security groups,
  596. // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  597. // in the AWS CloudHSM User Guide .
  598. //
  599. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateCustomKeyStore
  600. func (c *KMS) CreateCustomKeyStore(input *CreateCustomKeyStoreInput) (*CreateCustomKeyStoreOutput, error) {
  601. req, out := c.CreateCustomKeyStoreRequest(input)
  602. return out, req.Send()
  603. }
  604. // CreateCustomKeyStoreWithContext is the same as CreateCustomKeyStore with the addition of
  605. // the ability to pass a context and additional request options.
  606. //
  607. // See CreateCustomKeyStore for details on how to use this API operation.
  608. //
  609. // The context must be non-nil and will be used for request cancellation. If
  610. // the context is nil a panic will occur. In the future the SDK may create
  611. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  612. // for more information on using Contexts.
  613. func (c *KMS) CreateCustomKeyStoreWithContext(ctx aws.Context, input *CreateCustomKeyStoreInput, opts ...request.Option) (*CreateCustomKeyStoreOutput, error) {
  614. req, out := c.CreateCustomKeyStoreRequest(input)
  615. req.SetContext(ctx)
  616. req.ApplyOptions(opts...)
  617. return out, req.Send()
  618. }
  619. const opCreateGrant = "CreateGrant"
  620. // CreateGrantRequest generates a "aws/request.Request" representing the
  621. // client's request for the CreateGrant operation. The "output" return
  622. // value will be populated with the request's response once the request completes
  623. // successfully.
  624. //
  625. // Use "Send" method on the returned Request to send the API call to the service.
  626. // the "output" return value is not valid until after Send returns without error.
  627. //
  628. // See CreateGrant for more information on using the CreateGrant
  629. // API call, and error handling.
  630. //
  631. // This method is useful when you want to inject custom logic or configuration
  632. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  633. //
  634. //
  635. // // Example sending a request using the CreateGrantRequest method.
  636. // req, resp := client.CreateGrantRequest(params)
  637. //
  638. // err := req.Send()
  639. // if err == nil { // resp is now filled
  640. // fmt.Println(resp)
  641. // }
  642. //
  643. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant
  644. func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, output *CreateGrantOutput) {
  645. op := &request.Operation{
  646. Name: opCreateGrant,
  647. HTTPMethod: "POST",
  648. HTTPPath: "/",
  649. }
  650. if input == nil {
  651. input = &CreateGrantInput{}
  652. }
  653. output = &CreateGrantOutput{}
  654. req = c.newRequest(op, input, output)
  655. return
  656. }
  657. // CreateGrant API operation for AWS Key Management Service.
  658. //
  659. // Adds a grant to a customer master key (CMK). The grant allows the grantee
  660. // principal to use the CMK when the conditions specified in the grant are met.
  661. // When setting permissions, grants are an alternative to key policies.
  662. //
  663. // To create a grant that allows a cryptographic operation only when the request
  664. // includes a particular encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context),
  665. // use the Constraints parameter. For details, see GrantConstraints.
  666. //
  667. // You can create grants on symmetric and asymmetric CMKs. However, if the grant
  668. // allows an operation that the CMK does not support, CreateGrant fails with
  669. // a ValidationException.
  670. //
  671. // * Grants for symmetric CMKs cannot allow operations that are not supported
  672. // for symmetric CMKs, including Sign, Verify, and GetPublicKey. (There are
  673. // limited exceptions to this rule for legacy operations, but you should
  674. // not create a grant for an operation that AWS KMS does not support.)
  675. //
  676. // * Grants for asymmetric CMKs cannot allow operations that are not supported
  677. // for asymmetric CMKs, including operations that generate data keys (https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey)
  678. // or data key pairs (https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPair),
  679. // or operations related to automatic key rotation (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html),
  680. // imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html),
  681. // or CMKs in custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  682. //
  683. // * Grants for asymmetric CMKs with a KeyUsage of ENCRYPT_DECRYPT cannot
  684. // allow the Sign or Verify operations. Grants for asymmetric CMKs with a
  685. // KeyUsage of SIGN_VERIFY cannot allow the Encrypt or Decrypt operations.
  686. //
  687. // * Grants for asymmetric CMKs cannot include an encryption context grant
  688. // constraint. An encryption context is not supported on asymmetric CMKs.
  689. //
  690. // For information about symmetric and asymmetric CMKs, see Using Symmetric
  691. // and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
  692. // in the AWS Key Management Service Developer Guide.
  693. //
  694. // To perform this operation on a CMK in a different AWS account, specify the
  695. // key ARN in the value of the KeyId parameter. For more information about grants,
  696. // see Grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html)
  697. // in the AWS Key Management Service Developer Guide .
  698. //
  699. // The CMK that you use for this operation must be in a compatible key state.
  700. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  701. // in the AWS Key Management Service Developer Guide.
  702. //
  703. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  704. // with awserr.Error's Code and Message methods to get detailed information about
  705. // the error.
  706. //
  707. // See the AWS API reference guide for AWS Key Management Service's
  708. // API operation CreateGrant for usage and error information.
  709. //
  710. // Returned Error Types:
  711. // * NotFoundException
  712. // The request was rejected because the specified entity or resource could not
  713. // be found.
  714. //
  715. // * DisabledException
  716. // The request was rejected because the specified CMK is not enabled.
  717. //
  718. // * DependencyTimeoutException
  719. // The system timed out while trying to fulfill the request. The request can
  720. // be retried.
  721. //
  722. // * InvalidArnException
  723. // The request was rejected because a specified ARN, or an ARN in a key policy,
  724. // is not valid.
  725. //
  726. // * InternalException
  727. // The request was rejected because an internal exception occurred. The request
  728. // can be retried.
  729. //
  730. // * InvalidGrantTokenException
  731. // The request was rejected because the specified grant token is not valid.
  732. //
  733. // * LimitExceededException
  734. // The request was rejected because a limit was exceeded. For more information,
  735. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  736. // in the AWS Key Management Service Developer Guide.
  737. //
  738. // * InvalidStateException
  739. // The request was rejected because the state of the specified resource is not
  740. // valid for this request.
  741. //
  742. // For more information about how key state affects the use of a CMK, see How
  743. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  744. // in the AWS Key Management Service Developer Guide .
  745. //
  746. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant
  747. func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) {
  748. req, out := c.CreateGrantRequest(input)
  749. return out, req.Send()
  750. }
  751. // CreateGrantWithContext is the same as CreateGrant with the addition of
  752. // the ability to pass a context and additional request options.
  753. //
  754. // See CreateGrant for details on how to use this API operation.
  755. //
  756. // The context must be non-nil and will be used for request cancellation. If
  757. // the context is nil a panic will occur. In the future the SDK may create
  758. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  759. // for more information on using Contexts.
  760. func (c *KMS) CreateGrantWithContext(ctx aws.Context, input *CreateGrantInput, opts ...request.Option) (*CreateGrantOutput, error) {
  761. req, out := c.CreateGrantRequest(input)
  762. req.SetContext(ctx)
  763. req.ApplyOptions(opts...)
  764. return out, req.Send()
  765. }
  766. const opCreateKey = "CreateKey"
  767. // CreateKeyRequest generates a "aws/request.Request" representing the
  768. // client's request for the CreateKey operation. The "output" return
  769. // value will be populated with the request's response once the request completes
  770. // successfully.
  771. //
  772. // Use "Send" method on the returned Request to send the API call to the service.
  773. // the "output" return value is not valid until after Send returns without error.
  774. //
  775. // See CreateKey for more information on using the CreateKey
  776. // API call, and error handling.
  777. //
  778. // This method is useful when you want to inject custom logic or configuration
  779. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  780. //
  781. //
  782. // // Example sending a request using the CreateKeyRequest method.
  783. // req, resp := client.CreateKeyRequest(params)
  784. //
  785. // err := req.Send()
  786. // if err == nil { // resp is now filled
  787. // fmt.Println(resp)
  788. // }
  789. //
  790. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey
  791. func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, output *CreateKeyOutput) {
  792. op := &request.Operation{
  793. Name: opCreateKey,
  794. HTTPMethod: "POST",
  795. HTTPPath: "/",
  796. }
  797. if input == nil {
  798. input = &CreateKeyInput{}
  799. }
  800. output = &CreateKeyOutput{}
  801. req = c.newRequest(op, input, output)
  802. return
  803. }
  804. // CreateKey API operation for AWS Key Management Service.
  805. //
  806. // Creates a unique customer managed customer master key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master-keys)
  807. // (CMK) in your AWS account and Region. You cannot use this operation to create
  808. // a CMK in a different AWS account.
  809. //
  810. // You can use the CreateKey operation to create symmetric or asymmetric CMKs.
  811. //
  812. // * Symmetric CMKs contain a 256-bit symmetric key that never leaves AWS
  813. // KMS unencrypted. To use the CMK, you must call AWS KMS. You can use a
  814. // symmetric CMK to encrypt and decrypt small amounts of data, but they are
  815. // typically used to generate data keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys)
  816. // or data key pairs. For details, see GenerateDataKey and GenerateDataKeyPair.
  817. //
  818. // * Asymmetric CMKs can contain an RSA key pair or an Elliptic Curve (ECC)
  819. // key pair. The private key in an asymmetric CMK never leaves AWS KMS unencrypted.
  820. // However, you can use the GetPublicKey operation to download the public
  821. // key so it can be used outside of AWS KMS. CMKs with RSA key pairs can
  822. // be used to encrypt or decrypt data or sign and verify messages (but not
  823. // both). CMKs with ECC key pairs can be used only to sign and verify messages.
  824. //
  825. // For information about symmetric and asymmetric CMKs, see Using Symmetric
  826. // and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
  827. // in the AWS Key Management Service Developer Guide.
  828. //
  829. // To create different types of CMKs, use the following guidance:
  830. //
  831. // Asymmetric CMKs
  832. //
  833. // To create an asymmetric CMK, use the CustomerMasterKeySpec parameter to specify
  834. // the type of key material in the CMK. Then, use the KeyUsage parameter to
  835. // determine whether the CMK will be used to encrypt and decrypt or sign and
  836. // verify. You can't change these properties after the CMK is created.
  837. //
  838. // Symmetric CMKs
  839. //
  840. // When creating a symmetric CMK, you don't need to specify the CustomerMasterKeySpec
  841. // or KeyUsage parameters. The default value for CustomerMasterKeySpec, SYMMETRIC_DEFAULT,
  842. // and the default value for KeyUsage, ENCRYPT_DECRYPT, are the only valid values
  843. // for symmetric CMKs.
  844. //
  845. // Imported Key Material
  846. //
  847. // To import your own key material, begin by creating a symmetric CMK with no
  848. // key material. To do this, use the Origin parameter of CreateKey with a value
  849. // of EXTERNAL. Next, use GetParametersForImport operation to get a public key
  850. // and import token, and use the public key to encrypt your key material. Then,
  851. // use ImportKeyMaterial with your import token to import the key material.
  852. // For step-by-step instructions, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  853. // in the AWS Key Management Service Developer Guide . You cannot import the
  854. // key material into an asymmetric CMK.
  855. //
  856. // Custom Key Stores
  857. //
  858. // To create a symmetric CMK in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html),
  859. // use the CustomKeyStoreId parameter to specify the custom key store. You must
  860. // also use the Origin parameter with a value of AWS_CLOUDHSM. The AWS CloudHSM
  861. // cluster that is associated with the custom key store must have at least two
  862. // active HSMs in different Availability Zones in the AWS Region.
  863. //
  864. // You cannot create an asymmetric CMK in a custom key store. For information
  865. // about custom key stores in AWS KMS see Using Custom Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  866. // in the AWS Key Management Service Developer Guide .
  867. //
  868. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  869. // with awserr.Error's Code and Message methods to get detailed information about
  870. // the error.
  871. //
  872. // See the AWS API reference guide for AWS Key Management Service's
  873. // API operation CreateKey for usage and error information.
  874. //
  875. // Returned Error Types:
  876. // * MalformedPolicyDocumentException
  877. // The request was rejected because the specified policy is not syntactically
  878. // or semantically correct.
  879. //
  880. // * DependencyTimeoutException
  881. // The system timed out while trying to fulfill the request. The request can
  882. // be retried.
  883. //
  884. // * InvalidArnException
  885. // The request was rejected because a specified ARN, or an ARN in a key policy,
  886. // is not valid.
  887. //
  888. // * UnsupportedOperationException
  889. // The request was rejected because a specified parameter is not supported or
  890. // a specified resource is not valid for this operation.
  891. //
  892. // * InternalException
  893. // The request was rejected because an internal exception occurred. The request
  894. // can be retried.
  895. //
  896. // * LimitExceededException
  897. // The request was rejected because a limit was exceeded. For more information,
  898. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  899. // in the AWS Key Management Service Developer Guide.
  900. //
  901. // * TagException
  902. // The request was rejected because one or more tags are not valid.
  903. //
  904. // * CustomKeyStoreNotFoundException
  905. // The request was rejected because AWS KMS cannot find a custom key store with
  906. // the specified key store name or ID.
  907. //
  908. // * CustomKeyStoreInvalidStateException
  909. // The request was rejected because of the ConnectionState of the custom key
  910. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  911. // operation.
  912. //
  913. // This exception is thrown under the following conditions:
  914. //
  915. // * You requested the CreateKey or GenerateRandom operation in a custom
  916. // key store that is not connected. These operations are valid only when
  917. // the custom key store ConnectionState is CONNECTED.
  918. //
  919. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  920. // on a custom key store that is not disconnected. This operation is valid
  921. // only when the custom key store ConnectionState is DISCONNECTED.
  922. //
  923. // * You requested the ConnectCustomKeyStore operation on a custom key store
  924. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  925. // for all other ConnectionState values.
  926. //
  927. // * CloudHsmClusterInvalidConfigurationException
  928. // The request was rejected because the associated AWS CloudHSM cluster did
  929. // not meet the configuration requirements for a custom key store.
  930. //
  931. // * The cluster must be configured with private subnets in at least two
  932. // different Availability Zones in the Region.
  933. //
  934. // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  935. // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
  936. // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
  937. // rules and the Destination in the outbound rules must match the security
  938. // group ID. These rules are set by default when you create the cluster.
  939. // Do not delete or change them. To get information about a particular security
  940. // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
  941. // operation.
  942. //
  943. // * The cluster must contain at least as many HSMs as the operation requires.
  944. // To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  945. // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
  946. // operations, the AWS CloudHSM cluster must have at least two active HSMs,
  947. // each in a different Availability Zone. For the ConnectCustomKeyStore operation,
  948. // the AWS CloudHSM must contain at least one active HSM.
  949. //
  950. // For information about the requirements for an AWS CloudHSM cluster that is
  951. // associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  952. // in the AWS Key Management Service Developer Guide. For information about
  953. // creating a private subnet for an AWS CloudHSM cluster, see Create a Private
  954. // Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
  955. // in the AWS CloudHSM User Guide. For information about cluster security groups,
  956. // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  957. // in the AWS CloudHSM User Guide .
  958. //
  959. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateKey
  960. func (c *KMS) CreateKey(input *CreateKeyInput) (*CreateKeyOutput, error) {
  961. req, out := c.CreateKeyRequest(input)
  962. return out, req.Send()
  963. }
  964. // CreateKeyWithContext is the same as CreateKey with the addition of
  965. // the ability to pass a context and additional request options.
  966. //
  967. // See CreateKey for details on how to use this API operation.
  968. //
  969. // The context must be non-nil and will be used for request cancellation. If
  970. // the context is nil a panic will occur. In the future the SDK may create
  971. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  972. // for more information on using Contexts.
  973. func (c *KMS) CreateKeyWithContext(ctx aws.Context, input *CreateKeyInput, opts ...request.Option) (*CreateKeyOutput, error) {
  974. req, out := c.CreateKeyRequest(input)
  975. req.SetContext(ctx)
  976. req.ApplyOptions(opts...)
  977. return out, req.Send()
  978. }
  979. const opDecrypt = "Decrypt"
  980. // DecryptRequest generates a "aws/request.Request" representing the
  981. // client's request for the Decrypt operation. The "output" return
  982. // value will be populated with the request's response once the request completes
  983. // successfully.
  984. //
  985. // Use "Send" method on the returned Request to send the API call to the service.
  986. // the "output" return value is not valid until after Send returns without error.
  987. //
  988. // See Decrypt for more information on using the Decrypt
  989. // API call, and error handling.
  990. //
  991. // This method is useful when you want to inject custom logic or configuration
  992. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  993. //
  994. //
  995. // // Example sending a request using the DecryptRequest method.
  996. // req, resp := client.DecryptRequest(params)
  997. //
  998. // err := req.Send()
  999. // if err == nil { // resp is now filled
  1000. // fmt.Println(resp)
  1001. // }
  1002. //
  1003. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt
  1004. func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output *DecryptOutput) {
  1005. op := &request.Operation{
  1006. Name: opDecrypt,
  1007. HTTPMethod: "POST",
  1008. HTTPPath: "/",
  1009. }
  1010. if input == nil {
  1011. input = &DecryptInput{}
  1012. }
  1013. output = &DecryptOutput{}
  1014. req = c.newRequest(op, input, output)
  1015. return
  1016. }
  1017. // Decrypt API operation for AWS Key Management Service.
  1018. //
  1019. // Decrypts ciphertext that was encrypted by a AWS KMS customer master key (CMK)
  1020. // using any of the following operations:
  1021. //
  1022. // * Encrypt
  1023. //
  1024. // * GenerateDataKey
  1025. //
  1026. // * GenerateDataKeyPair
  1027. //
  1028. // * GenerateDataKeyWithoutPlaintext
  1029. //
  1030. // * GenerateDataKeyPairWithoutPlaintext
  1031. //
  1032. // You can use this operation to decrypt ciphertext that was encrypted under
  1033. // a symmetric or asymmetric CMK. When the CMK is asymmetric, you must specify
  1034. // the CMK and the encryption algorithm that was used to encrypt the ciphertext.
  1035. // For information about symmetric and asymmetric CMKs, see Using Symmetric
  1036. // and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
  1037. // in the AWS Key Management Service Developer Guide.
  1038. //
  1039. // The Decrypt operation also decrypts ciphertext that was encrypted outside
  1040. // of AWS KMS by the public key in an AWS KMS asymmetric CMK. However, it cannot
  1041. // decrypt ciphertext produced by other libraries, such as the AWS Encryption
  1042. // SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/)
  1043. // or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html).
  1044. // These libraries return a ciphertext format that is incompatible with AWS
  1045. // KMS.
  1046. //
  1047. // If the ciphertext was encrypted under a symmetric CMK, you do not need to
  1048. // specify the CMK or the encryption algorithm. AWS KMS can get this information
  1049. // from metadata that it adds to the symmetric ciphertext blob. However, if
  1050. // you prefer, you can specify the KeyId to ensure that a particular CMK is
  1051. // used to decrypt the ciphertext. If you specify a different CMK than the one
  1052. // used to encrypt the ciphertext, the Decrypt operation fails.
  1053. //
  1054. // Whenever possible, use key policies to give users permission to call the
  1055. // Decrypt operation on a particular CMK, instead of using IAM policies. Otherwise,
  1056. // you might create an IAM user policy that gives the user Decrypt permission
  1057. // on all CMKs. This user could decrypt ciphertext that was encrypted by CMKs
  1058. // in other accounts if the key policy for the cross-account CMK permits it.
  1059. // If you must use an IAM policy for Decrypt permissions, limit the user to
  1060. // particular CMKs or particular trusted accounts.
  1061. //
  1062. // The CMK that you use for this operation must be in a compatible key state.
  1063. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1064. // in the AWS Key Management Service Developer Guide.
  1065. //
  1066. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1067. // with awserr.Error's Code and Message methods to get detailed information about
  1068. // the error.
  1069. //
  1070. // See the AWS API reference guide for AWS Key Management Service's
  1071. // API operation Decrypt for usage and error information.
  1072. //
  1073. // Returned Error Types:
  1074. // * NotFoundException
  1075. // The request was rejected because the specified entity or resource could not
  1076. // be found.
  1077. //
  1078. // * DisabledException
  1079. // The request was rejected because the specified CMK is not enabled.
  1080. //
  1081. // * InvalidCiphertextException
  1082. // From the Decrypt or ReEncrypt operation, the request was rejected because
  1083. // the specified ciphertext, or additional authenticated data incorporated into
  1084. // the ciphertext, such as the encryption context, is corrupted, missing, or
  1085. // otherwise invalid.
  1086. //
  1087. // From the ImportKeyMaterial operation, the request was rejected because AWS
  1088. // KMS could not decrypt the encrypted (wrapped) key material.
  1089. //
  1090. // * KeyUnavailableException
  1091. // The request was rejected because the specified CMK was not available. You
  1092. // can retry the request.
  1093. //
  1094. // * IncorrectKeyException
  1095. // The request was rejected because the specified CMK cannot decrypt the data.
  1096. // The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request
  1097. // must identify the same CMK that was used to encrypt the ciphertext.
  1098. //
  1099. // * InvalidKeyUsageException
  1100. // The request was rejected for one of the following reasons:
  1101. //
  1102. // * The KeyUsage value of the CMK is incompatible with the API operation.
  1103. //
  1104. // * The encryption algorithm or signing algorithm specified for the operation
  1105. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  1106. //
  1107. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  1108. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  1109. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  1110. //
  1111. // To find the encryption or signing algorithms supported for a particular CMK,
  1112. // use the DescribeKey operation.
  1113. //
  1114. // * DependencyTimeoutException
  1115. // The system timed out while trying to fulfill the request. The request can
  1116. // be retried.
  1117. //
  1118. // * InvalidGrantTokenException
  1119. // The request was rejected because the specified grant token is not valid.
  1120. //
  1121. // * InternalException
  1122. // The request was rejected because an internal exception occurred. The request
  1123. // can be retried.
  1124. //
  1125. // * InvalidStateException
  1126. // The request was rejected because the state of the specified resource is not
  1127. // valid for this request.
  1128. //
  1129. // For more information about how key state affects the use of a CMK, see How
  1130. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1131. // in the AWS Key Management Service Developer Guide .
  1132. //
  1133. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt
  1134. func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) {
  1135. req, out := c.DecryptRequest(input)
  1136. return out, req.Send()
  1137. }
  1138. // DecryptWithContext is the same as Decrypt with the addition of
  1139. // the ability to pass a context and additional request options.
  1140. //
  1141. // See Decrypt for details on how to use this API operation.
  1142. //
  1143. // The context must be non-nil and will be used for request cancellation. If
  1144. // the context is nil a panic will occur. In the future the SDK may create
  1145. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1146. // for more information on using Contexts.
  1147. func (c *KMS) DecryptWithContext(ctx aws.Context, input *DecryptInput, opts ...request.Option) (*DecryptOutput, error) {
  1148. req, out := c.DecryptRequest(input)
  1149. req.SetContext(ctx)
  1150. req.ApplyOptions(opts...)
  1151. return out, req.Send()
  1152. }
  1153. const opDeleteAlias = "DeleteAlias"
  1154. // DeleteAliasRequest generates a "aws/request.Request" representing the
  1155. // client's request for the DeleteAlias operation. The "output" return
  1156. // value will be populated with the request's response once the request completes
  1157. // successfully.
  1158. //
  1159. // Use "Send" method on the returned Request to send the API call to the service.
  1160. // the "output" return value is not valid until after Send returns without error.
  1161. //
  1162. // See DeleteAlias for more information on using the DeleteAlias
  1163. // API call, and error handling.
  1164. //
  1165. // This method is useful when you want to inject custom logic or configuration
  1166. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1167. //
  1168. //
  1169. // // Example sending a request using the DeleteAliasRequest method.
  1170. // req, resp := client.DeleteAliasRequest(params)
  1171. //
  1172. // err := req.Send()
  1173. // if err == nil { // resp is now filled
  1174. // fmt.Println(resp)
  1175. // }
  1176. //
  1177. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias
  1178. func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, output *DeleteAliasOutput) {
  1179. op := &request.Operation{
  1180. Name: opDeleteAlias,
  1181. HTTPMethod: "POST",
  1182. HTTPPath: "/",
  1183. }
  1184. if input == nil {
  1185. input = &DeleteAliasInput{}
  1186. }
  1187. output = &DeleteAliasOutput{}
  1188. req = c.newRequest(op, input, output)
  1189. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1190. return
  1191. }
  1192. // DeleteAlias API operation for AWS Key Management Service.
  1193. //
  1194. // Deletes the specified alias. You cannot perform this operation on an alias
  1195. // in a different AWS account.
  1196. //
  1197. // Because an alias is not a property of a CMK, you can delete and change the
  1198. // aliases of a CMK without affecting the CMK. Also, aliases do not appear in
  1199. // the response from the DescribeKey operation. To get the aliases of all CMKs,
  1200. // use the ListAliases operation.
  1201. //
  1202. // Each CMK can have multiple aliases. To change the alias of a CMK, use DeleteAlias
  1203. // to delete the current alias and CreateAlias to create a new alias. To associate
  1204. // an existing alias with a different customer master key (CMK), call UpdateAlias.
  1205. //
  1206. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1207. // with awserr.Error's Code and Message methods to get detailed information about
  1208. // the error.
  1209. //
  1210. // See the AWS API reference guide for AWS Key Management Service's
  1211. // API operation DeleteAlias for usage and error information.
  1212. //
  1213. // Returned Error Types:
  1214. // * DependencyTimeoutException
  1215. // The system timed out while trying to fulfill the request. The request can
  1216. // be retried.
  1217. //
  1218. // * NotFoundException
  1219. // The request was rejected because the specified entity or resource could not
  1220. // be found.
  1221. //
  1222. // * InternalException
  1223. // The request was rejected because an internal exception occurred. The request
  1224. // can be retried.
  1225. //
  1226. // * InvalidStateException
  1227. // The request was rejected because the state of the specified resource is not
  1228. // valid for this request.
  1229. //
  1230. // For more information about how key state affects the use of a CMK, see How
  1231. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1232. // in the AWS Key Management Service Developer Guide .
  1233. //
  1234. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias
  1235. func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) {
  1236. req, out := c.DeleteAliasRequest(input)
  1237. return out, req.Send()
  1238. }
  1239. // DeleteAliasWithContext is the same as DeleteAlias with the addition of
  1240. // the ability to pass a context and additional request options.
  1241. //
  1242. // See DeleteAlias for details on how to use this API operation.
  1243. //
  1244. // The context must be non-nil and will be used for request cancellation. If
  1245. // the context is nil a panic will occur. In the future the SDK may create
  1246. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1247. // for more information on using Contexts.
  1248. func (c *KMS) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) {
  1249. req, out := c.DeleteAliasRequest(input)
  1250. req.SetContext(ctx)
  1251. req.ApplyOptions(opts...)
  1252. return out, req.Send()
  1253. }
  1254. const opDeleteCustomKeyStore = "DeleteCustomKeyStore"
  1255. // DeleteCustomKeyStoreRequest generates a "aws/request.Request" representing the
  1256. // client's request for the DeleteCustomKeyStore operation. The "output" return
  1257. // value will be populated with the request's response once the request completes
  1258. // successfully.
  1259. //
  1260. // Use "Send" method on the returned Request to send the API call to the service.
  1261. // the "output" return value is not valid until after Send returns without error.
  1262. //
  1263. // See DeleteCustomKeyStore for more information on using the DeleteCustomKeyStore
  1264. // API call, and error handling.
  1265. //
  1266. // This method is useful when you want to inject custom logic or configuration
  1267. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1268. //
  1269. //
  1270. // // Example sending a request using the DeleteCustomKeyStoreRequest method.
  1271. // req, resp := client.DeleteCustomKeyStoreRequest(params)
  1272. //
  1273. // err := req.Send()
  1274. // if err == nil { // resp is now filled
  1275. // fmt.Println(resp)
  1276. // }
  1277. //
  1278. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteCustomKeyStore
  1279. func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req *request.Request, output *DeleteCustomKeyStoreOutput) {
  1280. op := &request.Operation{
  1281. Name: opDeleteCustomKeyStore,
  1282. HTTPMethod: "POST",
  1283. HTTPPath: "/",
  1284. }
  1285. if input == nil {
  1286. input = &DeleteCustomKeyStoreInput{}
  1287. }
  1288. output = &DeleteCustomKeyStoreOutput{}
  1289. req = c.newRequest(op, input, output)
  1290. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1291. return
  1292. }
  1293. // DeleteCustomKeyStore API operation for AWS Key Management Service.
  1294. //
  1295. // Deletes a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  1296. // This operation does not delete the AWS CloudHSM cluster that is associated
  1297. // with the custom key store, or affect any users or keys in the cluster.
  1298. //
  1299. // The custom key store that you delete cannot contain any AWS KMS customer
  1300. // master keys (CMKs) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys).
  1301. // Before deleting the key store, verify that you will never need to use any
  1302. // of the CMKs in the key store for any cryptographic operations. Then, use
  1303. // ScheduleKeyDeletion to delete the AWS KMS customer master keys (CMKs) from
  1304. // the key store. When the scheduled waiting period expires, the ScheduleKeyDeletion
  1305. // operation deletes the CMKs. Then it makes a best effort to delete the key
  1306. // material from the associated cluster. However, you might need to manually
  1307. // delete the orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key)
  1308. // from the cluster and its backups.
  1309. //
  1310. // After all CMKs are deleted from AWS KMS, use DisconnectCustomKeyStore to
  1311. // disconnect the key store from AWS KMS. Then, you can delete the custom key
  1312. // store.
  1313. //
  1314. // Instead of deleting the custom key store, consider using DisconnectCustomKeyStore
  1315. // to disconnect it from AWS KMS. While the key store is disconnected, you cannot
  1316. // create or use the CMKs in the key store. But, you do not need to delete CMKs
  1317. // and you can reconnect a disconnected custom key store at any time.
  1318. //
  1319. // If the operation succeeds, it returns a JSON object with no properties.
  1320. //
  1321. // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  1322. // feature in AWS KMS, which combines the convenience and extensive integration
  1323. // of AWS KMS with the isolation and control of a single-tenant key store.
  1324. //
  1325. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1326. // with awserr.Error's Code and Message methods to get detailed information about
  1327. // the error.
  1328. //
  1329. // See the AWS API reference guide for AWS Key Management Service's
  1330. // API operation DeleteCustomKeyStore for usage and error information.
  1331. //
  1332. // Returned Error Types:
  1333. // * CustomKeyStoreHasCMKsException
  1334. // The request was rejected because the custom key store contains AWS KMS customer
  1335. // master keys (CMKs). After verifying that you do not need to use the CMKs,
  1336. // use the ScheduleKeyDeletion operation to delete the CMKs. After they are
  1337. // deleted, you can delete the custom key store.
  1338. //
  1339. // * CustomKeyStoreInvalidStateException
  1340. // The request was rejected because of the ConnectionState of the custom key
  1341. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  1342. // operation.
  1343. //
  1344. // This exception is thrown under the following conditions:
  1345. //
  1346. // * You requested the CreateKey or GenerateRandom operation in a custom
  1347. // key store that is not connected. These operations are valid only when
  1348. // the custom key store ConnectionState is CONNECTED.
  1349. //
  1350. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  1351. // on a custom key store that is not disconnected. This operation is valid
  1352. // only when the custom key store ConnectionState is DISCONNECTED.
  1353. //
  1354. // * You requested the ConnectCustomKeyStore operation on a custom key store
  1355. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  1356. // for all other ConnectionState values.
  1357. //
  1358. // * CustomKeyStoreNotFoundException
  1359. // The request was rejected because AWS KMS cannot find a custom key store with
  1360. // the specified key store name or ID.
  1361. //
  1362. // * InternalException
  1363. // The request was rejected because an internal exception occurred. The request
  1364. // can be retried.
  1365. //
  1366. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteCustomKeyStore
  1367. func (c *KMS) DeleteCustomKeyStore(input *DeleteCustomKeyStoreInput) (*DeleteCustomKeyStoreOutput, error) {
  1368. req, out := c.DeleteCustomKeyStoreRequest(input)
  1369. return out, req.Send()
  1370. }
  1371. // DeleteCustomKeyStoreWithContext is the same as DeleteCustomKeyStore with the addition of
  1372. // the ability to pass a context and additional request options.
  1373. //
  1374. // See DeleteCustomKeyStore for details on how to use this API operation.
  1375. //
  1376. // The context must be non-nil and will be used for request cancellation. If
  1377. // the context is nil a panic will occur. In the future the SDK may create
  1378. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1379. // for more information on using Contexts.
  1380. func (c *KMS) DeleteCustomKeyStoreWithContext(ctx aws.Context, input *DeleteCustomKeyStoreInput, opts ...request.Option) (*DeleteCustomKeyStoreOutput, error) {
  1381. req, out := c.DeleteCustomKeyStoreRequest(input)
  1382. req.SetContext(ctx)
  1383. req.ApplyOptions(opts...)
  1384. return out, req.Send()
  1385. }
  1386. const opDeleteImportedKeyMaterial = "DeleteImportedKeyMaterial"
  1387. // DeleteImportedKeyMaterialRequest generates a "aws/request.Request" representing the
  1388. // client's request for the DeleteImportedKeyMaterial operation. The "output" return
  1389. // value will be populated with the request's response once the request completes
  1390. // successfully.
  1391. //
  1392. // Use "Send" method on the returned Request to send the API call to the service.
  1393. // the "output" return value is not valid until after Send returns without error.
  1394. //
  1395. // See DeleteImportedKeyMaterial for more information on using the DeleteImportedKeyMaterial
  1396. // API call, and error handling.
  1397. //
  1398. // This method is useful when you want to inject custom logic or configuration
  1399. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1400. //
  1401. //
  1402. // // Example sending a request using the DeleteImportedKeyMaterialRequest method.
  1403. // req, resp := client.DeleteImportedKeyMaterialRequest(params)
  1404. //
  1405. // err := req.Send()
  1406. // if err == nil { // resp is now filled
  1407. // fmt.Println(resp)
  1408. // }
  1409. //
  1410. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial
  1411. func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialInput) (req *request.Request, output *DeleteImportedKeyMaterialOutput) {
  1412. op := &request.Operation{
  1413. Name: opDeleteImportedKeyMaterial,
  1414. HTTPMethod: "POST",
  1415. HTTPPath: "/",
  1416. }
  1417. if input == nil {
  1418. input = &DeleteImportedKeyMaterialInput{}
  1419. }
  1420. output = &DeleteImportedKeyMaterialOutput{}
  1421. req = c.newRequest(op, input, output)
  1422. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1423. return
  1424. }
  1425. // DeleteImportedKeyMaterial API operation for AWS Key Management Service.
  1426. //
  1427. // Deletes key material that you previously imported. This operation makes the
  1428. // specified customer master key (CMK) unusable. For more information about
  1429. // importing key material into AWS KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  1430. // in the AWS Key Management Service Developer Guide. You cannot perform this
  1431. // operation on a CMK in a different AWS account.
  1432. //
  1433. // When the specified CMK is in the PendingDeletion state, this operation does
  1434. // not change the CMK's state. Otherwise, it changes the CMK's state to PendingImport.
  1435. //
  1436. // After you delete key material, you can use ImportKeyMaterial to reimport
  1437. // the same key material into the CMK.
  1438. //
  1439. // The CMK that you use for this operation must be in a compatible key state.
  1440. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1441. // in the AWS Key Management Service Developer Guide.
  1442. //
  1443. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1444. // with awserr.Error's Code and Message methods to get detailed information about
  1445. // the error.
  1446. //
  1447. // See the AWS API reference guide for AWS Key Management Service's
  1448. // API operation DeleteImportedKeyMaterial for usage and error information.
  1449. //
  1450. // Returned Error Types:
  1451. // * InvalidArnException
  1452. // The request was rejected because a specified ARN, or an ARN in a key policy,
  1453. // is not valid.
  1454. //
  1455. // * UnsupportedOperationException
  1456. // The request was rejected because a specified parameter is not supported or
  1457. // a specified resource is not valid for this operation.
  1458. //
  1459. // * DependencyTimeoutException
  1460. // The system timed out while trying to fulfill the request. The request can
  1461. // be retried.
  1462. //
  1463. // * NotFoundException
  1464. // The request was rejected because the specified entity or resource could not
  1465. // be found.
  1466. //
  1467. // * InternalException
  1468. // The request was rejected because an internal exception occurred. The request
  1469. // can be retried.
  1470. //
  1471. // * InvalidStateException
  1472. // The request was rejected because the state of the specified resource is not
  1473. // valid for this request.
  1474. //
  1475. // For more information about how key state affects the use of a CMK, see How
  1476. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1477. // in the AWS Key Management Service Developer Guide .
  1478. //
  1479. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial
  1480. func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) {
  1481. req, out := c.DeleteImportedKeyMaterialRequest(input)
  1482. return out, req.Send()
  1483. }
  1484. // DeleteImportedKeyMaterialWithContext is the same as DeleteImportedKeyMaterial with the addition of
  1485. // the ability to pass a context and additional request options.
  1486. //
  1487. // See DeleteImportedKeyMaterial for details on how to use this API operation.
  1488. //
  1489. // The context must be non-nil and will be used for request cancellation. If
  1490. // the context is nil a panic will occur. In the future the SDK may create
  1491. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1492. // for more information on using Contexts.
  1493. func (c *KMS) DeleteImportedKeyMaterialWithContext(ctx aws.Context, input *DeleteImportedKeyMaterialInput, opts ...request.Option) (*DeleteImportedKeyMaterialOutput, error) {
  1494. req, out := c.DeleteImportedKeyMaterialRequest(input)
  1495. req.SetContext(ctx)
  1496. req.ApplyOptions(opts...)
  1497. return out, req.Send()
  1498. }
  1499. const opDescribeCustomKeyStores = "DescribeCustomKeyStores"
  1500. // DescribeCustomKeyStoresRequest generates a "aws/request.Request" representing the
  1501. // client's request for the DescribeCustomKeyStores operation. The "output" return
  1502. // value will be populated with the request's response once the request completes
  1503. // successfully.
  1504. //
  1505. // Use "Send" method on the returned Request to send the API call to the service.
  1506. // the "output" return value is not valid until after Send returns without error.
  1507. //
  1508. // See DescribeCustomKeyStores for more information on using the DescribeCustomKeyStores
  1509. // API call, and error handling.
  1510. //
  1511. // This method is useful when you want to inject custom logic or configuration
  1512. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1513. //
  1514. //
  1515. // // Example sending a request using the DescribeCustomKeyStoresRequest method.
  1516. // req, resp := client.DescribeCustomKeyStoresRequest(params)
  1517. //
  1518. // err := req.Send()
  1519. // if err == nil { // resp is now filled
  1520. // fmt.Println(resp)
  1521. // }
  1522. //
  1523. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeCustomKeyStores
  1524. func (c *KMS) DescribeCustomKeyStoresRequest(input *DescribeCustomKeyStoresInput) (req *request.Request, output *DescribeCustomKeyStoresOutput) {
  1525. op := &request.Operation{
  1526. Name: opDescribeCustomKeyStores,
  1527. HTTPMethod: "POST",
  1528. HTTPPath: "/",
  1529. }
  1530. if input == nil {
  1531. input = &DescribeCustomKeyStoresInput{}
  1532. }
  1533. output = &DescribeCustomKeyStoresOutput{}
  1534. req = c.newRequest(op, input, output)
  1535. return
  1536. }
  1537. // DescribeCustomKeyStores API operation for AWS Key Management Service.
  1538. //
  1539. // Gets information about custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  1540. // in the account and region.
  1541. //
  1542. // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  1543. // feature in AWS KMS, which combines the convenience and extensive integration
  1544. // of AWS KMS with the isolation and control of a single-tenant key store.
  1545. //
  1546. // By default, this operation returns information about all custom key stores
  1547. // in the account and region. To get only information about a particular custom
  1548. // key store, use either the CustomKeyStoreName or CustomKeyStoreId parameter
  1549. // (but not both).
  1550. //
  1551. // To determine whether the custom key store is connected to its AWS CloudHSM
  1552. // cluster, use the ConnectionState element in the response. If an attempt to
  1553. // connect the custom key store failed, the ConnectionState value is FAILED
  1554. // and the ConnectionErrorCode element in the response indicates the cause of
  1555. // the failure. For help interpreting the ConnectionErrorCode, see CustomKeyStoresListEntry.
  1556. //
  1557. // Custom key stores have a DISCONNECTED connection state if the key store has
  1558. // never been connected or you use the DisconnectCustomKeyStore operation to
  1559. // disconnect it. If your custom key store state is CONNECTED but you are having
  1560. // trouble using it, make sure that its associated AWS CloudHSM cluster is active
  1561. // and contains the minimum number of HSMs required for the operation, if any.
  1562. //
  1563. // For help repairing your custom key store, see the Troubleshooting Custom
  1564. // Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html)
  1565. // topic in the AWS Key Management Service Developer Guide.
  1566. //
  1567. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1568. // with awserr.Error's Code and Message methods to get detailed information about
  1569. // the error.
  1570. //
  1571. // See the AWS API reference guide for AWS Key Management Service's
  1572. // API operation DescribeCustomKeyStores for usage and error information.
  1573. //
  1574. // Returned Error Types:
  1575. // * CustomKeyStoreNotFoundException
  1576. // The request was rejected because AWS KMS cannot find a custom key store with
  1577. // the specified key store name or ID.
  1578. //
  1579. // * InternalException
  1580. // The request was rejected because an internal exception occurred. The request
  1581. // can be retried.
  1582. //
  1583. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeCustomKeyStores
  1584. func (c *KMS) DescribeCustomKeyStores(input *DescribeCustomKeyStoresInput) (*DescribeCustomKeyStoresOutput, error) {
  1585. req, out := c.DescribeCustomKeyStoresRequest(input)
  1586. return out, req.Send()
  1587. }
  1588. // DescribeCustomKeyStoresWithContext is the same as DescribeCustomKeyStores with the addition of
  1589. // the ability to pass a context and additional request options.
  1590. //
  1591. // See DescribeCustomKeyStores for details on how to use this API operation.
  1592. //
  1593. // The context must be non-nil and will be used for request cancellation. If
  1594. // the context is nil a panic will occur. In the future the SDK may create
  1595. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1596. // for more information on using Contexts.
  1597. func (c *KMS) DescribeCustomKeyStoresWithContext(ctx aws.Context, input *DescribeCustomKeyStoresInput, opts ...request.Option) (*DescribeCustomKeyStoresOutput, error) {
  1598. req, out := c.DescribeCustomKeyStoresRequest(input)
  1599. req.SetContext(ctx)
  1600. req.ApplyOptions(opts...)
  1601. return out, req.Send()
  1602. }
  1603. const opDescribeKey = "DescribeKey"
  1604. // DescribeKeyRequest generates a "aws/request.Request" representing the
  1605. // client's request for the DescribeKey operation. The "output" return
  1606. // value will be populated with the request's response once the request completes
  1607. // successfully.
  1608. //
  1609. // Use "Send" method on the returned Request to send the API call to the service.
  1610. // the "output" return value is not valid until after Send returns without error.
  1611. //
  1612. // See DescribeKey for more information on using the DescribeKey
  1613. // API call, and error handling.
  1614. //
  1615. // This method is useful when you want to inject custom logic or configuration
  1616. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1617. //
  1618. //
  1619. // // Example sending a request using the DescribeKeyRequest method.
  1620. // req, resp := client.DescribeKeyRequest(params)
  1621. //
  1622. // err := req.Send()
  1623. // if err == nil { // resp is now filled
  1624. // fmt.Println(resp)
  1625. // }
  1626. //
  1627. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey
  1628. func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, output *DescribeKeyOutput) {
  1629. op := &request.Operation{
  1630. Name: opDescribeKey,
  1631. HTTPMethod: "POST",
  1632. HTTPPath: "/",
  1633. }
  1634. if input == nil {
  1635. input = &DescribeKeyInput{}
  1636. }
  1637. output = &DescribeKeyOutput{}
  1638. req = c.newRequest(op, input, output)
  1639. return
  1640. }
  1641. // DescribeKey API operation for AWS Key Management Service.
  1642. //
  1643. // Provides detailed information about a customer master key (CMK). You can
  1644. // run DescribeKey on a customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk)
  1645. // or an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk).
  1646. //
  1647. // This detailed information includes the key ARN, creation date (and deletion
  1648. // date, if applicable), the key state, and the origin and expiration date (if
  1649. // any) of the key material. For CMKs in custom key stores, it includes information
  1650. // about the custom key store, such as the key store ID and the AWS CloudHSM
  1651. // cluster ID. It includes fields, like KeySpec, that help you distinguish symmetric
  1652. // from asymmetric CMKs. It also provides information that is particularly important
  1653. // to asymmetric CMKs, such as the key usage (encryption or signing) and the
  1654. // encryption algorithms or signing algorithms that the CMK supports.
  1655. //
  1656. // DescribeKey does not return the following information:
  1657. //
  1658. // * Aliases associated with the CMK. To get this information, use ListAliases.
  1659. //
  1660. // * Whether automatic key rotation is enabled on the CMK. To get this information,
  1661. // use GetKeyRotationStatus. Also, some key states prevent a CMK from being
  1662. // automatically rotated. For details, see How Automatic Key Rotation Works
  1663. // (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-how-it-works)
  1664. // in AWS Key Management Service Developer Guide.
  1665. //
  1666. // * Tags on the CMK. To get this information, use ListResourceTags.
  1667. //
  1668. // * Key policies and grants on the CMK. To get this information, use GetKeyPolicy
  1669. // and ListGrants.
  1670. //
  1671. // If you call the DescribeKey operation on a predefined AWS alias, that is,
  1672. // an AWS alias with no key ID, AWS KMS creates an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys).
  1673. // Then, it associates the alias with the new CMK, and returns the KeyId and
  1674. // Arn of the new CMK in the response.
  1675. //
  1676. // To perform this operation on a CMK in a different AWS account, specify the
  1677. // key ARN or alias ARN in the value of the KeyId parameter.
  1678. //
  1679. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1680. // with awserr.Error's Code and Message methods to get detailed information about
  1681. // the error.
  1682. //
  1683. // See the AWS API reference guide for AWS Key Management Service's
  1684. // API operation DescribeKey for usage and error information.
  1685. //
  1686. // Returned Error Types:
  1687. // * NotFoundException
  1688. // The request was rejected because the specified entity or resource could not
  1689. // be found.
  1690. //
  1691. // * InvalidArnException
  1692. // The request was rejected because a specified ARN, or an ARN in a key policy,
  1693. // is not valid.
  1694. //
  1695. // * DependencyTimeoutException
  1696. // The system timed out while trying to fulfill the request. The request can
  1697. // be retried.
  1698. //
  1699. // * InternalException
  1700. // The request was rejected because an internal exception occurred. The request
  1701. // can be retried.
  1702. //
  1703. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DescribeKey
  1704. func (c *KMS) DescribeKey(input *DescribeKeyInput) (*DescribeKeyOutput, error) {
  1705. req, out := c.DescribeKeyRequest(input)
  1706. return out, req.Send()
  1707. }
  1708. // DescribeKeyWithContext is the same as DescribeKey with the addition of
  1709. // the ability to pass a context and additional request options.
  1710. //
  1711. // See DescribeKey for details on how to use this API operation.
  1712. //
  1713. // The context must be non-nil and will be used for request cancellation. If
  1714. // the context is nil a panic will occur. In the future the SDK may create
  1715. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1716. // for more information on using Contexts.
  1717. func (c *KMS) DescribeKeyWithContext(ctx aws.Context, input *DescribeKeyInput, opts ...request.Option) (*DescribeKeyOutput, error) {
  1718. req, out := c.DescribeKeyRequest(input)
  1719. req.SetContext(ctx)
  1720. req.ApplyOptions(opts...)
  1721. return out, req.Send()
  1722. }
  1723. const opDisableKey = "DisableKey"
  1724. // DisableKeyRequest generates a "aws/request.Request" representing the
  1725. // client's request for the DisableKey operation. The "output" return
  1726. // value will be populated with the request's response once the request completes
  1727. // successfully.
  1728. //
  1729. // Use "Send" method on the returned Request to send the API call to the service.
  1730. // the "output" return value is not valid until after Send returns without error.
  1731. //
  1732. // See DisableKey for more information on using the DisableKey
  1733. // API call, and error handling.
  1734. //
  1735. // This method is useful when you want to inject custom logic or configuration
  1736. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1737. //
  1738. //
  1739. // // Example sending a request using the DisableKeyRequest method.
  1740. // req, resp := client.DisableKeyRequest(params)
  1741. //
  1742. // err := req.Send()
  1743. // if err == nil { // resp is now filled
  1744. // fmt.Println(resp)
  1745. // }
  1746. //
  1747. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey
  1748. func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, output *DisableKeyOutput) {
  1749. op := &request.Operation{
  1750. Name: opDisableKey,
  1751. HTTPMethod: "POST",
  1752. HTTPPath: "/",
  1753. }
  1754. if input == nil {
  1755. input = &DisableKeyInput{}
  1756. }
  1757. output = &DisableKeyOutput{}
  1758. req = c.newRequest(op, input, output)
  1759. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1760. return
  1761. }
  1762. // DisableKey API operation for AWS Key Management Service.
  1763. //
  1764. // Sets the state of a customer master key (CMK) to disabled, thereby preventing
  1765. // its use for cryptographic operations. You cannot perform this operation on
  1766. // a CMK in a different AWS account.
  1767. //
  1768. // For more information about how key state affects the use of a CMK, see How
  1769. // Key State Affects the Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1770. // in the AWS Key Management Service Developer Guide .
  1771. //
  1772. // The CMK that you use for this operation must be in a compatible key state.
  1773. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1774. // in the AWS Key Management Service Developer Guide.
  1775. //
  1776. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1777. // with awserr.Error's Code and Message methods to get detailed information about
  1778. // the error.
  1779. //
  1780. // See the AWS API reference guide for AWS Key Management Service's
  1781. // API operation DisableKey for usage and error information.
  1782. //
  1783. // Returned Error Types:
  1784. // * NotFoundException
  1785. // The request was rejected because the specified entity or resource could not
  1786. // be found.
  1787. //
  1788. // * InvalidArnException
  1789. // The request was rejected because a specified ARN, or an ARN in a key policy,
  1790. // is not valid.
  1791. //
  1792. // * DependencyTimeoutException
  1793. // The system timed out while trying to fulfill the request. The request can
  1794. // be retried.
  1795. //
  1796. // * InternalException
  1797. // The request was rejected because an internal exception occurred. The request
  1798. // can be retried.
  1799. //
  1800. // * InvalidStateException
  1801. // The request was rejected because the state of the specified resource is not
  1802. // valid for this request.
  1803. //
  1804. // For more information about how key state affects the use of a CMK, see How
  1805. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1806. // in the AWS Key Management Service Developer Guide .
  1807. //
  1808. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey
  1809. func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) {
  1810. req, out := c.DisableKeyRequest(input)
  1811. return out, req.Send()
  1812. }
  1813. // DisableKeyWithContext is the same as DisableKey with the addition of
  1814. // the ability to pass a context and additional request options.
  1815. //
  1816. // See DisableKey for details on how to use this API operation.
  1817. //
  1818. // The context must be non-nil and will be used for request cancellation. If
  1819. // the context is nil a panic will occur. In the future the SDK may create
  1820. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1821. // for more information on using Contexts.
  1822. func (c *KMS) DisableKeyWithContext(ctx aws.Context, input *DisableKeyInput, opts ...request.Option) (*DisableKeyOutput, error) {
  1823. req, out := c.DisableKeyRequest(input)
  1824. req.SetContext(ctx)
  1825. req.ApplyOptions(opts...)
  1826. return out, req.Send()
  1827. }
  1828. const opDisableKeyRotation = "DisableKeyRotation"
  1829. // DisableKeyRotationRequest generates a "aws/request.Request" representing the
  1830. // client's request for the DisableKeyRotation operation. The "output" return
  1831. // value will be populated with the request's response once the request completes
  1832. // successfully.
  1833. //
  1834. // Use "Send" method on the returned Request to send the API call to the service.
  1835. // the "output" return value is not valid until after Send returns without error.
  1836. //
  1837. // See DisableKeyRotation for more information on using the DisableKeyRotation
  1838. // API call, and error handling.
  1839. //
  1840. // This method is useful when you want to inject custom logic or configuration
  1841. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1842. //
  1843. //
  1844. // // Example sending a request using the DisableKeyRotationRequest method.
  1845. // req, resp := client.DisableKeyRotationRequest(params)
  1846. //
  1847. // err := req.Send()
  1848. // if err == nil { // resp is now filled
  1849. // fmt.Println(resp)
  1850. // }
  1851. //
  1852. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation
  1853. func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *request.Request, output *DisableKeyRotationOutput) {
  1854. op := &request.Operation{
  1855. Name: opDisableKeyRotation,
  1856. HTTPMethod: "POST",
  1857. HTTPPath: "/",
  1858. }
  1859. if input == nil {
  1860. input = &DisableKeyRotationInput{}
  1861. }
  1862. output = &DisableKeyRotationOutput{}
  1863. req = c.newRequest(op, input, output)
  1864. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1865. return
  1866. }
  1867. // DisableKeyRotation API operation for AWS Key Management Service.
  1868. //
  1869. // Disables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html)
  1870. // for the specified symmetric customer master key (CMK).
  1871. //
  1872. // You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported
  1873. // key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  1874. // You cannot perform this operation on a CMK in a different AWS account.
  1875. //
  1876. // The CMK that you use for this operation must be in a compatible key state.
  1877. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1878. // in the AWS Key Management Service Developer Guide.
  1879. //
  1880. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  1881. // with awserr.Error's Code and Message methods to get detailed information about
  1882. // the error.
  1883. //
  1884. // See the AWS API reference guide for AWS Key Management Service's
  1885. // API operation DisableKeyRotation for usage and error information.
  1886. //
  1887. // Returned Error Types:
  1888. // * NotFoundException
  1889. // The request was rejected because the specified entity or resource could not
  1890. // be found.
  1891. //
  1892. // * DisabledException
  1893. // The request was rejected because the specified CMK is not enabled.
  1894. //
  1895. // * InvalidArnException
  1896. // The request was rejected because a specified ARN, or an ARN in a key policy,
  1897. // is not valid.
  1898. //
  1899. // * DependencyTimeoutException
  1900. // The system timed out while trying to fulfill the request. The request can
  1901. // be retried.
  1902. //
  1903. // * InternalException
  1904. // The request was rejected because an internal exception occurred. The request
  1905. // can be retried.
  1906. //
  1907. // * InvalidStateException
  1908. // The request was rejected because the state of the specified resource is not
  1909. // valid for this request.
  1910. //
  1911. // For more information about how key state affects the use of a CMK, see How
  1912. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  1913. // in the AWS Key Management Service Developer Guide .
  1914. //
  1915. // * UnsupportedOperationException
  1916. // The request was rejected because a specified parameter is not supported or
  1917. // a specified resource is not valid for this operation.
  1918. //
  1919. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKeyRotation
  1920. func (c *KMS) DisableKeyRotation(input *DisableKeyRotationInput) (*DisableKeyRotationOutput, error) {
  1921. req, out := c.DisableKeyRotationRequest(input)
  1922. return out, req.Send()
  1923. }
  1924. // DisableKeyRotationWithContext is the same as DisableKeyRotation with the addition of
  1925. // the ability to pass a context and additional request options.
  1926. //
  1927. // See DisableKeyRotation for details on how to use this API operation.
  1928. //
  1929. // The context must be non-nil and will be used for request cancellation. If
  1930. // the context is nil a panic will occur. In the future the SDK may create
  1931. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  1932. // for more information on using Contexts.
  1933. func (c *KMS) DisableKeyRotationWithContext(ctx aws.Context, input *DisableKeyRotationInput, opts ...request.Option) (*DisableKeyRotationOutput, error) {
  1934. req, out := c.DisableKeyRotationRequest(input)
  1935. req.SetContext(ctx)
  1936. req.ApplyOptions(opts...)
  1937. return out, req.Send()
  1938. }
  1939. const opDisconnectCustomKeyStore = "DisconnectCustomKeyStore"
  1940. // DisconnectCustomKeyStoreRequest generates a "aws/request.Request" representing the
  1941. // client's request for the DisconnectCustomKeyStore operation. The "output" return
  1942. // value will be populated with the request's response once the request completes
  1943. // successfully.
  1944. //
  1945. // Use "Send" method on the returned Request to send the API call to the service.
  1946. // the "output" return value is not valid until after Send returns without error.
  1947. //
  1948. // See DisconnectCustomKeyStore for more information on using the DisconnectCustomKeyStore
  1949. // API call, and error handling.
  1950. //
  1951. // This method is useful when you want to inject custom logic or configuration
  1952. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  1953. //
  1954. //
  1955. // // Example sending a request using the DisconnectCustomKeyStoreRequest method.
  1956. // req, resp := client.DisconnectCustomKeyStoreRequest(params)
  1957. //
  1958. // err := req.Send()
  1959. // if err == nil { // resp is now filled
  1960. // fmt.Println(resp)
  1961. // }
  1962. //
  1963. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisconnectCustomKeyStore
  1964. func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInput) (req *request.Request, output *DisconnectCustomKeyStoreOutput) {
  1965. op := &request.Operation{
  1966. Name: opDisconnectCustomKeyStore,
  1967. HTTPMethod: "POST",
  1968. HTTPPath: "/",
  1969. }
  1970. if input == nil {
  1971. input = &DisconnectCustomKeyStoreInput{}
  1972. }
  1973. output = &DisconnectCustomKeyStoreOutput{}
  1974. req = c.newRequest(op, input, output)
  1975. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  1976. return
  1977. }
  1978. // DisconnectCustomKeyStore API operation for AWS Key Management Service.
  1979. //
  1980. // Disconnects the custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  1981. // from its associated AWS CloudHSM cluster. While a custom key store is disconnected,
  1982. // you can manage the custom key store and its customer master keys (CMKs),
  1983. // but you cannot create or use CMKs in the custom key store. You can reconnect
  1984. // the custom key store at any time.
  1985. //
  1986. // While a custom key store is disconnected, all attempts to create customer
  1987. // master keys (CMKs) in the custom key store or to use existing CMKs in cryptographic
  1988. // operations will fail. This action can prevent users from storing and accessing
  1989. // sensitive data.
  1990. //
  1991. // To find the connection state of a custom key store, use the DescribeCustomKeyStores
  1992. // operation. To reconnect a custom key store, use the ConnectCustomKeyStore
  1993. // operation.
  1994. //
  1995. // If the operation succeeds, it returns a JSON object with no properties.
  1996. //
  1997. // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  1998. // feature in AWS KMS, which combines the convenience and extensive integration
  1999. // of AWS KMS with the isolation and control of a single-tenant key store.
  2000. //
  2001. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2002. // with awserr.Error's Code and Message methods to get detailed information about
  2003. // the error.
  2004. //
  2005. // See the AWS API reference guide for AWS Key Management Service's
  2006. // API operation DisconnectCustomKeyStore for usage and error information.
  2007. //
  2008. // Returned Error Types:
  2009. // * CustomKeyStoreInvalidStateException
  2010. // The request was rejected because of the ConnectionState of the custom key
  2011. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  2012. // operation.
  2013. //
  2014. // This exception is thrown under the following conditions:
  2015. //
  2016. // * You requested the CreateKey or GenerateRandom operation in a custom
  2017. // key store that is not connected. These operations are valid only when
  2018. // the custom key store ConnectionState is CONNECTED.
  2019. //
  2020. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  2021. // on a custom key store that is not disconnected. This operation is valid
  2022. // only when the custom key store ConnectionState is DISCONNECTED.
  2023. //
  2024. // * You requested the ConnectCustomKeyStore operation on a custom key store
  2025. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  2026. // for all other ConnectionState values.
  2027. //
  2028. // * CustomKeyStoreNotFoundException
  2029. // The request was rejected because AWS KMS cannot find a custom key store with
  2030. // the specified key store name or ID.
  2031. //
  2032. // * InternalException
  2033. // The request was rejected because an internal exception occurred. The request
  2034. // can be retried.
  2035. //
  2036. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisconnectCustomKeyStore
  2037. func (c *KMS) DisconnectCustomKeyStore(input *DisconnectCustomKeyStoreInput) (*DisconnectCustomKeyStoreOutput, error) {
  2038. req, out := c.DisconnectCustomKeyStoreRequest(input)
  2039. return out, req.Send()
  2040. }
  2041. // DisconnectCustomKeyStoreWithContext is the same as DisconnectCustomKeyStore with the addition of
  2042. // the ability to pass a context and additional request options.
  2043. //
  2044. // See DisconnectCustomKeyStore for details on how to use this API operation.
  2045. //
  2046. // The context must be non-nil and will be used for request cancellation. If
  2047. // the context is nil a panic will occur. In the future the SDK may create
  2048. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2049. // for more information on using Contexts.
  2050. func (c *KMS) DisconnectCustomKeyStoreWithContext(ctx aws.Context, input *DisconnectCustomKeyStoreInput, opts ...request.Option) (*DisconnectCustomKeyStoreOutput, error) {
  2051. req, out := c.DisconnectCustomKeyStoreRequest(input)
  2052. req.SetContext(ctx)
  2053. req.ApplyOptions(opts...)
  2054. return out, req.Send()
  2055. }
  2056. const opEnableKey = "EnableKey"
  2057. // EnableKeyRequest generates a "aws/request.Request" representing the
  2058. // client's request for the EnableKey operation. The "output" return
  2059. // value will be populated with the request's response once the request completes
  2060. // successfully.
  2061. //
  2062. // Use "Send" method on the returned Request to send the API call to the service.
  2063. // the "output" return value is not valid until after Send returns without error.
  2064. //
  2065. // See EnableKey for more information on using the EnableKey
  2066. // API call, and error handling.
  2067. //
  2068. // This method is useful when you want to inject custom logic or configuration
  2069. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2070. //
  2071. //
  2072. // // Example sending a request using the EnableKeyRequest method.
  2073. // req, resp := client.EnableKeyRequest(params)
  2074. //
  2075. // err := req.Send()
  2076. // if err == nil { // resp is now filled
  2077. // fmt.Println(resp)
  2078. // }
  2079. //
  2080. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey
  2081. func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, output *EnableKeyOutput) {
  2082. op := &request.Operation{
  2083. Name: opEnableKey,
  2084. HTTPMethod: "POST",
  2085. HTTPPath: "/",
  2086. }
  2087. if input == nil {
  2088. input = &EnableKeyInput{}
  2089. }
  2090. output = &EnableKeyOutput{}
  2091. req = c.newRequest(op, input, output)
  2092. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  2093. return
  2094. }
  2095. // EnableKey API operation for AWS Key Management Service.
  2096. //
  2097. // Sets the key state of a customer master key (CMK) to enabled. This allows
  2098. // you to use the CMK for cryptographic operations. You cannot perform this
  2099. // operation on a CMK in a different AWS account.
  2100. //
  2101. // The CMK that you use for this operation must be in a compatible key state.
  2102. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2103. // in the AWS Key Management Service Developer Guide.
  2104. //
  2105. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2106. // with awserr.Error's Code and Message methods to get detailed information about
  2107. // the error.
  2108. //
  2109. // See the AWS API reference guide for AWS Key Management Service's
  2110. // API operation EnableKey for usage and error information.
  2111. //
  2112. // Returned Error Types:
  2113. // * NotFoundException
  2114. // The request was rejected because the specified entity or resource could not
  2115. // be found.
  2116. //
  2117. // * InvalidArnException
  2118. // The request was rejected because a specified ARN, or an ARN in a key policy,
  2119. // is not valid.
  2120. //
  2121. // * DependencyTimeoutException
  2122. // The system timed out while trying to fulfill the request. The request can
  2123. // be retried.
  2124. //
  2125. // * InternalException
  2126. // The request was rejected because an internal exception occurred. The request
  2127. // can be retried.
  2128. //
  2129. // * LimitExceededException
  2130. // The request was rejected because a limit was exceeded. For more information,
  2131. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  2132. // in the AWS Key Management Service Developer Guide.
  2133. //
  2134. // * InvalidStateException
  2135. // The request was rejected because the state of the specified resource is not
  2136. // valid for this request.
  2137. //
  2138. // For more information about how key state affects the use of a CMK, see How
  2139. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2140. // in the AWS Key Management Service Developer Guide .
  2141. //
  2142. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey
  2143. func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) {
  2144. req, out := c.EnableKeyRequest(input)
  2145. return out, req.Send()
  2146. }
  2147. // EnableKeyWithContext is the same as EnableKey with the addition of
  2148. // the ability to pass a context and additional request options.
  2149. //
  2150. // See EnableKey for details on how to use this API operation.
  2151. //
  2152. // The context must be non-nil and will be used for request cancellation. If
  2153. // the context is nil a panic will occur. In the future the SDK may create
  2154. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2155. // for more information on using Contexts.
  2156. func (c *KMS) EnableKeyWithContext(ctx aws.Context, input *EnableKeyInput, opts ...request.Option) (*EnableKeyOutput, error) {
  2157. req, out := c.EnableKeyRequest(input)
  2158. req.SetContext(ctx)
  2159. req.ApplyOptions(opts...)
  2160. return out, req.Send()
  2161. }
  2162. const opEnableKeyRotation = "EnableKeyRotation"
  2163. // EnableKeyRotationRequest generates a "aws/request.Request" representing the
  2164. // client's request for the EnableKeyRotation operation. The "output" return
  2165. // value will be populated with the request's response once the request completes
  2166. // successfully.
  2167. //
  2168. // Use "Send" method on the returned Request to send the API call to the service.
  2169. // the "output" return value is not valid until after Send returns without error.
  2170. //
  2171. // See EnableKeyRotation for more information on using the EnableKeyRotation
  2172. // API call, and error handling.
  2173. //
  2174. // This method is useful when you want to inject custom logic or configuration
  2175. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2176. //
  2177. //
  2178. // // Example sending a request using the EnableKeyRotationRequest method.
  2179. // req, resp := client.EnableKeyRotationRequest(params)
  2180. //
  2181. // err := req.Send()
  2182. // if err == nil { // resp is now filled
  2183. // fmt.Println(resp)
  2184. // }
  2185. //
  2186. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation
  2187. func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *request.Request, output *EnableKeyRotationOutput) {
  2188. op := &request.Operation{
  2189. Name: opEnableKeyRotation,
  2190. HTTPMethod: "POST",
  2191. HTTPPath: "/",
  2192. }
  2193. if input == nil {
  2194. input = &EnableKeyRotationInput{}
  2195. }
  2196. output = &EnableKeyRotationOutput{}
  2197. req = c.newRequest(op, input, output)
  2198. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  2199. return
  2200. }
  2201. // EnableKeyRotation API operation for AWS Key Management Service.
  2202. //
  2203. // Enables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html)
  2204. // for the specified symmetric customer master key (CMK). You cannot perform
  2205. // this operation on a CMK in a different AWS account.
  2206. //
  2207. // You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported
  2208. // key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  2209. //
  2210. // The CMK that you use for this operation must be in a compatible key state.
  2211. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2212. // in the AWS Key Management Service Developer Guide.
  2213. //
  2214. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2215. // with awserr.Error's Code and Message methods to get detailed information about
  2216. // the error.
  2217. //
  2218. // See the AWS API reference guide for AWS Key Management Service's
  2219. // API operation EnableKeyRotation for usage and error information.
  2220. //
  2221. // Returned Error Types:
  2222. // * NotFoundException
  2223. // The request was rejected because the specified entity or resource could not
  2224. // be found.
  2225. //
  2226. // * DisabledException
  2227. // The request was rejected because the specified CMK is not enabled.
  2228. //
  2229. // * InvalidArnException
  2230. // The request was rejected because a specified ARN, or an ARN in a key policy,
  2231. // is not valid.
  2232. //
  2233. // * DependencyTimeoutException
  2234. // The system timed out while trying to fulfill the request. The request can
  2235. // be retried.
  2236. //
  2237. // * InternalException
  2238. // The request was rejected because an internal exception occurred. The request
  2239. // can be retried.
  2240. //
  2241. // * InvalidStateException
  2242. // The request was rejected because the state of the specified resource is not
  2243. // valid for this request.
  2244. //
  2245. // For more information about how key state affects the use of a CMK, see How
  2246. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2247. // in the AWS Key Management Service Developer Guide .
  2248. //
  2249. // * UnsupportedOperationException
  2250. // The request was rejected because a specified parameter is not supported or
  2251. // a specified resource is not valid for this operation.
  2252. //
  2253. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKeyRotation
  2254. func (c *KMS) EnableKeyRotation(input *EnableKeyRotationInput) (*EnableKeyRotationOutput, error) {
  2255. req, out := c.EnableKeyRotationRequest(input)
  2256. return out, req.Send()
  2257. }
  2258. // EnableKeyRotationWithContext is the same as EnableKeyRotation with the addition of
  2259. // the ability to pass a context and additional request options.
  2260. //
  2261. // See EnableKeyRotation for details on how to use this API operation.
  2262. //
  2263. // The context must be non-nil and will be used for request cancellation. If
  2264. // the context is nil a panic will occur. In the future the SDK may create
  2265. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2266. // for more information on using Contexts.
  2267. func (c *KMS) EnableKeyRotationWithContext(ctx aws.Context, input *EnableKeyRotationInput, opts ...request.Option) (*EnableKeyRotationOutput, error) {
  2268. req, out := c.EnableKeyRotationRequest(input)
  2269. req.SetContext(ctx)
  2270. req.ApplyOptions(opts...)
  2271. return out, req.Send()
  2272. }
  2273. const opEncrypt = "Encrypt"
  2274. // EncryptRequest generates a "aws/request.Request" representing the
  2275. // client's request for the Encrypt operation. The "output" return
  2276. // value will be populated with the request's response once the request completes
  2277. // successfully.
  2278. //
  2279. // Use "Send" method on the returned Request to send the API call to the service.
  2280. // the "output" return value is not valid until after Send returns without error.
  2281. //
  2282. // See Encrypt for more information on using the Encrypt
  2283. // API call, and error handling.
  2284. //
  2285. // This method is useful when you want to inject custom logic or configuration
  2286. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2287. //
  2288. //
  2289. // // Example sending a request using the EncryptRequest method.
  2290. // req, resp := client.EncryptRequest(params)
  2291. //
  2292. // err := req.Send()
  2293. // if err == nil { // resp is now filled
  2294. // fmt.Println(resp)
  2295. // }
  2296. //
  2297. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt
  2298. func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output *EncryptOutput) {
  2299. op := &request.Operation{
  2300. Name: opEncrypt,
  2301. HTTPMethod: "POST",
  2302. HTTPPath: "/",
  2303. }
  2304. if input == nil {
  2305. input = &EncryptInput{}
  2306. }
  2307. output = &EncryptOutput{}
  2308. req = c.newRequest(op, input, output)
  2309. return
  2310. }
  2311. // Encrypt API operation for AWS Key Management Service.
  2312. //
  2313. // Encrypts plaintext into ciphertext by using a customer master key (CMK).
  2314. // The Encrypt operation has two primary use cases:
  2315. //
  2316. // * You can encrypt small amounts of arbitrary data, such as a personal
  2317. // identifier or database password, or other sensitive information.
  2318. //
  2319. // * You can use the Encrypt operation to move encrypted data from one AWS
  2320. // region to another. In the first region, generate a data key and use the
  2321. // plaintext key to encrypt the data. Then, in the new region, call the Encrypt
  2322. // method on same plaintext data key. Now, you can safely move the encrypted
  2323. // data and encrypted data key to the new region, and decrypt in the new
  2324. // region when necessary.
  2325. //
  2326. // You don't need to use the Encrypt operation to encrypt a data key. The GenerateDataKey
  2327. // and GenerateDataKeyPair operations return a plaintext data key and an encrypted
  2328. // copy of that data key.
  2329. //
  2330. // When you encrypt data, you must specify a symmetric or asymmetric CMK to
  2331. // use in the encryption operation. The CMK must have a KeyUsage value of ENCRYPT_DECRYPT.
  2332. // To find the KeyUsage of a CMK, use the DescribeKey operation.
  2333. //
  2334. // If you use a symmetric CMK, you can use an encryption context to add additional
  2335. // security to your encryption operation. If you specify an EncryptionContext
  2336. // when encrypting data, you must specify the same encryption context (a case-sensitive
  2337. // exact match) when decrypting the data. Otherwise, the request to decrypt
  2338. // fails with an InvalidCiphertextException. For more information, see Encryption
  2339. // Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  2340. // in the AWS Key Management Service Developer Guide.
  2341. //
  2342. // If you specify an asymmetric CMK, you must also specify the encryption algorithm.
  2343. // The algorithm must be compatible with the CMK type.
  2344. //
  2345. // When you use an asymmetric CMK to encrypt or reencrypt data, be sure to record
  2346. // the CMK and encryption algorithm that you choose. You will be required to
  2347. // provide the same CMK and encryption algorithm when you decrypt the data.
  2348. // If the CMK and algorithm do not match the values used to encrypt the data,
  2349. // the decrypt operation fails.
  2350. //
  2351. // You are not required to supply the CMK ID and encryption algorithm when you
  2352. // decrypt with symmetric CMKs because AWS KMS stores this information in the
  2353. // ciphertext blob. AWS KMS cannot store metadata in ciphertext generated with
  2354. // asymmetric keys. The standard format for asymmetric key ciphertext does not
  2355. // include configurable fields.
  2356. //
  2357. // The maximum size of the data that you can encrypt varies with the type of
  2358. // CMK and the encryption algorithm that you choose.
  2359. //
  2360. // * Symmetric CMKs SYMMETRIC_DEFAULT: 4096 bytes
  2361. //
  2362. // * RSA_2048 RSAES_OAEP_SHA_1: 214 bytes RSAES_OAEP_SHA_256: 190 bytes
  2363. //
  2364. // * RSA_3072 RSAES_OAEP_SHA_1: 342 bytes RSAES_OAEP_SHA_256: 318 bytes
  2365. //
  2366. // * RSA_4096 RSAES_OAEP_SHA_1: 470 bytes RSAES_OAEP_SHA_256: 446 bytes
  2367. //
  2368. // The CMK that you use for this operation must be in a compatible key state.
  2369. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2370. // in the AWS Key Management Service Developer Guide.
  2371. //
  2372. // To perform this operation on a CMK in a different AWS account, specify the
  2373. // key ARN or alias ARN in the value of the KeyId parameter.
  2374. //
  2375. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2376. // with awserr.Error's Code and Message methods to get detailed information about
  2377. // the error.
  2378. //
  2379. // See the AWS API reference guide for AWS Key Management Service's
  2380. // API operation Encrypt for usage and error information.
  2381. //
  2382. // Returned Error Types:
  2383. // * NotFoundException
  2384. // The request was rejected because the specified entity or resource could not
  2385. // be found.
  2386. //
  2387. // * DisabledException
  2388. // The request was rejected because the specified CMK is not enabled.
  2389. //
  2390. // * KeyUnavailableException
  2391. // The request was rejected because the specified CMK was not available. You
  2392. // can retry the request.
  2393. //
  2394. // * DependencyTimeoutException
  2395. // The system timed out while trying to fulfill the request. The request can
  2396. // be retried.
  2397. //
  2398. // * InvalidKeyUsageException
  2399. // The request was rejected for one of the following reasons:
  2400. //
  2401. // * The KeyUsage value of the CMK is incompatible with the API operation.
  2402. //
  2403. // * The encryption algorithm or signing algorithm specified for the operation
  2404. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  2405. //
  2406. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  2407. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  2408. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  2409. //
  2410. // To find the encryption or signing algorithms supported for a particular CMK,
  2411. // use the DescribeKey operation.
  2412. //
  2413. // * InvalidGrantTokenException
  2414. // The request was rejected because the specified grant token is not valid.
  2415. //
  2416. // * InternalException
  2417. // The request was rejected because an internal exception occurred. The request
  2418. // can be retried.
  2419. //
  2420. // * InvalidStateException
  2421. // The request was rejected because the state of the specified resource is not
  2422. // valid for this request.
  2423. //
  2424. // For more information about how key state affects the use of a CMK, see How
  2425. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2426. // in the AWS Key Management Service Developer Guide .
  2427. //
  2428. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt
  2429. func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) {
  2430. req, out := c.EncryptRequest(input)
  2431. return out, req.Send()
  2432. }
  2433. // EncryptWithContext is the same as Encrypt with the addition of
  2434. // the ability to pass a context and additional request options.
  2435. //
  2436. // See Encrypt for details on how to use this API operation.
  2437. //
  2438. // The context must be non-nil and will be used for request cancellation. If
  2439. // the context is nil a panic will occur. In the future the SDK may create
  2440. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2441. // for more information on using Contexts.
  2442. func (c *KMS) EncryptWithContext(ctx aws.Context, input *EncryptInput, opts ...request.Option) (*EncryptOutput, error) {
  2443. req, out := c.EncryptRequest(input)
  2444. req.SetContext(ctx)
  2445. req.ApplyOptions(opts...)
  2446. return out, req.Send()
  2447. }
  2448. const opGenerateDataKey = "GenerateDataKey"
  2449. // GenerateDataKeyRequest generates a "aws/request.Request" representing the
  2450. // client's request for the GenerateDataKey operation. The "output" return
  2451. // value will be populated with the request's response once the request completes
  2452. // successfully.
  2453. //
  2454. // Use "Send" method on the returned Request to send the API call to the service.
  2455. // the "output" return value is not valid until after Send returns without error.
  2456. //
  2457. // See GenerateDataKey for more information on using the GenerateDataKey
  2458. // API call, and error handling.
  2459. //
  2460. // This method is useful when you want to inject custom logic or configuration
  2461. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2462. //
  2463. //
  2464. // // Example sending a request using the GenerateDataKeyRequest method.
  2465. // req, resp := client.GenerateDataKeyRequest(params)
  2466. //
  2467. // err := req.Send()
  2468. // if err == nil { // resp is now filled
  2469. // fmt.Println(resp)
  2470. // }
  2471. //
  2472. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey
  2473. func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request.Request, output *GenerateDataKeyOutput) {
  2474. op := &request.Operation{
  2475. Name: opGenerateDataKey,
  2476. HTTPMethod: "POST",
  2477. HTTPPath: "/",
  2478. }
  2479. if input == nil {
  2480. input = &GenerateDataKeyInput{}
  2481. }
  2482. output = &GenerateDataKeyOutput{}
  2483. req = c.newRequest(op, input, output)
  2484. return
  2485. }
  2486. // GenerateDataKey API operation for AWS Key Management Service.
  2487. //
  2488. // Generates a unique symmetric data key. This operation returns a plaintext
  2489. // copy of the data key and a copy that is encrypted under a customer master
  2490. // key (CMK) that you specify. You can use the plaintext key to encrypt your
  2491. // data outside of AWS KMS and store the encrypted data key with the encrypted
  2492. // data.
  2493. //
  2494. // GenerateDataKey returns a unique data key for each request. The bytes in
  2495. // the key are not related to the caller or CMK that is used to encrypt the
  2496. // data key.
  2497. //
  2498. // To generate a data key, specify the symmetric CMK that will be used to encrypt
  2499. // the data key. You cannot use an asymmetric CMK to generate data keys.
  2500. //
  2501. // You must also specify the length of the data key. Use either the KeySpec
  2502. // or NumberOfBytes parameters (but not both). For 128-bit and 256-bit data
  2503. // keys, use the KeySpec parameter.
  2504. //
  2505. // If the operation succeeds, the plaintext copy of the data key is in the Plaintext
  2506. // field of the response, and the encrypted copy of the data key in the CiphertextBlob
  2507. // field.
  2508. //
  2509. // To get only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext.
  2510. // To generate an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext
  2511. // operation. To get a cryptographically secure random byte string, use GenerateRandom.
  2512. //
  2513. // You can use the optional encryption context to add additional security to
  2514. // the encryption operation. If you specify an EncryptionContext, you must specify
  2515. // the same encryption context (a case-sensitive exact match) when decrypting
  2516. // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException.
  2517. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  2518. // in the AWS Key Management Service Developer Guide.
  2519. //
  2520. // The CMK that you use for this operation must be in a compatible key state.
  2521. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2522. // in the AWS Key Management Service Developer Guide.
  2523. //
  2524. // We recommend that you use the following pattern to encrypt data locally in
  2525. // your application:
  2526. //
  2527. // Use the GenerateDataKey operation to get a data encryption key.
  2528. //
  2529. // Use the plaintext data key (returned in the Plaintext field of the response)
  2530. // to encrypt data locally, then erase the plaintext data key from memory.
  2531. //
  2532. // Store the encrypted data key (returned in the CiphertextBlob field of the
  2533. // response) alongside the locally encrypted data.
  2534. //
  2535. // To decrypt data locally:
  2536. //
  2537. // Use the Decrypt operation to decrypt the encrypted data key. The operation
  2538. // returns a plaintext copy of the data key.
  2539. //
  2540. // Use the plaintext data key to decrypt data locally, then erase the plaintext
  2541. // data key from memory.
  2542. //
  2543. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2544. // with awserr.Error's Code and Message methods to get detailed information about
  2545. // the error.
  2546. //
  2547. // See the AWS API reference guide for AWS Key Management Service's
  2548. // API operation GenerateDataKey for usage and error information.
  2549. //
  2550. // Returned Error Types:
  2551. // * NotFoundException
  2552. // The request was rejected because the specified entity or resource could not
  2553. // be found.
  2554. //
  2555. // * DisabledException
  2556. // The request was rejected because the specified CMK is not enabled.
  2557. //
  2558. // * KeyUnavailableException
  2559. // The request was rejected because the specified CMK was not available. You
  2560. // can retry the request.
  2561. //
  2562. // * DependencyTimeoutException
  2563. // The system timed out while trying to fulfill the request. The request can
  2564. // be retried.
  2565. //
  2566. // * InvalidKeyUsageException
  2567. // The request was rejected for one of the following reasons:
  2568. //
  2569. // * The KeyUsage value of the CMK is incompatible with the API operation.
  2570. //
  2571. // * The encryption algorithm or signing algorithm specified for the operation
  2572. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  2573. //
  2574. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  2575. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  2576. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  2577. //
  2578. // To find the encryption or signing algorithms supported for a particular CMK,
  2579. // use the DescribeKey operation.
  2580. //
  2581. // * InvalidGrantTokenException
  2582. // The request was rejected because the specified grant token is not valid.
  2583. //
  2584. // * InternalException
  2585. // The request was rejected because an internal exception occurred. The request
  2586. // can be retried.
  2587. //
  2588. // * InvalidStateException
  2589. // The request was rejected because the state of the specified resource is not
  2590. // valid for this request.
  2591. //
  2592. // For more information about how key state affects the use of a CMK, see How
  2593. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2594. // in the AWS Key Management Service Developer Guide .
  2595. //
  2596. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey
  2597. func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) {
  2598. req, out := c.GenerateDataKeyRequest(input)
  2599. return out, req.Send()
  2600. }
  2601. // GenerateDataKeyWithContext is the same as GenerateDataKey with the addition of
  2602. // the ability to pass a context and additional request options.
  2603. //
  2604. // See GenerateDataKey for details on how to use this API operation.
  2605. //
  2606. // The context must be non-nil and will be used for request cancellation. If
  2607. // the context is nil a panic will occur. In the future the SDK may create
  2608. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2609. // for more information on using Contexts.
  2610. func (c *KMS) GenerateDataKeyWithContext(ctx aws.Context, input *GenerateDataKeyInput, opts ...request.Option) (*GenerateDataKeyOutput, error) {
  2611. req, out := c.GenerateDataKeyRequest(input)
  2612. req.SetContext(ctx)
  2613. req.ApplyOptions(opts...)
  2614. return out, req.Send()
  2615. }
  2616. const opGenerateDataKeyPair = "GenerateDataKeyPair"
  2617. // GenerateDataKeyPairRequest generates a "aws/request.Request" representing the
  2618. // client's request for the GenerateDataKeyPair operation. The "output" return
  2619. // value will be populated with the request's response once the request completes
  2620. // successfully.
  2621. //
  2622. // Use "Send" method on the returned Request to send the API call to the service.
  2623. // the "output" return value is not valid until after Send returns without error.
  2624. //
  2625. // See GenerateDataKeyPair for more information on using the GenerateDataKeyPair
  2626. // API call, and error handling.
  2627. //
  2628. // This method is useful when you want to inject custom logic or configuration
  2629. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2630. //
  2631. //
  2632. // // Example sending a request using the GenerateDataKeyPairRequest method.
  2633. // req, resp := client.GenerateDataKeyPairRequest(params)
  2634. //
  2635. // err := req.Send()
  2636. // if err == nil { // resp is now filled
  2637. // fmt.Println(resp)
  2638. // }
  2639. //
  2640. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair
  2641. func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req *request.Request, output *GenerateDataKeyPairOutput) {
  2642. op := &request.Operation{
  2643. Name: opGenerateDataKeyPair,
  2644. HTTPMethod: "POST",
  2645. HTTPPath: "/",
  2646. }
  2647. if input == nil {
  2648. input = &GenerateDataKeyPairInput{}
  2649. }
  2650. output = &GenerateDataKeyPairOutput{}
  2651. req = c.newRequest(op, input, output)
  2652. return
  2653. }
  2654. // GenerateDataKeyPair API operation for AWS Key Management Service.
  2655. //
  2656. // Generates a unique asymmetric data key pair. The GenerateDataKeyPair operation
  2657. // returns a plaintext public key, a plaintext private key, and a copy of the
  2658. // private key that is encrypted under the symmetric CMK you specify. You can
  2659. // use the data key pair to perform asymmetric cryptography outside of AWS KMS.
  2660. //
  2661. // GenerateDataKeyPair returns a unique data key pair for each request. The
  2662. // bytes in the keys are not related to the caller or the CMK that is used to
  2663. // encrypt the private key.
  2664. //
  2665. // You can use the public key that GenerateDataKeyPair returns to encrypt data
  2666. // or verify a signature outside of AWS KMS. Then, store the encrypted private
  2667. // key with the data. When you are ready to decrypt data or sign a message,
  2668. // you can use the Decrypt operation to decrypt the encrypted private key.
  2669. //
  2670. // To generate a data key pair, you must specify a symmetric customer master
  2671. // key (CMK) to encrypt the private key in a data key pair. You cannot use an
  2672. // asymmetric CMK. To get the type of your CMK, use the DescribeKey operation.
  2673. //
  2674. // If you are using the data key pair to encrypt data, or for any operation
  2675. // where you don't immediately need a private key, consider using the GenerateDataKeyPairWithoutPlaintext
  2676. // operation. GenerateDataKeyPairWithoutPlaintext returns a plaintext public
  2677. // key and an encrypted private key, but omits the plaintext private key that
  2678. // you need only to decrypt ciphertext or sign a message. Later, when you need
  2679. // to decrypt the data or sign a message, use the Decrypt operation to decrypt
  2680. // the encrypted private key in the data key pair.
  2681. //
  2682. // You can use the optional encryption context to add additional security to
  2683. // the encryption operation. If you specify an EncryptionContext, you must specify
  2684. // the same encryption context (a case-sensitive exact match) when decrypting
  2685. // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException.
  2686. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  2687. // in the AWS Key Management Service Developer Guide.
  2688. //
  2689. // The CMK that you use for this operation must be in a compatible key state.
  2690. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2691. // in the AWS Key Management Service Developer Guide.
  2692. //
  2693. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2694. // with awserr.Error's Code and Message methods to get detailed information about
  2695. // the error.
  2696. //
  2697. // See the AWS API reference guide for AWS Key Management Service's
  2698. // API operation GenerateDataKeyPair for usage and error information.
  2699. //
  2700. // Returned Error Types:
  2701. // * NotFoundException
  2702. // The request was rejected because the specified entity or resource could not
  2703. // be found.
  2704. //
  2705. // * DisabledException
  2706. // The request was rejected because the specified CMK is not enabled.
  2707. //
  2708. // * KeyUnavailableException
  2709. // The request was rejected because the specified CMK was not available. You
  2710. // can retry the request.
  2711. //
  2712. // * DependencyTimeoutException
  2713. // The system timed out while trying to fulfill the request. The request can
  2714. // be retried.
  2715. //
  2716. // * InvalidKeyUsageException
  2717. // The request was rejected for one of the following reasons:
  2718. //
  2719. // * The KeyUsage value of the CMK is incompatible with the API operation.
  2720. //
  2721. // * The encryption algorithm or signing algorithm specified for the operation
  2722. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  2723. //
  2724. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  2725. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  2726. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  2727. //
  2728. // To find the encryption or signing algorithms supported for a particular CMK,
  2729. // use the DescribeKey operation.
  2730. //
  2731. // * InvalidGrantTokenException
  2732. // The request was rejected because the specified grant token is not valid.
  2733. //
  2734. // * InternalException
  2735. // The request was rejected because an internal exception occurred. The request
  2736. // can be retried.
  2737. //
  2738. // * InvalidStateException
  2739. // The request was rejected because the state of the specified resource is not
  2740. // valid for this request.
  2741. //
  2742. // For more information about how key state affects the use of a CMK, see How
  2743. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2744. // in the AWS Key Management Service Developer Guide .
  2745. //
  2746. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair
  2747. func (c *KMS) GenerateDataKeyPair(input *GenerateDataKeyPairInput) (*GenerateDataKeyPairOutput, error) {
  2748. req, out := c.GenerateDataKeyPairRequest(input)
  2749. return out, req.Send()
  2750. }
  2751. // GenerateDataKeyPairWithContext is the same as GenerateDataKeyPair with the addition of
  2752. // the ability to pass a context and additional request options.
  2753. //
  2754. // See GenerateDataKeyPair for details on how to use this API operation.
  2755. //
  2756. // The context must be non-nil and will be used for request cancellation. If
  2757. // the context is nil a panic will occur. In the future the SDK may create
  2758. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2759. // for more information on using Contexts.
  2760. func (c *KMS) GenerateDataKeyPairWithContext(ctx aws.Context, input *GenerateDataKeyPairInput, opts ...request.Option) (*GenerateDataKeyPairOutput, error) {
  2761. req, out := c.GenerateDataKeyPairRequest(input)
  2762. req.SetContext(ctx)
  2763. req.ApplyOptions(opts...)
  2764. return out, req.Send()
  2765. }
  2766. const opGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext"
  2767. // GenerateDataKeyPairWithoutPlaintextRequest generates a "aws/request.Request" representing the
  2768. // client's request for the GenerateDataKeyPairWithoutPlaintext operation. The "output" return
  2769. // value will be populated with the request's response once the request completes
  2770. // successfully.
  2771. //
  2772. // Use "Send" method on the returned Request to send the API call to the service.
  2773. // the "output" return value is not valid until after Send returns without error.
  2774. //
  2775. // See GenerateDataKeyPairWithoutPlaintext for more information on using the GenerateDataKeyPairWithoutPlaintext
  2776. // API call, and error handling.
  2777. //
  2778. // This method is useful when you want to inject custom logic or configuration
  2779. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2780. //
  2781. //
  2782. // // Example sending a request using the GenerateDataKeyPairWithoutPlaintextRequest method.
  2783. // req, resp := client.GenerateDataKeyPairWithoutPlaintextRequest(params)
  2784. //
  2785. // err := req.Send()
  2786. // if err == nil { // resp is now filled
  2787. // fmt.Println(resp)
  2788. // }
  2789. //
  2790. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext
  2791. func (c *KMS) GenerateDataKeyPairWithoutPlaintextRequest(input *GenerateDataKeyPairWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyPairWithoutPlaintextOutput) {
  2792. op := &request.Operation{
  2793. Name: opGenerateDataKeyPairWithoutPlaintext,
  2794. HTTPMethod: "POST",
  2795. HTTPPath: "/",
  2796. }
  2797. if input == nil {
  2798. input = &GenerateDataKeyPairWithoutPlaintextInput{}
  2799. }
  2800. output = &GenerateDataKeyPairWithoutPlaintextOutput{}
  2801. req = c.newRequest(op, input, output)
  2802. return
  2803. }
  2804. // GenerateDataKeyPairWithoutPlaintext API operation for AWS Key Management Service.
  2805. //
  2806. // Generates a unique asymmetric data key pair. The GenerateDataKeyPairWithoutPlaintext
  2807. // operation returns a plaintext public key and a copy of the private key that
  2808. // is encrypted under the symmetric CMK you specify. Unlike GenerateDataKeyPair,
  2809. // this operation does not return a plaintext private key.
  2810. //
  2811. // To generate a data key pair, you must specify a symmetric customer master
  2812. // key (CMK) to encrypt the private key in the data key pair. You cannot use
  2813. // an asymmetric CMK. To get the type of your CMK, use the KeySpec field in
  2814. // the DescribeKey response.
  2815. //
  2816. // You can use the public key that GenerateDataKeyPairWithoutPlaintext returns
  2817. // to encrypt data or verify a signature outside of AWS KMS. Then, store the
  2818. // encrypted private key with the data. When you are ready to decrypt data or
  2819. // sign a message, you can use the Decrypt operation to decrypt the encrypted
  2820. // private key.
  2821. //
  2822. // GenerateDataKeyPairWithoutPlaintext returns a unique data key pair for each
  2823. // request. The bytes in the key are not related to the caller or CMK that is
  2824. // used to encrypt the private key.
  2825. //
  2826. // You can use the optional encryption context to add additional security to
  2827. // the encryption operation. If you specify an EncryptionContext, you must specify
  2828. // the same encryption context (a case-sensitive exact match) when decrypting
  2829. // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException.
  2830. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  2831. // in the AWS Key Management Service Developer Guide.
  2832. //
  2833. // The CMK that you use for this operation must be in a compatible key state.
  2834. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2835. // in the AWS Key Management Service Developer Guide.
  2836. //
  2837. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2838. // with awserr.Error's Code and Message methods to get detailed information about
  2839. // the error.
  2840. //
  2841. // See the AWS API reference guide for AWS Key Management Service's
  2842. // API operation GenerateDataKeyPairWithoutPlaintext for usage and error information.
  2843. //
  2844. // Returned Error Types:
  2845. // * NotFoundException
  2846. // The request was rejected because the specified entity or resource could not
  2847. // be found.
  2848. //
  2849. // * DisabledException
  2850. // The request was rejected because the specified CMK is not enabled.
  2851. //
  2852. // * KeyUnavailableException
  2853. // The request was rejected because the specified CMK was not available. You
  2854. // can retry the request.
  2855. //
  2856. // * DependencyTimeoutException
  2857. // The system timed out while trying to fulfill the request. The request can
  2858. // be retried.
  2859. //
  2860. // * InvalidKeyUsageException
  2861. // The request was rejected for one of the following reasons:
  2862. //
  2863. // * The KeyUsage value of the CMK is incompatible with the API operation.
  2864. //
  2865. // * The encryption algorithm or signing algorithm specified for the operation
  2866. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  2867. //
  2868. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  2869. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  2870. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  2871. //
  2872. // To find the encryption or signing algorithms supported for a particular CMK,
  2873. // use the DescribeKey operation.
  2874. //
  2875. // * InvalidGrantTokenException
  2876. // The request was rejected because the specified grant token is not valid.
  2877. //
  2878. // * InternalException
  2879. // The request was rejected because an internal exception occurred. The request
  2880. // can be retried.
  2881. //
  2882. // * InvalidStateException
  2883. // The request was rejected because the state of the specified resource is not
  2884. // valid for this request.
  2885. //
  2886. // For more information about how key state affects the use of a CMK, see How
  2887. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2888. // in the AWS Key Management Service Developer Guide .
  2889. //
  2890. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext
  2891. func (c *KMS) GenerateDataKeyPairWithoutPlaintext(input *GenerateDataKeyPairWithoutPlaintextInput) (*GenerateDataKeyPairWithoutPlaintextOutput, error) {
  2892. req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input)
  2893. return out, req.Send()
  2894. }
  2895. // GenerateDataKeyPairWithoutPlaintextWithContext is the same as GenerateDataKeyPairWithoutPlaintext with the addition of
  2896. // the ability to pass a context and additional request options.
  2897. //
  2898. // See GenerateDataKeyPairWithoutPlaintext for details on how to use this API operation.
  2899. //
  2900. // The context must be non-nil and will be used for request cancellation. If
  2901. // the context is nil a panic will occur. In the future the SDK may create
  2902. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  2903. // for more information on using Contexts.
  2904. func (c *KMS) GenerateDataKeyPairWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyPairWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyPairWithoutPlaintextOutput, error) {
  2905. req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input)
  2906. req.SetContext(ctx)
  2907. req.ApplyOptions(opts...)
  2908. return out, req.Send()
  2909. }
  2910. const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext"
  2911. // GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the
  2912. // client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return
  2913. // value will be populated with the request's response once the request completes
  2914. // successfully.
  2915. //
  2916. // Use "Send" method on the returned Request to send the API call to the service.
  2917. // the "output" return value is not valid until after Send returns without error.
  2918. //
  2919. // See GenerateDataKeyWithoutPlaintext for more information on using the GenerateDataKeyWithoutPlaintext
  2920. // API call, and error handling.
  2921. //
  2922. // This method is useful when you want to inject custom logic or configuration
  2923. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  2924. //
  2925. //
  2926. // // Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method.
  2927. // req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params)
  2928. //
  2929. // err := req.Send()
  2930. // if err == nil { // resp is now filled
  2931. // fmt.Println(resp)
  2932. // }
  2933. //
  2934. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext
  2935. func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) {
  2936. op := &request.Operation{
  2937. Name: opGenerateDataKeyWithoutPlaintext,
  2938. HTTPMethod: "POST",
  2939. HTTPPath: "/",
  2940. }
  2941. if input == nil {
  2942. input = &GenerateDataKeyWithoutPlaintextInput{}
  2943. }
  2944. output = &GenerateDataKeyWithoutPlaintextOutput{}
  2945. req = c.newRequest(op, input, output)
  2946. return
  2947. }
  2948. // GenerateDataKeyWithoutPlaintext API operation for AWS Key Management Service.
  2949. //
  2950. // Generates a unique symmetric data key. This operation returns a data key
  2951. // that is encrypted under a customer master key (CMK) that you specify. To
  2952. // request an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext
  2953. // operations.
  2954. //
  2955. // GenerateDataKeyWithoutPlaintext is identical to the GenerateDataKey operation
  2956. // except that returns only the encrypted copy of the data key. This operation
  2957. // is useful for systems that need to encrypt data at some point, but not immediately.
  2958. // When you need to encrypt the data, you call the Decrypt operation on the
  2959. // encrypted copy of the key.
  2960. //
  2961. // It's also useful in distributed systems with different levels of trust. For
  2962. // example, you might store encrypted data in containers. One component of your
  2963. // system creates new containers and stores an encrypted data key with each
  2964. // container. Then, a different component puts the data into the containers.
  2965. // That component first decrypts the data key, uses the plaintext data key to
  2966. // encrypt data, puts the encrypted data into the container, and then destroys
  2967. // the plaintext data key. In this system, the component that creates the containers
  2968. // never sees the plaintext data key.
  2969. //
  2970. // GenerateDataKeyWithoutPlaintext returns a unique data key for each request.
  2971. // The bytes in the keys are not related to the caller or CMK that is used to
  2972. // encrypt the private key.
  2973. //
  2974. // To generate a data key, you must specify the symmetric customer master key
  2975. // (CMK) that is used to encrypt the data key. You cannot use an asymmetric
  2976. // CMK to generate a data key. To get the type of your CMK, use the KeySpec
  2977. // field in the DescribeKey response. You must also specify the length of the
  2978. // data key using either the KeySpec or NumberOfBytes field (but not both).
  2979. // For common key lengths (128-bit and 256-bit symmetric keys), use the KeySpec
  2980. // parameter.
  2981. //
  2982. // If the operation succeeds, you will find the plaintext copy of the data key
  2983. // in the Plaintext field of the response, and the encrypted copy of the data
  2984. // key in the CiphertextBlob field.
  2985. //
  2986. // You can use the optional encryption context to add additional security to
  2987. // the encryption operation. If you specify an EncryptionContext, you must specify
  2988. // the same encryption context (a case-sensitive exact match) when decrypting
  2989. // the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException.
  2990. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  2991. // in the AWS Key Management Service Developer Guide.
  2992. //
  2993. // The CMK that you use for this operation must be in a compatible key state.
  2994. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  2995. // in the AWS Key Management Service Developer Guide.
  2996. //
  2997. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  2998. // with awserr.Error's Code and Message methods to get detailed information about
  2999. // the error.
  3000. //
  3001. // See the AWS API reference guide for AWS Key Management Service's
  3002. // API operation GenerateDataKeyWithoutPlaintext for usage and error information.
  3003. //
  3004. // Returned Error Types:
  3005. // * NotFoundException
  3006. // The request was rejected because the specified entity or resource could not
  3007. // be found.
  3008. //
  3009. // * DisabledException
  3010. // The request was rejected because the specified CMK is not enabled.
  3011. //
  3012. // * KeyUnavailableException
  3013. // The request was rejected because the specified CMK was not available. You
  3014. // can retry the request.
  3015. //
  3016. // * DependencyTimeoutException
  3017. // The system timed out while trying to fulfill the request. The request can
  3018. // be retried.
  3019. //
  3020. // * InvalidKeyUsageException
  3021. // The request was rejected for one of the following reasons:
  3022. //
  3023. // * The KeyUsage value of the CMK is incompatible with the API operation.
  3024. //
  3025. // * The encryption algorithm or signing algorithm specified for the operation
  3026. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  3027. //
  3028. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  3029. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  3030. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  3031. //
  3032. // To find the encryption or signing algorithms supported for a particular CMK,
  3033. // use the DescribeKey operation.
  3034. //
  3035. // * InvalidGrantTokenException
  3036. // The request was rejected because the specified grant token is not valid.
  3037. //
  3038. // * InternalException
  3039. // The request was rejected because an internal exception occurred. The request
  3040. // can be retried.
  3041. //
  3042. // * InvalidStateException
  3043. // The request was rejected because the state of the specified resource is not
  3044. // valid for this request.
  3045. //
  3046. // For more information about how key state affects the use of a CMK, see How
  3047. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3048. // in the AWS Key Management Service Developer Guide .
  3049. //
  3050. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext
  3051. func (c *KMS) GenerateDataKeyWithoutPlaintext(input *GenerateDataKeyWithoutPlaintextInput) (*GenerateDataKeyWithoutPlaintextOutput, error) {
  3052. req, out := c.GenerateDataKeyWithoutPlaintextRequest(input)
  3053. return out, req.Send()
  3054. }
  3055. // GenerateDataKeyWithoutPlaintextWithContext is the same as GenerateDataKeyWithoutPlaintext with the addition of
  3056. // the ability to pass a context and additional request options.
  3057. //
  3058. // See GenerateDataKeyWithoutPlaintext for details on how to use this API operation.
  3059. //
  3060. // The context must be non-nil and will be used for request cancellation. If
  3061. // the context is nil a panic will occur. In the future the SDK may create
  3062. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3063. // for more information on using Contexts.
  3064. func (c *KMS) GenerateDataKeyWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyWithoutPlaintextOutput, error) {
  3065. req, out := c.GenerateDataKeyWithoutPlaintextRequest(input)
  3066. req.SetContext(ctx)
  3067. req.ApplyOptions(opts...)
  3068. return out, req.Send()
  3069. }
  3070. const opGenerateRandom = "GenerateRandom"
  3071. // GenerateRandomRequest generates a "aws/request.Request" representing the
  3072. // client's request for the GenerateRandom operation. The "output" return
  3073. // value will be populated with the request's response once the request completes
  3074. // successfully.
  3075. //
  3076. // Use "Send" method on the returned Request to send the API call to the service.
  3077. // the "output" return value is not valid until after Send returns without error.
  3078. //
  3079. // See GenerateRandom for more information on using the GenerateRandom
  3080. // API call, and error handling.
  3081. //
  3082. // This method is useful when you want to inject custom logic or configuration
  3083. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3084. //
  3085. //
  3086. // // Example sending a request using the GenerateRandomRequest method.
  3087. // req, resp := client.GenerateRandomRequest(params)
  3088. //
  3089. // err := req.Send()
  3090. // if err == nil { // resp is now filled
  3091. // fmt.Println(resp)
  3092. // }
  3093. //
  3094. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom
  3095. func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) {
  3096. op := &request.Operation{
  3097. Name: opGenerateRandom,
  3098. HTTPMethod: "POST",
  3099. HTTPPath: "/",
  3100. }
  3101. if input == nil {
  3102. input = &GenerateRandomInput{}
  3103. }
  3104. output = &GenerateRandomOutput{}
  3105. req = c.newRequest(op, input, output)
  3106. return
  3107. }
  3108. // GenerateRandom API operation for AWS Key Management Service.
  3109. //
  3110. // Returns a random byte string that is cryptographically secure.
  3111. //
  3112. // By default, the random byte string is generated in AWS KMS. To generate the
  3113. // byte string in the AWS CloudHSM cluster that is associated with a custom
  3114. // key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html),
  3115. // specify the custom key store ID.
  3116. //
  3117. // For more information about entropy and random number generation, see the
  3118. // AWS Key Management Service Cryptographic Details (https://d0.awsstatic.com/whitepapers/KMS-Cryptographic-Details.pdf)
  3119. // whitepaper.
  3120. //
  3121. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3122. // with awserr.Error's Code and Message methods to get detailed information about
  3123. // the error.
  3124. //
  3125. // See the AWS API reference guide for AWS Key Management Service's
  3126. // API operation GenerateRandom for usage and error information.
  3127. //
  3128. // Returned Error Types:
  3129. // * DependencyTimeoutException
  3130. // The system timed out while trying to fulfill the request. The request can
  3131. // be retried.
  3132. //
  3133. // * InternalException
  3134. // The request was rejected because an internal exception occurred. The request
  3135. // can be retried.
  3136. //
  3137. // * CustomKeyStoreNotFoundException
  3138. // The request was rejected because AWS KMS cannot find a custom key store with
  3139. // the specified key store name or ID.
  3140. //
  3141. // * CustomKeyStoreInvalidStateException
  3142. // The request was rejected because of the ConnectionState of the custom key
  3143. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  3144. // operation.
  3145. //
  3146. // This exception is thrown under the following conditions:
  3147. //
  3148. // * You requested the CreateKey or GenerateRandom operation in a custom
  3149. // key store that is not connected. These operations are valid only when
  3150. // the custom key store ConnectionState is CONNECTED.
  3151. //
  3152. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  3153. // on a custom key store that is not disconnected. This operation is valid
  3154. // only when the custom key store ConnectionState is DISCONNECTED.
  3155. //
  3156. // * You requested the ConnectCustomKeyStore operation on a custom key store
  3157. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  3158. // for all other ConnectionState values.
  3159. //
  3160. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom
  3161. func (c *KMS) GenerateRandom(input *GenerateRandomInput) (*GenerateRandomOutput, error) {
  3162. req, out := c.GenerateRandomRequest(input)
  3163. return out, req.Send()
  3164. }
  3165. // GenerateRandomWithContext is the same as GenerateRandom with the addition of
  3166. // the ability to pass a context and additional request options.
  3167. //
  3168. // See GenerateRandom for details on how to use this API operation.
  3169. //
  3170. // The context must be non-nil and will be used for request cancellation. If
  3171. // the context is nil a panic will occur. In the future the SDK may create
  3172. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3173. // for more information on using Contexts.
  3174. func (c *KMS) GenerateRandomWithContext(ctx aws.Context, input *GenerateRandomInput, opts ...request.Option) (*GenerateRandomOutput, error) {
  3175. req, out := c.GenerateRandomRequest(input)
  3176. req.SetContext(ctx)
  3177. req.ApplyOptions(opts...)
  3178. return out, req.Send()
  3179. }
  3180. const opGetKeyPolicy = "GetKeyPolicy"
  3181. // GetKeyPolicyRequest generates a "aws/request.Request" representing the
  3182. // client's request for the GetKeyPolicy operation. The "output" return
  3183. // value will be populated with the request's response once the request completes
  3184. // successfully.
  3185. //
  3186. // Use "Send" method on the returned Request to send the API call to the service.
  3187. // the "output" return value is not valid until after Send returns without error.
  3188. //
  3189. // See GetKeyPolicy for more information on using the GetKeyPolicy
  3190. // API call, and error handling.
  3191. //
  3192. // This method is useful when you want to inject custom logic or configuration
  3193. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3194. //
  3195. //
  3196. // // Example sending a request using the GetKeyPolicyRequest method.
  3197. // req, resp := client.GetKeyPolicyRequest(params)
  3198. //
  3199. // err := req.Send()
  3200. // if err == nil { // resp is now filled
  3201. // fmt.Println(resp)
  3202. // }
  3203. //
  3204. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy
  3205. func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) {
  3206. op := &request.Operation{
  3207. Name: opGetKeyPolicy,
  3208. HTTPMethod: "POST",
  3209. HTTPPath: "/",
  3210. }
  3211. if input == nil {
  3212. input = &GetKeyPolicyInput{}
  3213. }
  3214. output = &GetKeyPolicyOutput{}
  3215. req = c.newRequest(op, input, output)
  3216. return
  3217. }
  3218. // GetKeyPolicy API operation for AWS Key Management Service.
  3219. //
  3220. // Gets a key policy attached to the specified customer master key (CMK). You
  3221. // cannot perform this operation on a CMK in a different AWS account.
  3222. //
  3223. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3224. // with awserr.Error's Code and Message methods to get detailed information about
  3225. // the error.
  3226. //
  3227. // See the AWS API reference guide for AWS Key Management Service's
  3228. // API operation GetKeyPolicy for usage and error information.
  3229. //
  3230. // Returned Error Types:
  3231. // * NotFoundException
  3232. // The request was rejected because the specified entity or resource could not
  3233. // be found.
  3234. //
  3235. // * InvalidArnException
  3236. // The request was rejected because a specified ARN, or an ARN in a key policy,
  3237. // is not valid.
  3238. //
  3239. // * DependencyTimeoutException
  3240. // The system timed out while trying to fulfill the request. The request can
  3241. // be retried.
  3242. //
  3243. // * InternalException
  3244. // The request was rejected because an internal exception occurred. The request
  3245. // can be retried.
  3246. //
  3247. // * InvalidStateException
  3248. // The request was rejected because the state of the specified resource is not
  3249. // valid for this request.
  3250. //
  3251. // For more information about how key state affects the use of a CMK, see How
  3252. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3253. // in the AWS Key Management Service Developer Guide .
  3254. //
  3255. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy
  3256. func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) {
  3257. req, out := c.GetKeyPolicyRequest(input)
  3258. return out, req.Send()
  3259. }
  3260. // GetKeyPolicyWithContext is the same as GetKeyPolicy with the addition of
  3261. // the ability to pass a context and additional request options.
  3262. //
  3263. // See GetKeyPolicy for details on how to use this API operation.
  3264. //
  3265. // The context must be non-nil and will be used for request cancellation. If
  3266. // the context is nil a panic will occur. In the future the SDK may create
  3267. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3268. // for more information on using Contexts.
  3269. func (c *KMS) GetKeyPolicyWithContext(ctx aws.Context, input *GetKeyPolicyInput, opts ...request.Option) (*GetKeyPolicyOutput, error) {
  3270. req, out := c.GetKeyPolicyRequest(input)
  3271. req.SetContext(ctx)
  3272. req.ApplyOptions(opts...)
  3273. return out, req.Send()
  3274. }
  3275. const opGetKeyRotationStatus = "GetKeyRotationStatus"
  3276. // GetKeyRotationStatusRequest generates a "aws/request.Request" representing the
  3277. // client's request for the GetKeyRotationStatus operation. The "output" return
  3278. // value will be populated with the request's response once the request completes
  3279. // successfully.
  3280. //
  3281. // Use "Send" method on the returned Request to send the API call to the service.
  3282. // the "output" return value is not valid until after Send returns without error.
  3283. //
  3284. // See GetKeyRotationStatus for more information on using the GetKeyRotationStatus
  3285. // API call, and error handling.
  3286. //
  3287. // This method is useful when you want to inject custom logic or configuration
  3288. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3289. //
  3290. //
  3291. // // Example sending a request using the GetKeyRotationStatusRequest method.
  3292. // req, resp := client.GetKeyRotationStatusRequest(params)
  3293. //
  3294. // err := req.Send()
  3295. // if err == nil { // resp is now filled
  3296. // fmt.Println(resp)
  3297. // }
  3298. //
  3299. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus
  3300. func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req *request.Request, output *GetKeyRotationStatusOutput) {
  3301. op := &request.Operation{
  3302. Name: opGetKeyRotationStatus,
  3303. HTTPMethod: "POST",
  3304. HTTPPath: "/",
  3305. }
  3306. if input == nil {
  3307. input = &GetKeyRotationStatusInput{}
  3308. }
  3309. output = &GetKeyRotationStatusOutput{}
  3310. req = c.newRequest(op, input, output)
  3311. return
  3312. }
  3313. // GetKeyRotationStatus API operation for AWS Key Management Service.
  3314. //
  3315. // Gets a Boolean value that indicates whether automatic rotation of the key
  3316. // material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html)
  3317. // is enabled for the specified customer master key (CMK).
  3318. //
  3319. // You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported
  3320. // key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  3321. // The key rotation status for these CMKs is always false.
  3322. //
  3323. // The CMK that you use for this operation must be in a compatible key state.
  3324. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3325. // in the AWS Key Management Service Developer Guide.
  3326. //
  3327. // * Disabled: The key rotation status does not change when you disable a
  3328. // CMK. However, while the CMK is disabled, AWS KMS does not rotate the backing
  3329. // key.
  3330. //
  3331. // * Pending deletion: While a CMK is pending deletion, its key rotation
  3332. // status is false and AWS KMS does not rotate the backing key. If you cancel
  3333. // the deletion, the original key rotation status is restored.
  3334. //
  3335. // To perform this operation on a CMK in a different AWS account, specify the
  3336. // key ARN in the value of the KeyId parameter.
  3337. //
  3338. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3339. // with awserr.Error's Code and Message methods to get detailed information about
  3340. // the error.
  3341. //
  3342. // See the AWS API reference guide for AWS Key Management Service's
  3343. // API operation GetKeyRotationStatus for usage and error information.
  3344. //
  3345. // Returned Error Types:
  3346. // * NotFoundException
  3347. // The request was rejected because the specified entity or resource could not
  3348. // be found.
  3349. //
  3350. // * InvalidArnException
  3351. // The request was rejected because a specified ARN, or an ARN in a key policy,
  3352. // is not valid.
  3353. //
  3354. // * DependencyTimeoutException
  3355. // The system timed out while trying to fulfill the request. The request can
  3356. // be retried.
  3357. //
  3358. // * InternalException
  3359. // The request was rejected because an internal exception occurred. The request
  3360. // can be retried.
  3361. //
  3362. // * InvalidStateException
  3363. // The request was rejected because the state of the specified resource is not
  3364. // valid for this request.
  3365. //
  3366. // For more information about how key state affects the use of a CMK, see How
  3367. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3368. // in the AWS Key Management Service Developer Guide .
  3369. //
  3370. // * UnsupportedOperationException
  3371. // The request was rejected because a specified parameter is not supported or
  3372. // a specified resource is not valid for this operation.
  3373. //
  3374. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyRotationStatus
  3375. func (c *KMS) GetKeyRotationStatus(input *GetKeyRotationStatusInput) (*GetKeyRotationStatusOutput, error) {
  3376. req, out := c.GetKeyRotationStatusRequest(input)
  3377. return out, req.Send()
  3378. }
  3379. // GetKeyRotationStatusWithContext is the same as GetKeyRotationStatus with the addition of
  3380. // the ability to pass a context and additional request options.
  3381. //
  3382. // See GetKeyRotationStatus for details on how to use this API operation.
  3383. //
  3384. // The context must be non-nil and will be used for request cancellation. If
  3385. // the context is nil a panic will occur. In the future the SDK may create
  3386. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3387. // for more information on using Contexts.
  3388. func (c *KMS) GetKeyRotationStatusWithContext(ctx aws.Context, input *GetKeyRotationStatusInput, opts ...request.Option) (*GetKeyRotationStatusOutput, error) {
  3389. req, out := c.GetKeyRotationStatusRequest(input)
  3390. req.SetContext(ctx)
  3391. req.ApplyOptions(opts...)
  3392. return out, req.Send()
  3393. }
  3394. const opGetParametersForImport = "GetParametersForImport"
  3395. // GetParametersForImportRequest generates a "aws/request.Request" representing the
  3396. // client's request for the GetParametersForImport operation. The "output" return
  3397. // value will be populated with the request's response once the request completes
  3398. // successfully.
  3399. //
  3400. // Use "Send" method on the returned Request to send the API call to the service.
  3401. // the "output" return value is not valid until after Send returns without error.
  3402. //
  3403. // See GetParametersForImport for more information on using the GetParametersForImport
  3404. // API call, and error handling.
  3405. //
  3406. // This method is useful when you want to inject custom logic or configuration
  3407. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3408. //
  3409. //
  3410. // // Example sending a request using the GetParametersForImportRequest method.
  3411. // req, resp := client.GetParametersForImportRequest(params)
  3412. //
  3413. // err := req.Send()
  3414. // if err == nil { // resp is now filled
  3415. // fmt.Println(resp)
  3416. // }
  3417. //
  3418. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport
  3419. func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) (req *request.Request, output *GetParametersForImportOutput) {
  3420. op := &request.Operation{
  3421. Name: opGetParametersForImport,
  3422. HTTPMethod: "POST",
  3423. HTTPPath: "/",
  3424. }
  3425. if input == nil {
  3426. input = &GetParametersForImportInput{}
  3427. }
  3428. output = &GetParametersForImportOutput{}
  3429. req = c.newRequest(op, input, output)
  3430. return
  3431. }
  3432. // GetParametersForImport API operation for AWS Key Management Service.
  3433. //
  3434. // Returns the items you need to import key material into a symmetric, customer
  3435. // managed customer master key (CMK). For more information about importing key
  3436. // material into AWS KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  3437. // in the AWS Key Management Service Developer Guide.
  3438. //
  3439. // This operation returns a public key and an import token. Use the public key
  3440. // to encrypt the symmetric key material. Store the import token to send with
  3441. // a subsequent ImportKeyMaterial request.
  3442. //
  3443. // You must specify the key ID of the symmetric CMK into which you will import
  3444. // key material. This CMK's Origin must be EXTERNAL. You must also specify the
  3445. // wrapping algorithm and type of wrapping key (public key) that you will use
  3446. // to encrypt the key material. You cannot perform this operation on an asymmetric
  3447. // CMK or on any CMK in a different AWS account.
  3448. //
  3449. // To import key material, you must use the public key and import token from
  3450. // the same response. These items are valid for 24 hours. The expiration date
  3451. // and time appear in the GetParametersForImport response. You cannot use an
  3452. // expired token in an ImportKeyMaterial request. If your key and token expire,
  3453. // send another GetParametersForImport request.
  3454. //
  3455. // The CMK that you use for this operation must be in a compatible key state.
  3456. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3457. // in the AWS Key Management Service Developer Guide.
  3458. //
  3459. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3460. // with awserr.Error's Code and Message methods to get detailed information about
  3461. // the error.
  3462. //
  3463. // See the AWS API reference guide for AWS Key Management Service's
  3464. // API operation GetParametersForImport for usage and error information.
  3465. //
  3466. // Returned Error Types:
  3467. // * InvalidArnException
  3468. // The request was rejected because a specified ARN, or an ARN in a key policy,
  3469. // is not valid.
  3470. //
  3471. // * UnsupportedOperationException
  3472. // The request was rejected because a specified parameter is not supported or
  3473. // a specified resource is not valid for this operation.
  3474. //
  3475. // * DependencyTimeoutException
  3476. // The system timed out while trying to fulfill the request. The request can
  3477. // be retried.
  3478. //
  3479. // * NotFoundException
  3480. // The request was rejected because the specified entity or resource could not
  3481. // be found.
  3482. //
  3483. // * InternalException
  3484. // The request was rejected because an internal exception occurred. The request
  3485. // can be retried.
  3486. //
  3487. // * InvalidStateException
  3488. // The request was rejected because the state of the specified resource is not
  3489. // valid for this request.
  3490. //
  3491. // For more information about how key state affects the use of a CMK, see How
  3492. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3493. // in the AWS Key Management Service Developer Guide .
  3494. //
  3495. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport
  3496. func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) {
  3497. req, out := c.GetParametersForImportRequest(input)
  3498. return out, req.Send()
  3499. }
  3500. // GetParametersForImportWithContext is the same as GetParametersForImport with the addition of
  3501. // the ability to pass a context and additional request options.
  3502. //
  3503. // See GetParametersForImport for details on how to use this API operation.
  3504. //
  3505. // The context must be non-nil and will be used for request cancellation. If
  3506. // the context is nil a panic will occur. In the future the SDK may create
  3507. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3508. // for more information on using Contexts.
  3509. func (c *KMS) GetParametersForImportWithContext(ctx aws.Context, input *GetParametersForImportInput, opts ...request.Option) (*GetParametersForImportOutput, error) {
  3510. req, out := c.GetParametersForImportRequest(input)
  3511. req.SetContext(ctx)
  3512. req.ApplyOptions(opts...)
  3513. return out, req.Send()
  3514. }
  3515. const opGetPublicKey = "GetPublicKey"
  3516. // GetPublicKeyRequest generates a "aws/request.Request" representing the
  3517. // client's request for the GetPublicKey operation. The "output" return
  3518. // value will be populated with the request's response once the request completes
  3519. // successfully.
  3520. //
  3521. // Use "Send" method on the returned Request to send the API call to the service.
  3522. // the "output" return value is not valid until after Send returns without error.
  3523. //
  3524. // See GetPublicKey for more information on using the GetPublicKey
  3525. // API call, and error handling.
  3526. //
  3527. // This method is useful when you want to inject custom logic or configuration
  3528. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3529. //
  3530. //
  3531. // // Example sending a request using the GetPublicKeyRequest method.
  3532. // req, resp := client.GetPublicKeyRequest(params)
  3533. //
  3534. // err := req.Send()
  3535. // if err == nil { // resp is now filled
  3536. // fmt.Println(resp)
  3537. // }
  3538. //
  3539. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey
  3540. func (c *KMS) GetPublicKeyRequest(input *GetPublicKeyInput) (req *request.Request, output *GetPublicKeyOutput) {
  3541. op := &request.Operation{
  3542. Name: opGetPublicKey,
  3543. HTTPMethod: "POST",
  3544. HTTPPath: "/",
  3545. }
  3546. if input == nil {
  3547. input = &GetPublicKeyInput{}
  3548. }
  3549. output = &GetPublicKeyOutput{}
  3550. req = c.newRequest(op, input, output)
  3551. return
  3552. }
  3553. // GetPublicKey API operation for AWS Key Management Service.
  3554. //
  3555. // Returns the public key of an asymmetric CMK. Unlike the private key of a
  3556. // asymmetric CMK, which never leaves AWS KMS unencrypted, callers with kms:GetPublicKey
  3557. // permission can download the public key of an asymmetric CMK. You can share
  3558. // the public key to allow others to encrypt messages and verify signatures
  3559. // outside of AWS KMS. For information about symmetric and asymmetric CMKs,
  3560. // see Using Symmetric and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
  3561. // in the AWS Key Management Service Developer Guide.
  3562. //
  3563. // You do not need to download the public key. Instead, you can use the public
  3564. // key within AWS KMS by calling the Encrypt, ReEncrypt, or Verify operations
  3565. // with the identifier of an asymmetric CMK. When you use the public key within
  3566. // AWS KMS, you benefit from the authentication, authorization, and logging
  3567. // that are part of every AWS KMS operation. You also reduce of risk of encrypting
  3568. // data that cannot be decrypted. These features are not effective outside of
  3569. // AWS KMS. For details, see Special Considerations for Downloading Public Keys
  3570. // (https://docs.aws.amazon.com/kms/latest/developerguide/download-public-key.html#download-public-key-considerations).
  3571. //
  3572. // To help you use the public key safely outside of AWS KMS, GetPublicKey returns
  3573. // important information about the public key in the response, including:
  3574. //
  3575. // * CustomerMasterKeySpec (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-CustomerMasterKeySpec):
  3576. // The type of key material in the public key, such as RSA_4096 or ECC_NIST_P521.
  3577. //
  3578. // * KeyUsage (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage):
  3579. // Whether the key is used for encryption or signing.
  3580. //
  3581. // * EncryptionAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms)
  3582. // or SigningAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-SigningAlgorithms):
  3583. // A list of the encryption algorithms or the signing algorithms for the
  3584. // key.
  3585. //
  3586. // Although AWS KMS cannot enforce these restrictions on external operations,
  3587. // it is crucial that you use this information to prevent the public key from
  3588. // being used improperly. For example, you can prevent a public signing key
  3589. // from being used encrypt data, or prevent a public key from being used with
  3590. // an encryption algorithm that is not supported by AWS KMS. You can also avoid
  3591. // errors, such as using the wrong signing algorithm in a verification operation.
  3592. //
  3593. // The CMK that you use for this operation must be in a compatible key state.
  3594. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3595. // in the AWS Key Management Service Developer Guide.
  3596. //
  3597. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3598. // with awserr.Error's Code and Message methods to get detailed information about
  3599. // the error.
  3600. //
  3601. // See the AWS API reference guide for AWS Key Management Service's
  3602. // API operation GetPublicKey for usage and error information.
  3603. //
  3604. // Returned Error Types:
  3605. // * NotFoundException
  3606. // The request was rejected because the specified entity or resource could not
  3607. // be found.
  3608. //
  3609. // * DisabledException
  3610. // The request was rejected because the specified CMK is not enabled.
  3611. //
  3612. // * KeyUnavailableException
  3613. // The request was rejected because the specified CMK was not available. You
  3614. // can retry the request.
  3615. //
  3616. // * DependencyTimeoutException
  3617. // The system timed out while trying to fulfill the request. The request can
  3618. // be retried.
  3619. //
  3620. // * UnsupportedOperationException
  3621. // The request was rejected because a specified parameter is not supported or
  3622. // a specified resource is not valid for this operation.
  3623. //
  3624. // * InvalidArnException
  3625. // The request was rejected because a specified ARN, or an ARN in a key policy,
  3626. // is not valid.
  3627. //
  3628. // * InvalidGrantTokenException
  3629. // The request was rejected because the specified grant token is not valid.
  3630. //
  3631. // * InvalidKeyUsageException
  3632. // The request was rejected for one of the following reasons:
  3633. //
  3634. // * The KeyUsage value of the CMK is incompatible with the API operation.
  3635. //
  3636. // * The encryption algorithm or signing algorithm specified for the operation
  3637. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  3638. //
  3639. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  3640. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  3641. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  3642. //
  3643. // To find the encryption or signing algorithms supported for a particular CMK,
  3644. // use the DescribeKey operation.
  3645. //
  3646. // * InternalException
  3647. // The request was rejected because an internal exception occurred. The request
  3648. // can be retried.
  3649. //
  3650. // * InvalidStateException
  3651. // The request was rejected because the state of the specified resource is not
  3652. // valid for this request.
  3653. //
  3654. // For more information about how key state affects the use of a CMK, see How
  3655. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3656. // in the AWS Key Management Service Developer Guide .
  3657. //
  3658. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey
  3659. func (c *KMS) GetPublicKey(input *GetPublicKeyInput) (*GetPublicKeyOutput, error) {
  3660. req, out := c.GetPublicKeyRequest(input)
  3661. return out, req.Send()
  3662. }
  3663. // GetPublicKeyWithContext is the same as GetPublicKey with the addition of
  3664. // the ability to pass a context and additional request options.
  3665. //
  3666. // See GetPublicKey for details on how to use this API operation.
  3667. //
  3668. // The context must be non-nil and will be used for request cancellation. If
  3669. // the context is nil a panic will occur. In the future the SDK may create
  3670. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3671. // for more information on using Contexts.
  3672. func (c *KMS) GetPublicKeyWithContext(ctx aws.Context, input *GetPublicKeyInput, opts ...request.Option) (*GetPublicKeyOutput, error) {
  3673. req, out := c.GetPublicKeyRequest(input)
  3674. req.SetContext(ctx)
  3675. req.ApplyOptions(opts...)
  3676. return out, req.Send()
  3677. }
  3678. const opImportKeyMaterial = "ImportKeyMaterial"
  3679. // ImportKeyMaterialRequest generates a "aws/request.Request" representing the
  3680. // client's request for the ImportKeyMaterial operation. The "output" return
  3681. // value will be populated with the request's response once the request completes
  3682. // successfully.
  3683. //
  3684. // Use "Send" method on the returned Request to send the API call to the service.
  3685. // the "output" return value is not valid until after Send returns without error.
  3686. //
  3687. // See ImportKeyMaterial for more information on using the ImportKeyMaterial
  3688. // API call, and error handling.
  3689. //
  3690. // This method is useful when you want to inject custom logic or configuration
  3691. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3692. //
  3693. //
  3694. // // Example sending a request using the ImportKeyMaterialRequest method.
  3695. // req, resp := client.ImportKeyMaterialRequest(params)
  3696. //
  3697. // err := req.Send()
  3698. // if err == nil { // resp is now filled
  3699. // fmt.Println(resp)
  3700. // }
  3701. //
  3702. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial
  3703. func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *request.Request, output *ImportKeyMaterialOutput) {
  3704. op := &request.Operation{
  3705. Name: opImportKeyMaterial,
  3706. HTTPMethod: "POST",
  3707. HTTPPath: "/",
  3708. }
  3709. if input == nil {
  3710. input = &ImportKeyMaterialInput{}
  3711. }
  3712. output = &ImportKeyMaterialOutput{}
  3713. req = c.newRequest(op, input, output)
  3714. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  3715. return
  3716. }
  3717. // ImportKeyMaterial API operation for AWS Key Management Service.
  3718. //
  3719. // Imports key material into an existing symmetric AWS KMS customer master key
  3720. // (CMK) that was created without key material. After you successfully import
  3721. // key material into a CMK, you can reimport the same key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material)
  3722. // into that CMK, but you cannot import different key material.
  3723. //
  3724. // You cannot perform this operation on an asymmetric CMK or on any CMK in a
  3725. // different AWS account. For more information about creating CMKs with no key
  3726. // material and then importing key material, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  3727. // in the AWS Key Management Service Developer Guide.
  3728. //
  3729. // Before using this operation, call GetParametersForImport. Its response includes
  3730. // a public key and an import token. Use the public key to encrypt the key material.
  3731. // Then, submit the import token from the same GetParametersForImport response.
  3732. //
  3733. // When calling this operation, you must specify the following values:
  3734. //
  3735. // * The key ID or key ARN of a CMK with no key material. Its Origin must
  3736. // be EXTERNAL. To create a CMK with no key material, call CreateKey and
  3737. // set the value of its Origin parameter to EXTERNAL. To get the Origin of
  3738. // a CMK, call DescribeKey.)
  3739. //
  3740. // * The encrypted key material. To get the public key to encrypt the key
  3741. // material, call GetParametersForImport.
  3742. //
  3743. // * The import token that GetParametersForImport returned. You must use
  3744. // a public key and token from the same GetParametersForImport response.
  3745. //
  3746. // * Whether the key material expires and if so, when. If you set an expiration
  3747. // date, AWS KMS deletes the key material from the CMK on the specified date,
  3748. // and the CMK becomes unusable. To use the CMK again, you must reimport
  3749. // the same key material. The only way to change an expiration date is by
  3750. // reimporting the same key material and specifying a new expiration date.
  3751. //
  3752. // When this operation is successful, the key state of the CMK changes from
  3753. // PendingImport to Enabled, and you can use the CMK.
  3754. //
  3755. // If this operation fails, use the exception to help determine the problem.
  3756. // If the error is related to the key material, the import token, or wrapping
  3757. // key, use GetParametersForImport to get a new public key and import token
  3758. // for the CMK and repeat the import procedure. For help, see How To Import
  3759. // Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-overview)
  3760. // in the AWS Key Management Service Developer Guide.
  3761. //
  3762. // The CMK that you use for this operation must be in a compatible key state.
  3763. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3764. // in the AWS Key Management Service Developer Guide.
  3765. //
  3766. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3767. // with awserr.Error's Code and Message methods to get detailed information about
  3768. // the error.
  3769. //
  3770. // See the AWS API reference guide for AWS Key Management Service's
  3771. // API operation ImportKeyMaterial for usage and error information.
  3772. //
  3773. // Returned Error Types:
  3774. // * InvalidArnException
  3775. // The request was rejected because a specified ARN, or an ARN in a key policy,
  3776. // is not valid.
  3777. //
  3778. // * UnsupportedOperationException
  3779. // The request was rejected because a specified parameter is not supported or
  3780. // a specified resource is not valid for this operation.
  3781. //
  3782. // * DependencyTimeoutException
  3783. // The system timed out while trying to fulfill the request. The request can
  3784. // be retried.
  3785. //
  3786. // * NotFoundException
  3787. // The request was rejected because the specified entity or resource could not
  3788. // be found.
  3789. //
  3790. // * InternalException
  3791. // The request was rejected because an internal exception occurred. The request
  3792. // can be retried.
  3793. //
  3794. // * InvalidStateException
  3795. // The request was rejected because the state of the specified resource is not
  3796. // valid for this request.
  3797. //
  3798. // For more information about how key state affects the use of a CMK, see How
  3799. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  3800. // in the AWS Key Management Service Developer Guide .
  3801. //
  3802. // * InvalidCiphertextException
  3803. // From the Decrypt or ReEncrypt operation, the request was rejected because
  3804. // the specified ciphertext, or additional authenticated data incorporated into
  3805. // the ciphertext, such as the encryption context, is corrupted, missing, or
  3806. // otherwise invalid.
  3807. //
  3808. // From the ImportKeyMaterial operation, the request was rejected because AWS
  3809. // KMS could not decrypt the encrypted (wrapped) key material.
  3810. //
  3811. // * IncorrectKeyMaterialException
  3812. // The request was rejected because the key material in the request is, expired,
  3813. // invalid, or is not the same key material that was previously imported into
  3814. // this customer master key (CMK).
  3815. //
  3816. // * ExpiredImportTokenException
  3817. // The request was rejected because the specified import token is expired. Use
  3818. // GetParametersForImport to get a new import token and public key, use the
  3819. // new public key to encrypt the key material, and then try the request again.
  3820. //
  3821. // * InvalidImportTokenException
  3822. // The request was rejected because the provided import token is invalid or
  3823. // is associated with a different customer master key (CMK).
  3824. //
  3825. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial
  3826. func (c *KMS) ImportKeyMaterial(input *ImportKeyMaterialInput) (*ImportKeyMaterialOutput, error) {
  3827. req, out := c.ImportKeyMaterialRequest(input)
  3828. return out, req.Send()
  3829. }
  3830. // ImportKeyMaterialWithContext is the same as ImportKeyMaterial with the addition of
  3831. // the ability to pass a context and additional request options.
  3832. //
  3833. // See ImportKeyMaterial for details on how to use this API operation.
  3834. //
  3835. // The context must be non-nil and will be used for request cancellation. If
  3836. // the context is nil a panic will occur. In the future the SDK may create
  3837. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3838. // for more information on using Contexts.
  3839. func (c *KMS) ImportKeyMaterialWithContext(ctx aws.Context, input *ImportKeyMaterialInput, opts ...request.Option) (*ImportKeyMaterialOutput, error) {
  3840. req, out := c.ImportKeyMaterialRequest(input)
  3841. req.SetContext(ctx)
  3842. req.ApplyOptions(opts...)
  3843. return out, req.Send()
  3844. }
  3845. const opListAliases = "ListAliases"
  3846. // ListAliasesRequest generates a "aws/request.Request" representing the
  3847. // client's request for the ListAliases operation. The "output" return
  3848. // value will be populated with the request's response once the request completes
  3849. // successfully.
  3850. //
  3851. // Use "Send" method on the returned Request to send the API call to the service.
  3852. // the "output" return value is not valid until after Send returns without error.
  3853. //
  3854. // See ListAliases for more information on using the ListAliases
  3855. // API call, and error handling.
  3856. //
  3857. // This method is useful when you want to inject custom logic or configuration
  3858. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  3859. //
  3860. //
  3861. // // Example sending a request using the ListAliasesRequest method.
  3862. // req, resp := client.ListAliasesRequest(params)
  3863. //
  3864. // err := req.Send()
  3865. // if err == nil { // resp is now filled
  3866. // fmt.Println(resp)
  3867. // }
  3868. //
  3869. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases
  3870. func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) {
  3871. op := &request.Operation{
  3872. Name: opListAliases,
  3873. HTTPMethod: "POST",
  3874. HTTPPath: "/",
  3875. Paginator: &request.Paginator{
  3876. InputTokens: []string{"Marker"},
  3877. OutputTokens: []string{"NextMarker"},
  3878. LimitToken: "Limit",
  3879. TruncationToken: "Truncated",
  3880. },
  3881. }
  3882. if input == nil {
  3883. input = &ListAliasesInput{}
  3884. }
  3885. output = &ListAliasesOutput{}
  3886. req = c.newRequest(op, input, output)
  3887. return
  3888. }
  3889. // ListAliases API operation for AWS Key Management Service.
  3890. //
  3891. // Gets a list of aliases in the caller's AWS account and region. You cannot
  3892. // list aliases in other accounts. For more information about aliases, see CreateAlias.
  3893. //
  3894. // By default, the ListAliases command returns all aliases in the account and
  3895. // region. To get only the aliases that point to a particular customer master
  3896. // key (CMK), use the KeyId parameter.
  3897. //
  3898. // The ListAliases response can include aliases that you created and associated
  3899. // with your customer managed CMKs, and aliases that AWS created and associated
  3900. // with AWS managed CMKs in your account. You can recognize AWS aliases because
  3901. // their names have the format aws/<service-name>, such as aws/dynamodb.
  3902. //
  3903. // The response might also include aliases that have no TargetKeyId field. These
  3904. // are predefined aliases that AWS has created but has not yet associated with
  3905. // a CMK. Aliases that AWS creates in your account, including predefined aliases,
  3906. // do not count against your AWS KMS aliases limit (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit).
  3907. //
  3908. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  3909. // with awserr.Error's Code and Message methods to get detailed information about
  3910. // the error.
  3911. //
  3912. // See the AWS API reference guide for AWS Key Management Service's
  3913. // API operation ListAliases for usage and error information.
  3914. //
  3915. // Returned Error Types:
  3916. // * DependencyTimeoutException
  3917. // The system timed out while trying to fulfill the request. The request can
  3918. // be retried.
  3919. //
  3920. // * InvalidMarkerException
  3921. // The request was rejected because the marker that specifies where pagination
  3922. // should next begin is not valid.
  3923. //
  3924. // * InternalException
  3925. // The request was rejected because an internal exception occurred. The request
  3926. // can be retried.
  3927. //
  3928. // * InvalidArnException
  3929. // The request was rejected because a specified ARN, or an ARN in a key policy,
  3930. // is not valid.
  3931. //
  3932. // * NotFoundException
  3933. // The request was rejected because the specified entity or resource could not
  3934. // be found.
  3935. //
  3936. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListAliases
  3937. func (c *KMS) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) {
  3938. req, out := c.ListAliasesRequest(input)
  3939. return out, req.Send()
  3940. }
  3941. // ListAliasesWithContext is the same as ListAliases with the addition of
  3942. // the ability to pass a context and additional request options.
  3943. //
  3944. // See ListAliases for details on how to use this API operation.
  3945. //
  3946. // The context must be non-nil and will be used for request cancellation. If
  3947. // the context is nil a panic will occur. In the future the SDK may create
  3948. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3949. // for more information on using Contexts.
  3950. func (c *KMS) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) {
  3951. req, out := c.ListAliasesRequest(input)
  3952. req.SetContext(ctx)
  3953. req.ApplyOptions(opts...)
  3954. return out, req.Send()
  3955. }
  3956. // ListAliasesPages iterates over the pages of a ListAliases operation,
  3957. // calling the "fn" function with the response data for each page. To stop
  3958. // iterating, return false from the fn function.
  3959. //
  3960. // See ListAliases method for more information on how to use this operation.
  3961. //
  3962. // Note: This operation can generate multiple requests to a service.
  3963. //
  3964. // // Example iterating over at most 3 pages of a ListAliases operation.
  3965. // pageNum := 0
  3966. // err := client.ListAliasesPages(params,
  3967. // func(page *kms.ListAliasesOutput, lastPage bool) bool {
  3968. // pageNum++
  3969. // fmt.Println(page)
  3970. // return pageNum <= 3
  3971. // })
  3972. //
  3973. func (c *KMS) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error {
  3974. return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn)
  3975. }
  3976. // ListAliasesPagesWithContext same as ListAliasesPages except
  3977. // it takes a Context and allows setting request options on the pages.
  3978. //
  3979. // The context must be non-nil and will be used for request cancellation. If
  3980. // the context is nil a panic will occur. In the future the SDK may create
  3981. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  3982. // for more information on using Contexts.
  3983. func (c *KMS) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...request.Option) error {
  3984. p := request.Pagination{
  3985. NewRequest: func() (*request.Request, error) {
  3986. var inCpy *ListAliasesInput
  3987. if input != nil {
  3988. tmp := *input
  3989. inCpy = &tmp
  3990. }
  3991. req, _ := c.ListAliasesRequest(inCpy)
  3992. req.SetContext(ctx)
  3993. req.ApplyOptions(opts...)
  3994. return req, nil
  3995. },
  3996. }
  3997. for p.Next() {
  3998. if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) {
  3999. break
  4000. }
  4001. }
  4002. return p.Err()
  4003. }
  4004. const opListGrants = "ListGrants"
  4005. // ListGrantsRequest generates a "aws/request.Request" representing the
  4006. // client's request for the ListGrants operation. The "output" return
  4007. // value will be populated with the request's response once the request completes
  4008. // successfully.
  4009. //
  4010. // Use "Send" method on the returned Request to send the API call to the service.
  4011. // the "output" return value is not valid until after Send returns without error.
  4012. //
  4013. // See ListGrants for more information on using the ListGrants
  4014. // API call, and error handling.
  4015. //
  4016. // This method is useful when you want to inject custom logic or configuration
  4017. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4018. //
  4019. //
  4020. // // Example sending a request using the ListGrantsRequest method.
  4021. // req, resp := client.ListGrantsRequest(params)
  4022. //
  4023. // err := req.Send()
  4024. // if err == nil { // resp is now filled
  4025. // fmt.Println(resp)
  4026. // }
  4027. //
  4028. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants
  4029. func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, output *ListGrantsResponse) {
  4030. op := &request.Operation{
  4031. Name: opListGrants,
  4032. HTTPMethod: "POST",
  4033. HTTPPath: "/",
  4034. Paginator: &request.Paginator{
  4035. InputTokens: []string{"Marker"},
  4036. OutputTokens: []string{"NextMarker"},
  4037. LimitToken: "Limit",
  4038. TruncationToken: "Truncated",
  4039. },
  4040. }
  4041. if input == nil {
  4042. input = &ListGrantsInput{}
  4043. }
  4044. output = &ListGrantsResponse{}
  4045. req = c.newRequest(op, input, output)
  4046. return
  4047. }
  4048. // ListGrants API operation for AWS Key Management Service.
  4049. //
  4050. // Gets a list of all grants for the specified customer master key (CMK).
  4051. //
  4052. // To perform this operation on a CMK in a different AWS account, specify the
  4053. // key ARN in the value of the KeyId parameter.
  4054. //
  4055. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4056. // with awserr.Error's Code and Message methods to get detailed information about
  4057. // the error.
  4058. //
  4059. // See the AWS API reference guide for AWS Key Management Service's
  4060. // API operation ListGrants for usage and error information.
  4061. //
  4062. // Returned Error Types:
  4063. // * NotFoundException
  4064. // The request was rejected because the specified entity or resource could not
  4065. // be found.
  4066. //
  4067. // * DependencyTimeoutException
  4068. // The system timed out while trying to fulfill the request. The request can
  4069. // be retried.
  4070. //
  4071. // * InvalidMarkerException
  4072. // The request was rejected because the marker that specifies where pagination
  4073. // should next begin is not valid.
  4074. //
  4075. // * InvalidArnException
  4076. // The request was rejected because a specified ARN, or an ARN in a key policy,
  4077. // is not valid.
  4078. //
  4079. // * InternalException
  4080. // The request was rejected because an internal exception occurred. The request
  4081. // can be retried.
  4082. //
  4083. // * InvalidStateException
  4084. // The request was rejected because the state of the specified resource is not
  4085. // valid for this request.
  4086. //
  4087. // For more information about how key state affects the use of a CMK, see How
  4088. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  4089. // in the AWS Key Management Service Developer Guide .
  4090. //
  4091. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants
  4092. func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) {
  4093. req, out := c.ListGrantsRequest(input)
  4094. return out, req.Send()
  4095. }
  4096. // ListGrantsWithContext is the same as ListGrants with the addition of
  4097. // the ability to pass a context and additional request options.
  4098. //
  4099. // See ListGrants for details on how to use this API operation.
  4100. //
  4101. // The context must be non-nil and will be used for request cancellation. If
  4102. // the context is nil a panic will occur. In the future the SDK may create
  4103. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4104. // for more information on using Contexts.
  4105. func (c *KMS) ListGrantsWithContext(ctx aws.Context, input *ListGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) {
  4106. req, out := c.ListGrantsRequest(input)
  4107. req.SetContext(ctx)
  4108. req.ApplyOptions(opts...)
  4109. return out, req.Send()
  4110. }
  4111. // ListGrantsPages iterates over the pages of a ListGrants operation,
  4112. // calling the "fn" function with the response data for each page. To stop
  4113. // iterating, return false from the fn function.
  4114. //
  4115. // See ListGrants method for more information on how to use this operation.
  4116. //
  4117. // Note: This operation can generate multiple requests to a service.
  4118. //
  4119. // // Example iterating over at most 3 pages of a ListGrants operation.
  4120. // pageNum := 0
  4121. // err := client.ListGrantsPages(params,
  4122. // func(page *kms.ListGrantsResponse, lastPage bool) bool {
  4123. // pageNum++
  4124. // fmt.Println(page)
  4125. // return pageNum <= 3
  4126. // })
  4127. //
  4128. func (c *KMS) ListGrantsPages(input *ListGrantsInput, fn func(*ListGrantsResponse, bool) bool) error {
  4129. return c.ListGrantsPagesWithContext(aws.BackgroundContext(), input, fn)
  4130. }
  4131. // ListGrantsPagesWithContext same as ListGrantsPages except
  4132. // it takes a Context and allows setting request options on the pages.
  4133. //
  4134. // The context must be non-nil and will be used for request cancellation. If
  4135. // the context is nil a panic will occur. In the future the SDK may create
  4136. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4137. // for more information on using Contexts.
  4138. func (c *KMS) ListGrantsPagesWithContext(ctx aws.Context, input *ListGrantsInput, fn func(*ListGrantsResponse, bool) bool, opts ...request.Option) error {
  4139. p := request.Pagination{
  4140. NewRequest: func() (*request.Request, error) {
  4141. var inCpy *ListGrantsInput
  4142. if input != nil {
  4143. tmp := *input
  4144. inCpy = &tmp
  4145. }
  4146. req, _ := c.ListGrantsRequest(inCpy)
  4147. req.SetContext(ctx)
  4148. req.ApplyOptions(opts...)
  4149. return req, nil
  4150. },
  4151. }
  4152. for p.Next() {
  4153. if !fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) {
  4154. break
  4155. }
  4156. }
  4157. return p.Err()
  4158. }
  4159. const opListKeyPolicies = "ListKeyPolicies"
  4160. // ListKeyPoliciesRequest generates a "aws/request.Request" representing the
  4161. // client's request for the ListKeyPolicies operation. The "output" return
  4162. // value will be populated with the request's response once the request completes
  4163. // successfully.
  4164. //
  4165. // Use "Send" method on the returned Request to send the API call to the service.
  4166. // the "output" return value is not valid until after Send returns without error.
  4167. //
  4168. // See ListKeyPolicies for more information on using the ListKeyPolicies
  4169. // API call, and error handling.
  4170. //
  4171. // This method is useful when you want to inject custom logic or configuration
  4172. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4173. //
  4174. //
  4175. // // Example sending a request using the ListKeyPoliciesRequest method.
  4176. // req, resp := client.ListKeyPoliciesRequest(params)
  4177. //
  4178. // err := req.Send()
  4179. // if err == nil { // resp is now filled
  4180. // fmt.Println(resp)
  4181. // }
  4182. //
  4183. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies
  4184. func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request.Request, output *ListKeyPoliciesOutput) {
  4185. op := &request.Operation{
  4186. Name: opListKeyPolicies,
  4187. HTTPMethod: "POST",
  4188. HTTPPath: "/",
  4189. Paginator: &request.Paginator{
  4190. InputTokens: []string{"Marker"},
  4191. OutputTokens: []string{"NextMarker"},
  4192. LimitToken: "Limit",
  4193. TruncationToken: "Truncated",
  4194. },
  4195. }
  4196. if input == nil {
  4197. input = &ListKeyPoliciesInput{}
  4198. }
  4199. output = &ListKeyPoliciesOutput{}
  4200. req = c.newRequest(op, input, output)
  4201. return
  4202. }
  4203. // ListKeyPolicies API operation for AWS Key Management Service.
  4204. //
  4205. // Gets the names of the key policies that are attached to a customer master
  4206. // key (CMK). This operation is designed to get policy names that you can use
  4207. // in a GetKeyPolicy operation. However, the only valid policy name is default.
  4208. // You cannot perform this operation on a CMK in a different AWS account.
  4209. //
  4210. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4211. // with awserr.Error's Code and Message methods to get detailed information about
  4212. // the error.
  4213. //
  4214. // See the AWS API reference guide for AWS Key Management Service's
  4215. // API operation ListKeyPolicies for usage and error information.
  4216. //
  4217. // Returned Error Types:
  4218. // * NotFoundException
  4219. // The request was rejected because the specified entity or resource could not
  4220. // be found.
  4221. //
  4222. // * InvalidArnException
  4223. // The request was rejected because a specified ARN, or an ARN in a key policy,
  4224. // is not valid.
  4225. //
  4226. // * DependencyTimeoutException
  4227. // The system timed out while trying to fulfill the request. The request can
  4228. // be retried.
  4229. //
  4230. // * InternalException
  4231. // The request was rejected because an internal exception occurred. The request
  4232. // can be retried.
  4233. //
  4234. // * InvalidStateException
  4235. // The request was rejected because the state of the specified resource is not
  4236. // valid for this request.
  4237. //
  4238. // For more information about how key state affects the use of a CMK, see How
  4239. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  4240. // in the AWS Key Management Service Developer Guide .
  4241. //
  4242. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies
  4243. func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) {
  4244. req, out := c.ListKeyPoliciesRequest(input)
  4245. return out, req.Send()
  4246. }
  4247. // ListKeyPoliciesWithContext is the same as ListKeyPolicies with the addition of
  4248. // the ability to pass a context and additional request options.
  4249. //
  4250. // See ListKeyPolicies for details on how to use this API operation.
  4251. //
  4252. // The context must be non-nil and will be used for request cancellation. If
  4253. // the context is nil a panic will occur. In the future the SDK may create
  4254. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4255. // for more information on using Contexts.
  4256. func (c *KMS) ListKeyPoliciesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, opts ...request.Option) (*ListKeyPoliciesOutput, error) {
  4257. req, out := c.ListKeyPoliciesRequest(input)
  4258. req.SetContext(ctx)
  4259. req.ApplyOptions(opts...)
  4260. return out, req.Send()
  4261. }
  4262. // ListKeyPoliciesPages iterates over the pages of a ListKeyPolicies operation,
  4263. // calling the "fn" function with the response data for each page. To stop
  4264. // iterating, return false from the fn function.
  4265. //
  4266. // See ListKeyPolicies method for more information on how to use this operation.
  4267. //
  4268. // Note: This operation can generate multiple requests to a service.
  4269. //
  4270. // // Example iterating over at most 3 pages of a ListKeyPolicies operation.
  4271. // pageNum := 0
  4272. // err := client.ListKeyPoliciesPages(params,
  4273. // func(page *kms.ListKeyPoliciesOutput, lastPage bool) bool {
  4274. // pageNum++
  4275. // fmt.Println(page)
  4276. // return pageNum <= 3
  4277. // })
  4278. //
  4279. func (c *KMS) ListKeyPoliciesPages(input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool) error {
  4280. return c.ListKeyPoliciesPagesWithContext(aws.BackgroundContext(), input, fn)
  4281. }
  4282. // ListKeyPoliciesPagesWithContext same as ListKeyPoliciesPages except
  4283. // it takes a Context and allows setting request options on the pages.
  4284. //
  4285. // The context must be non-nil and will be used for request cancellation. If
  4286. // the context is nil a panic will occur. In the future the SDK may create
  4287. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4288. // for more information on using Contexts.
  4289. func (c *KMS) ListKeyPoliciesPagesWithContext(ctx aws.Context, input *ListKeyPoliciesInput, fn func(*ListKeyPoliciesOutput, bool) bool, opts ...request.Option) error {
  4290. p := request.Pagination{
  4291. NewRequest: func() (*request.Request, error) {
  4292. var inCpy *ListKeyPoliciesInput
  4293. if input != nil {
  4294. tmp := *input
  4295. inCpy = &tmp
  4296. }
  4297. req, _ := c.ListKeyPoliciesRequest(inCpy)
  4298. req.SetContext(ctx)
  4299. req.ApplyOptions(opts...)
  4300. return req, nil
  4301. },
  4302. }
  4303. for p.Next() {
  4304. if !fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) {
  4305. break
  4306. }
  4307. }
  4308. return p.Err()
  4309. }
  4310. const opListKeys = "ListKeys"
  4311. // ListKeysRequest generates a "aws/request.Request" representing the
  4312. // client's request for the ListKeys operation. The "output" return
  4313. // value will be populated with the request's response once the request completes
  4314. // successfully.
  4315. //
  4316. // Use "Send" method on the returned Request to send the API call to the service.
  4317. // the "output" return value is not valid until after Send returns without error.
  4318. //
  4319. // See ListKeys for more information on using the ListKeys
  4320. // API call, and error handling.
  4321. //
  4322. // This method is useful when you want to inject custom logic or configuration
  4323. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4324. //
  4325. //
  4326. // // Example sending a request using the ListKeysRequest method.
  4327. // req, resp := client.ListKeysRequest(params)
  4328. //
  4329. // err := req.Send()
  4330. // if err == nil { // resp is now filled
  4331. // fmt.Println(resp)
  4332. // }
  4333. //
  4334. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys
  4335. func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, output *ListKeysOutput) {
  4336. op := &request.Operation{
  4337. Name: opListKeys,
  4338. HTTPMethod: "POST",
  4339. HTTPPath: "/",
  4340. Paginator: &request.Paginator{
  4341. InputTokens: []string{"Marker"},
  4342. OutputTokens: []string{"NextMarker"},
  4343. LimitToken: "Limit",
  4344. TruncationToken: "Truncated",
  4345. },
  4346. }
  4347. if input == nil {
  4348. input = &ListKeysInput{}
  4349. }
  4350. output = &ListKeysOutput{}
  4351. req = c.newRequest(op, input, output)
  4352. return
  4353. }
  4354. // ListKeys API operation for AWS Key Management Service.
  4355. //
  4356. // Gets a list of all customer master keys (CMKs) in the caller's AWS account
  4357. // and Region.
  4358. //
  4359. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4360. // with awserr.Error's Code and Message methods to get detailed information about
  4361. // the error.
  4362. //
  4363. // See the AWS API reference guide for AWS Key Management Service's
  4364. // API operation ListKeys for usage and error information.
  4365. //
  4366. // Returned Error Types:
  4367. // * DependencyTimeoutException
  4368. // The system timed out while trying to fulfill the request. The request can
  4369. // be retried.
  4370. //
  4371. // * InternalException
  4372. // The request was rejected because an internal exception occurred. The request
  4373. // can be retried.
  4374. //
  4375. // * InvalidMarkerException
  4376. // The request was rejected because the marker that specifies where pagination
  4377. // should next begin is not valid.
  4378. //
  4379. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeys
  4380. func (c *KMS) ListKeys(input *ListKeysInput) (*ListKeysOutput, error) {
  4381. req, out := c.ListKeysRequest(input)
  4382. return out, req.Send()
  4383. }
  4384. // ListKeysWithContext is the same as ListKeys with the addition of
  4385. // the ability to pass a context and additional request options.
  4386. //
  4387. // See ListKeys for details on how to use this API operation.
  4388. //
  4389. // The context must be non-nil and will be used for request cancellation. If
  4390. // the context is nil a panic will occur. In the future the SDK may create
  4391. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4392. // for more information on using Contexts.
  4393. func (c *KMS) ListKeysWithContext(ctx aws.Context, input *ListKeysInput, opts ...request.Option) (*ListKeysOutput, error) {
  4394. req, out := c.ListKeysRequest(input)
  4395. req.SetContext(ctx)
  4396. req.ApplyOptions(opts...)
  4397. return out, req.Send()
  4398. }
  4399. // ListKeysPages iterates over the pages of a ListKeys operation,
  4400. // calling the "fn" function with the response data for each page. To stop
  4401. // iterating, return false from the fn function.
  4402. //
  4403. // See ListKeys method for more information on how to use this operation.
  4404. //
  4405. // Note: This operation can generate multiple requests to a service.
  4406. //
  4407. // // Example iterating over at most 3 pages of a ListKeys operation.
  4408. // pageNum := 0
  4409. // err := client.ListKeysPages(params,
  4410. // func(page *kms.ListKeysOutput, lastPage bool) bool {
  4411. // pageNum++
  4412. // fmt.Println(page)
  4413. // return pageNum <= 3
  4414. // })
  4415. //
  4416. func (c *KMS) ListKeysPages(input *ListKeysInput, fn func(*ListKeysOutput, bool) bool) error {
  4417. return c.ListKeysPagesWithContext(aws.BackgroundContext(), input, fn)
  4418. }
  4419. // ListKeysPagesWithContext same as ListKeysPages except
  4420. // it takes a Context and allows setting request options on the pages.
  4421. //
  4422. // The context must be non-nil and will be used for request cancellation. If
  4423. // the context is nil a panic will occur. In the future the SDK may create
  4424. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4425. // for more information on using Contexts.
  4426. func (c *KMS) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn func(*ListKeysOutput, bool) bool, opts ...request.Option) error {
  4427. p := request.Pagination{
  4428. NewRequest: func() (*request.Request, error) {
  4429. var inCpy *ListKeysInput
  4430. if input != nil {
  4431. tmp := *input
  4432. inCpy = &tmp
  4433. }
  4434. req, _ := c.ListKeysRequest(inCpy)
  4435. req.SetContext(ctx)
  4436. req.ApplyOptions(opts...)
  4437. return req, nil
  4438. },
  4439. }
  4440. for p.Next() {
  4441. if !fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) {
  4442. break
  4443. }
  4444. }
  4445. return p.Err()
  4446. }
  4447. const opListResourceTags = "ListResourceTags"
  4448. // ListResourceTagsRequest generates a "aws/request.Request" representing the
  4449. // client's request for the ListResourceTags operation. The "output" return
  4450. // value will be populated with the request's response once the request completes
  4451. // successfully.
  4452. //
  4453. // Use "Send" method on the returned Request to send the API call to the service.
  4454. // the "output" return value is not valid until after Send returns without error.
  4455. //
  4456. // See ListResourceTags for more information on using the ListResourceTags
  4457. // API call, and error handling.
  4458. //
  4459. // This method is useful when you want to inject custom logic or configuration
  4460. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4461. //
  4462. //
  4463. // // Example sending a request using the ListResourceTagsRequest method.
  4464. // req, resp := client.ListResourceTagsRequest(params)
  4465. //
  4466. // err := req.Send()
  4467. // if err == nil { // resp is now filled
  4468. // fmt.Println(resp)
  4469. // }
  4470. //
  4471. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags
  4472. func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *request.Request, output *ListResourceTagsOutput) {
  4473. op := &request.Operation{
  4474. Name: opListResourceTags,
  4475. HTTPMethod: "POST",
  4476. HTTPPath: "/",
  4477. }
  4478. if input == nil {
  4479. input = &ListResourceTagsInput{}
  4480. }
  4481. output = &ListResourceTagsOutput{}
  4482. req = c.newRequest(op, input, output)
  4483. return
  4484. }
  4485. // ListResourceTags API operation for AWS Key Management Service.
  4486. //
  4487. // Returns a list of all tags for the specified customer master key (CMK).
  4488. //
  4489. // You cannot perform this operation on a CMK in a different AWS account.
  4490. //
  4491. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4492. // with awserr.Error's Code and Message methods to get detailed information about
  4493. // the error.
  4494. //
  4495. // See the AWS API reference guide for AWS Key Management Service's
  4496. // API operation ListResourceTags for usage and error information.
  4497. //
  4498. // Returned Error Types:
  4499. // * InternalException
  4500. // The request was rejected because an internal exception occurred. The request
  4501. // can be retried.
  4502. //
  4503. // * NotFoundException
  4504. // The request was rejected because the specified entity or resource could not
  4505. // be found.
  4506. //
  4507. // * InvalidArnException
  4508. // The request was rejected because a specified ARN, or an ARN in a key policy,
  4509. // is not valid.
  4510. //
  4511. // * InvalidMarkerException
  4512. // The request was rejected because the marker that specifies where pagination
  4513. // should next begin is not valid.
  4514. //
  4515. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListResourceTags
  4516. func (c *KMS) ListResourceTags(input *ListResourceTagsInput) (*ListResourceTagsOutput, error) {
  4517. req, out := c.ListResourceTagsRequest(input)
  4518. return out, req.Send()
  4519. }
  4520. // ListResourceTagsWithContext is the same as ListResourceTags with the addition of
  4521. // the ability to pass a context and additional request options.
  4522. //
  4523. // See ListResourceTags for details on how to use this API operation.
  4524. //
  4525. // The context must be non-nil and will be used for request cancellation. If
  4526. // the context is nil a panic will occur. In the future the SDK may create
  4527. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4528. // for more information on using Contexts.
  4529. func (c *KMS) ListResourceTagsWithContext(ctx aws.Context, input *ListResourceTagsInput, opts ...request.Option) (*ListResourceTagsOutput, error) {
  4530. req, out := c.ListResourceTagsRequest(input)
  4531. req.SetContext(ctx)
  4532. req.ApplyOptions(opts...)
  4533. return out, req.Send()
  4534. }
  4535. const opListRetirableGrants = "ListRetirableGrants"
  4536. // ListRetirableGrantsRequest generates a "aws/request.Request" representing the
  4537. // client's request for the ListRetirableGrants operation. The "output" return
  4538. // value will be populated with the request's response once the request completes
  4539. // successfully.
  4540. //
  4541. // Use "Send" method on the returned Request to send the API call to the service.
  4542. // the "output" return value is not valid until after Send returns without error.
  4543. //
  4544. // See ListRetirableGrants for more information on using the ListRetirableGrants
  4545. // API call, and error handling.
  4546. //
  4547. // This method is useful when you want to inject custom logic or configuration
  4548. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4549. //
  4550. //
  4551. // // Example sending a request using the ListRetirableGrantsRequest method.
  4552. // req, resp := client.ListRetirableGrantsRequest(params)
  4553. //
  4554. // err := req.Send()
  4555. // if err == nil { // resp is now filled
  4556. // fmt.Println(resp)
  4557. // }
  4558. //
  4559. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants
  4560. func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req *request.Request, output *ListGrantsResponse) {
  4561. op := &request.Operation{
  4562. Name: opListRetirableGrants,
  4563. HTTPMethod: "POST",
  4564. HTTPPath: "/",
  4565. }
  4566. if input == nil {
  4567. input = &ListRetirableGrantsInput{}
  4568. }
  4569. output = &ListGrantsResponse{}
  4570. req = c.newRequest(op, input, output)
  4571. return
  4572. }
  4573. // ListRetirableGrants API operation for AWS Key Management Service.
  4574. //
  4575. // Returns a list of all grants for which the grant's RetiringPrincipal matches
  4576. // the one specified.
  4577. //
  4578. // A typical use is to list all grants that you are able to retire. To retire
  4579. // a grant, use RetireGrant.
  4580. //
  4581. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4582. // with awserr.Error's Code and Message methods to get detailed information about
  4583. // the error.
  4584. //
  4585. // See the AWS API reference guide for AWS Key Management Service's
  4586. // API operation ListRetirableGrants for usage and error information.
  4587. //
  4588. // Returned Error Types:
  4589. // * DependencyTimeoutException
  4590. // The system timed out while trying to fulfill the request. The request can
  4591. // be retried.
  4592. //
  4593. // * InvalidMarkerException
  4594. // The request was rejected because the marker that specifies where pagination
  4595. // should next begin is not valid.
  4596. //
  4597. // * InvalidArnException
  4598. // The request was rejected because a specified ARN, or an ARN in a key policy,
  4599. // is not valid.
  4600. //
  4601. // * NotFoundException
  4602. // The request was rejected because the specified entity or resource could not
  4603. // be found.
  4604. //
  4605. // * InternalException
  4606. // The request was rejected because an internal exception occurred. The request
  4607. // can be retried.
  4608. //
  4609. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListRetirableGrants
  4610. func (c *KMS) ListRetirableGrants(input *ListRetirableGrantsInput) (*ListGrantsResponse, error) {
  4611. req, out := c.ListRetirableGrantsRequest(input)
  4612. return out, req.Send()
  4613. }
  4614. // ListRetirableGrantsWithContext is the same as ListRetirableGrants with the addition of
  4615. // the ability to pass a context and additional request options.
  4616. //
  4617. // See ListRetirableGrants for details on how to use this API operation.
  4618. //
  4619. // The context must be non-nil and will be used for request cancellation. If
  4620. // the context is nil a panic will occur. In the future the SDK may create
  4621. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4622. // for more information on using Contexts.
  4623. func (c *KMS) ListRetirableGrantsWithContext(ctx aws.Context, input *ListRetirableGrantsInput, opts ...request.Option) (*ListGrantsResponse, error) {
  4624. req, out := c.ListRetirableGrantsRequest(input)
  4625. req.SetContext(ctx)
  4626. req.ApplyOptions(opts...)
  4627. return out, req.Send()
  4628. }
  4629. const opPutKeyPolicy = "PutKeyPolicy"
  4630. // PutKeyPolicyRequest generates a "aws/request.Request" representing the
  4631. // client's request for the PutKeyPolicy operation. The "output" return
  4632. // value will be populated with the request's response once the request completes
  4633. // successfully.
  4634. //
  4635. // Use "Send" method on the returned Request to send the API call to the service.
  4636. // the "output" return value is not valid until after Send returns without error.
  4637. //
  4638. // See PutKeyPolicy for more information on using the PutKeyPolicy
  4639. // API call, and error handling.
  4640. //
  4641. // This method is useful when you want to inject custom logic or configuration
  4642. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4643. //
  4644. //
  4645. // // Example sending a request using the PutKeyPolicyRequest method.
  4646. // req, resp := client.PutKeyPolicyRequest(params)
  4647. //
  4648. // err := req.Send()
  4649. // if err == nil { // resp is now filled
  4650. // fmt.Println(resp)
  4651. // }
  4652. //
  4653. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy
  4654. func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Request, output *PutKeyPolicyOutput) {
  4655. op := &request.Operation{
  4656. Name: opPutKeyPolicy,
  4657. HTTPMethod: "POST",
  4658. HTTPPath: "/",
  4659. }
  4660. if input == nil {
  4661. input = &PutKeyPolicyInput{}
  4662. }
  4663. output = &PutKeyPolicyOutput{}
  4664. req = c.newRequest(op, input, output)
  4665. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  4666. return
  4667. }
  4668. // PutKeyPolicy API operation for AWS Key Management Service.
  4669. //
  4670. // Attaches a key policy to the specified customer master key (CMK). You cannot
  4671. // perform this operation on a CMK in a different AWS account.
  4672. //
  4673. // For more information about key policies, see Key Policies (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html)
  4674. // in the AWS Key Management Service Developer Guide.
  4675. //
  4676. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4677. // with awserr.Error's Code and Message methods to get detailed information about
  4678. // the error.
  4679. //
  4680. // See the AWS API reference guide for AWS Key Management Service's
  4681. // API operation PutKeyPolicy for usage and error information.
  4682. //
  4683. // Returned Error Types:
  4684. // * NotFoundException
  4685. // The request was rejected because the specified entity or resource could not
  4686. // be found.
  4687. //
  4688. // * InvalidArnException
  4689. // The request was rejected because a specified ARN, or an ARN in a key policy,
  4690. // is not valid.
  4691. //
  4692. // * MalformedPolicyDocumentException
  4693. // The request was rejected because the specified policy is not syntactically
  4694. // or semantically correct.
  4695. //
  4696. // * DependencyTimeoutException
  4697. // The system timed out while trying to fulfill the request. The request can
  4698. // be retried.
  4699. //
  4700. // * UnsupportedOperationException
  4701. // The request was rejected because a specified parameter is not supported or
  4702. // a specified resource is not valid for this operation.
  4703. //
  4704. // * InternalException
  4705. // The request was rejected because an internal exception occurred. The request
  4706. // can be retried.
  4707. //
  4708. // * LimitExceededException
  4709. // The request was rejected because a limit was exceeded. For more information,
  4710. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  4711. // in the AWS Key Management Service Developer Guide.
  4712. //
  4713. // * InvalidStateException
  4714. // The request was rejected because the state of the specified resource is not
  4715. // valid for this request.
  4716. //
  4717. // For more information about how key state affects the use of a CMK, see How
  4718. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  4719. // in the AWS Key Management Service Developer Guide .
  4720. //
  4721. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy
  4722. func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) {
  4723. req, out := c.PutKeyPolicyRequest(input)
  4724. return out, req.Send()
  4725. }
  4726. // PutKeyPolicyWithContext is the same as PutKeyPolicy with the addition of
  4727. // the ability to pass a context and additional request options.
  4728. //
  4729. // See PutKeyPolicy for details on how to use this API operation.
  4730. //
  4731. // The context must be non-nil and will be used for request cancellation. If
  4732. // the context is nil a panic will occur. In the future the SDK may create
  4733. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4734. // for more information on using Contexts.
  4735. func (c *KMS) PutKeyPolicyWithContext(ctx aws.Context, input *PutKeyPolicyInput, opts ...request.Option) (*PutKeyPolicyOutput, error) {
  4736. req, out := c.PutKeyPolicyRequest(input)
  4737. req.SetContext(ctx)
  4738. req.ApplyOptions(opts...)
  4739. return out, req.Send()
  4740. }
  4741. const opReEncrypt = "ReEncrypt"
  4742. // ReEncryptRequest generates a "aws/request.Request" representing the
  4743. // client's request for the ReEncrypt operation. The "output" return
  4744. // value will be populated with the request's response once the request completes
  4745. // successfully.
  4746. //
  4747. // Use "Send" method on the returned Request to send the API call to the service.
  4748. // the "output" return value is not valid until after Send returns without error.
  4749. //
  4750. // See ReEncrypt for more information on using the ReEncrypt
  4751. // API call, and error handling.
  4752. //
  4753. // This method is useful when you want to inject custom logic or configuration
  4754. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4755. //
  4756. //
  4757. // // Example sending a request using the ReEncryptRequest method.
  4758. // req, resp := client.ReEncryptRequest(params)
  4759. //
  4760. // err := req.Send()
  4761. // if err == nil { // resp is now filled
  4762. // fmt.Println(resp)
  4763. // }
  4764. //
  4765. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt
  4766. func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, output *ReEncryptOutput) {
  4767. op := &request.Operation{
  4768. Name: opReEncrypt,
  4769. HTTPMethod: "POST",
  4770. HTTPPath: "/",
  4771. }
  4772. if input == nil {
  4773. input = &ReEncryptInput{}
  4774. }
  4775. output = &ReEncryptOutput{}
  4776. req = c.newRequest(op, input, output)
  4777. return
  4778. }
  4779. // ReEncrypt API operation for AWS Key Management Service.
  4780. //
  4781. // Decrypts ciphertext and then reencrypts it entirely within AWS KMS. You can
  4782. // use this operation to change the customer master key (CMK) under which data
  4783. // is encrypted, such as when you manually rotate (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually)
  4784. // a CMK or change the CMK that protects a ciphertext. You can also use it to
  4785. // reencrypt ciphertext under the same CMK, such as to change the encryption
  4786. // context of a ciphertext.
  4787. //
  4788. // The ReEncrypt operation can decrypt ciphertext that was encrypted by using
  4789. // an AWS KMS CMK in an AWS KMS operation, such as Encrypt or GenerateDataKey.
  4790. // It can also decrypt ciphertext that was encrypted by using the public key
  4791. // of an asymmetric CMK outside of AWS KMS. However, it cannot decrypt ciphertext
  4792. // produced by other libraries, such as the AWS Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/)
  4793. // or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html).
  4794. // These libraries return a ciphertext format that is incompatible with AWS
  4795. // KMS.
  4796. //
  4797. // When you use the ReEncrypt operation, you need to provide information for
  4798. // the decrypt operation and the subsequent encrypt operation.
  4799. //
  4800. // * If your ciphertext was encrypted under an asymmetric CMK, you must identify
  4801. // the source CMK, that is, the CMK that encrypted the ciphertext. You must
  4802. // also supply the encryption algorithm that was used. This information is
  4803. // required to decrypt the data.
  4804. //
  4805. // * It is optional, but you can specify a source CMK even when the ciphertext
  4806. // was encrypted under a symmetric CMK. This ensures that the ciphertext
  4807. // is decrypted only by using a particular CMK. If the CMK that you specify
  4808. // cannot decrypt the ciphertext, the ReEncrypt operation fails.
  4809. //
  4810. // * To reencrypt the data, you must specify the destination CMK, that is,
  4811. // the CMK that re-encrypts the data after it is decrypted. You can select
  4812. // a symmetric or asymmetric CMK. If the destination CMK is an asymmetric
  4813. // CMK, you must also provide the encryption algorithm. The algorithm that
  4814. // you choose must be compatible with the CMK. When you use an asymmetric
  4815. // CMK to encrypt or reencrypt data, be sure to record the CMK and encryption
  4816. // algorithm that you choose. You will be required to provide the same CMK
  4817. // and encryption algorithm when you decrypt the data. If the CMK and algorithm
  4818. // do not match the values used to encrypt the data, the decrypt operation
  4819. // fails. You are not required to supply the CMK ID and encryption algorithm
  4820. // when you decrypt with symmetric CMKs because AWS KMS stores this information
  4821. // in the ciphertext blob. AWS KMS cannot store metadata in ciphertext generated
  4822. // with asymmetric keys. The standard format for asymmetric key ciphertext
  4823. // does not include configurable fields.
  4824. //
  4825. // Unlike other AWS KMS API operations, ReEncrypt callers must have two permissions:
  4826. //
  4827. // * kms:EncryptFrom permission on the source CMK
  4828. //
  4829. // * kms:EncryptTo permission on the destination CMK
  4830. //
  4831. // To permit reencryption from
  4832. //
  4833. // or to a CMK, include the "kms:ReEncrypt*" permission in your key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html).
  4834. // This permission is automatically included in the key policy when you use
  4835. // the console to create a CMK. But you must include it manually when you create
  4836. // a CMK programmatically or when you use the PutKeyPolicy operation set a key
  4837. // policy.
  4838. //
  4839. // The CMK that you use for this operation must be in a compatible key state.
  4840. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  4841. // in the AWS Key Management Service Developer Guide.
  4842. //
  4843. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4844. // with awserr.Error's Code and Message methods to get detailed information about
  4845. // the error.
  4846. //
  4847. // See the AWS API reference guide for AWS Key Management Service's
  4848. // API operation ReEncrypt for usage and error information.
  4849. //
  4850. // Returned Error Types:
  4851. // * NotFoundException
  4852. // The request was rejected because the specified entity or resource could not
  4853. // be found.
  4854. //
  4855. // * DisabledException
  4856. // The request was rejected because the specified CMK is not enabled.
  4857. //
  4858. // * InvalidCiphertextException
  4859. // From the Decrypt or ReEncrypt operation, the request was rejected because
  4860. // the specified ciphertext, or additional authenticated data incorporated into
  4861. // the ciphertext, such as the encryption context, is corrupted, missing, or
  4862. // otherwise invalid.
  4863. //
  4864. // From the ImportKeyMaterial operation, the request was rejected because AWS
  4865. // KMS could not decrypt the encrypted (wrapped) key material.
  4866. //
  4867. // * KeyUnavailableException
  4868. // The request was rejected because the specified CMK was not available. You
  4869. // can retry the request.
  4870. //
  4871. // * IncorrectKeyException
  4872. // The request was rejected because the specified CMK cannot decrypt the data.
  4873. // The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request
  4874. // must identify the same CMK that was used to encrypt the ciphertext.
  4875. //
  4876. // * DependencyTimeoutException
  4877. // The system timed out while trying to fulfill the request. The request can
  4878. // be retried.
  4879. //
  4880. // * InvalidKeyUsageException
  4881. // The request was rejected for one of the following reasons:
  4882. //
  4883. // * The KeyUsage value of the CMK is incompatible with the API operation.
  4884. //
  4885. // * The encryption algorithm or signing algorithm specified for the operation
  4886. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  4887. //
  4888. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  4889. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  4890. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  4891. //
  4892. // To find the encryption or signing algorithms supported for a particular CMK,
  4893. // use the DescribeKey operation.
  4894. //
  4895. // * InvalidGrantTokenException
  4896. // The request was rejected because the specified grant token is not valid.
  4897. //
  4898. // * InternalException
  4899. // The request was rejected because an internal exception occurred. The request
  4900. // can be retried.
  4901. //
  4902. // * InvalidStateException
  4903. // The request was rejected because the state of the specified resource is not
  4904. // valid for this request.
  4905. //
  4906. // For more information about how key state affects the use of a CMK, see How
  4907. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  4908. // in the AWS Key Management Service Developer Guide .
  4909. //
  4910. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt
  4911. func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) {
  4912. req, out := c.ReEncryptRequest(input)
  4913. return out, req.Send()
  4914. }
  4915. // ReEncryptWithContext is the same as ReEncrypt with the addition of
  4916. // the ability to pass a context and additional request options.
  4917. //
  4918. // See ReEncrypt for details on how to use this API operation.
  4919. //
  4920. // The context must be non-nil and will be used for request cancellation. If
  4921. // the context is nil a panic will occur. In the future the SDK may create
  4922. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  4923. // for more information on using Contexts.
  4924. func (c *KMS) ReEncryptWithContext(ctx aws.Context, input *ReEncryptInput, opts ...request.Option) (*ReEncryptOutput, error) {
  4925. req, out := c.ReEncryptRequest(input)
  4926. req.SetContext(ctx)
  4927. req.ApplyOptions(opts...)
  4928. return out, req.Send()
  4929. }
  4930. const opRetireGrant = "RetireGrant"
  4931. // RetireGrantRequest generates a "aws/request.Request" representing the
  4932. // client's request for the RetireGrant operation. The "output" return
  4933. // value will be populated with the request's response once the request completes
  4934. // successfully.
  4935. //
  4936. // Use "Send" method on the returned Request to send the API call to the service.
  4937. // the "output" return value is not valid until after Send returns without error.
  4938. //
  4939. // See RetireGrant for more information on using the RetireGrant
  4940. // API call, and error handling.
  4941. //
  4942. // This method is useful when you want to inject custom logic or configuration
  4943. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  4944. //
  4945. //
  4946. // // Example sending a request using the RetireGrantRequest method.
  4947. // req, resp := client.RetireGrantRequest(params)
  4948. //
  4949. // err := req.Send()
  4950. // if err == nil { // resp is now filled
  4951. // fmt.Println(resp)
  4952. // }
  4953. //
  4954. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant
  4955. func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, output *RetireGrantOutput) {
  4956. op := &request.Operation{
  4957. Name: opRetireGrant,
  4958. HTTPMethod: "POST",
  4959. HTTPPath: "/",
  4960. }
  4961. if input == nil {
  4962. input = &RetireGrantInput{}
  4963. }
  4964. output = &RetireGrantOutput{}
  4965. req = c.newRequest(op, input, output)
  4966. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  4967. return
  4968. }
  4969. // RetireGrant API operation for AWS Key Management Service.
  4970. //
  4971. // Retires a grant. To clean up, you can retire a grant when you're done using
  4972. // it. You should revoke a grant when you intend to actively deny operations
  4973. // that depend on it. The following are permitted to call this API:
  4974. //
  4975. // * The AWS account (root user) under which the grant was created
  4976. //
  4977. // * The RetiringPrincipal, if present in the grant
  4978. //
  4979. // * The GranteePrincipal, if RetireGrant is an operation specified in the
  4980. // grant
  4981. //
  4982. // You must identify the grant to retire by its grant token or by a combination
  4983. // of the grant ID and the Amazon Resource Name (ARN) of the customer master
  4984. // key (CMK). A grant token is a unique variable-length base64-encoded string.
  4985. // A grant ID is a 64 character unique identifier of a grant. The CreateGrant
  4986. // operation returns both.
  4987. //
  4988. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  4989. // with awserr.Error's Code and Message methods to get detailed information about
  4990. // the error.
  4991. //
  4992. // See the AWS API reference guide for AWS Key Management Service's
  4993. // API operation RetireGrant for usage and error information.
  4994. //
  4995. // Returned Error Types:
  4996. // * InvalidArnException
  4997. // The request was rejected because a specified ARN, or an ARN in a key policy,
  4998. // is not valid.
  4999. //
  5000. // * InvalidGrantTokenException
  5001. // The request was rejected because the specified grant token is not valid.
  5002. //
  5003. // * InvalidGrantIdException
  5004. // The request was rejected because the specified GrantId is not valid.
  5005. //
  5006. // * NotFoundException
  5007. // The request was rejected because the specified entity or resource could not
  5008. // be found.
  5009. //
  5010. // * DependencyTimeoutException
  5011. // The system timed out while trying to fulfill the request. The request can
  5012. // be retried.
  5013. //
  5014. // * InternalException
  5015. // The request was rejected because an internal exception occurred. The request
  5016. // can be retried.
  5017. //
  5018. // * InvalidStateException
  5019. // The request was rejected because the state of the specified resource is not
  5020. // valid for this request.
  5021. //
  5022. // For more information about how key state affects the use of a CMK, see How
  5023. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5024. // in the AWS Key Management Service Developer Guide .
  5025. //
  5026. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant
  5027. func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) {
  5028. req, out := c.RetireGrantRequest(input)
  5029. return out, req.Send()
  5030. }
  5031. // RetireGrantWithContext is the same as RetireGrant with the addition of
  5032. // the ability to pass a context and additional request options.
  5033. //
  5034. // See RetireGrant for details on how to use this API operation.
  5035. //
  5036. // The context must be non-nil and will be used for request cancellation. If
  5037. // the context is nil a panic will occur. In the future the SDK may create
  5038. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5039. // for more information on using Contexts.
  5040. func (c *KMS) RetireGrantWithContext(ctx aws.Context, input *RetireGrantInput, opts ...request.Option) (*RetireGrantOutput, error) {
  5041. req, out := c.RetireGrantRequest(input)
  5042. req.SetContext(ctx)
  5043. req.ApplyOptions(opts...)
  5044. return out, req.Send()
  5045. }
  5046. const opRevokeGrant = "RevokeGrant"
  5047. // RevokeGrantRequest generates a "aws/request.Request" representing the
  5048. // client's request for the RevokeGrant operation. The "output" return
  5049. // value will be populated with the request's response once the request completes
  5050. // successfully.
  5051. //
  5052. // Use "Send" method on the returned Request to send the API call to the service.
  5053. // the "output" return value is not valid until after Send returns without error.
  5054. //
  5055. // See RevokeGrant for more information on using the RevokeGrant
  5056. // API call, and error handling.
  5057. //
  5058. // This method is useful when you want to inject custom logic or configuration
  5059. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5060. //
  5061. //
  5062. // // Example sending a request using the RevokeGrantRequest method.
  5063. // req, resp := client.RevokeGrantRequest(params)
  5064. //
  5065. // err := req.Send()
  5066. // if err == nil { // resp is now filled
  5067. // fmt.Println(resp)
  5068. // }
  5069. //
  5070. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant
  5071. func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, output *RevokeGrantOutput) {
  5072. op := &request.Operation{
  5073. Name: opRevokeGrant,
  5074. HTTPMethod: "POST",
  5075. HTTPPath: "/",
  5076. }
  5077. if input == nil {
  5078. input = &RevokeGrantInput{}
  5079. }
  5080. output = &RevokeGrantOutput{}
  5081. req = c.newRequest(op, input, output)
  5082. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  5083. return
  5084. }
  5085. // RevokeGrant API operation for AWS Key Management Service.
  5086. //
  5087. // Revokes the specified grant for the specified customer master key (CMK).
  5088. // You can revoke a grant to actively deny operations that depend on it.
  5089. //
  5090. // To perform this operation on a CMK in a different AWS account, specify the
  5091. // key ARN in the value of the KeyId parameter.
  5092. //
  5093. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5094. // with awserr.Error's Code and Message methods to get detailed information about
  5095. // the error.
  5096. //
  5097. // See the AWS API reference guide for AWS Key Management Service's
  5098. // API operation RevokeGrant for usage and error information.
  5099. //
  5100. // Returned Error Types:
  5101. // * NotFoundException
  5102. // The request was rejected because the specified entity or resource could not
  5103. // be found.
  5104. //
  5105. // * DependencyTimeoutException
  5106. // The system timed out while trying to fulfill the request. The request can
  5107. // be retried.
  5108. //
  5109. // * InvalidArnException
  5110. // The request was rejected because a specified ARN, or an ARN in a key policy,
  5111. // is not valid.
  5112. //
  5113. // * InvalidGrantIdException
  5114. // The request was rejected because the specified GrantId is not valid.
  5115. //
  5116. // * InternalException
  5117. // The request was rejected because an internal exception occurred. The request
  5118. // can be retried.
  5119. //
  5120. // * InvalidStateException
  5121. // The request was rejected because the state of the specified resource is not
  5122. // valid for this request.
  5123. //
  5124. // For more information about how key state affects the use of a CMK, see How
  5125. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5126. // in the AWS Key Management Service Developer Guide .
  5127. //
  5128. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant
  5129. func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) {
  5130. req, out := c.RevokeGrantRequest(input)
  5131. return out, req.Send()
  5132. }
  5133. // RevokeGrantWithContext is the same as RevokeGrant with the addition of
  5134. // the ability to pass a context and additional request options.
  5135. //
  5136. // See RevokeGrant for details on how to use this API operation.
  5137. //
  5138. // The context must be non-nil and will be used for request cancellation. If
  5139. // the context is nil a panic will occur. In the future the SDK may create
  5140. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5141. // for more information on using Contexts.
  5142. func (c *KMS) RevokeGrantWithContext(ctx aws.Context, input *RevokeGrantInput, opts ...request.Option) (*RevokeGrantOutput, error) {
  5143. req, out := c.RevokeGrantRequest(input)
  5144. req.SetContext(ctx)
  5145. req.ApplyOptions(opts...)
  5146. return out, req.Send()
  5147. }
  5148. const opScheduleKeyDeletion = "ScheduleKeyDeletion"
  5149. // ScheduleKeyDeletionRequest generates a "aws/request.Request" representing the
  5150. // client's request for the ScheduleKeyDeletion operation. The "output" return
  5151. // value will be populated with the request's response once the request completes
  5152. // successfully.
  5153. //
  5154. // Use "Send" method on the returned Request to send the API call to the service.
  5155. // the "output" return value is not valid until after Send returns without error.
  5156. //
  5157. // See ScheduleKeyDeletion for more information on using the ScheduleKeyDeletion
  5158. // API call, and error handling.
  5159. //
  5160. // This method is useful when you want to inject custom logic or configuration
  5161. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5162. //
  5163. //
  5164. // // Example sending a request using the ScheduleKeyDeletionRequest method.
  5165. // req, resp := client.ScheduleKeyDeletionRequest(params)
  5166. //
  5167. // err := req.Send()
  5168. // if err == nil { // resp is now filled
  5169. // fmt.Println(resp)
  5170. // }
  5171. //
  5172. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion
  5173. func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req *request.Request, output *ScheduleKeyDeletionOutput) {
  5174. op := &request.Operation{
  5175. Name: opScheduleKeyDeletion,
  5176. HTTPMethod: "POST",
  5177. HTTPPath: "/",
  5178. }
  5179. if input == nil {
  5180. input = &ScheduleKeyDeletionInput{}
  5181. }
  5182. output = &ScheduleKeyDeletionOutput{}
  5183. req = c.newRequest(op, input, output)
  5184. return
  5185. }
  5186. // ScheduleKeyDeletion API operation for AWS Key Management Service.
  5187. //
  5188. // Schedules the deletion of a customer master key (CMK). You may provide a
  5189. // waiting period, specified in days, before deletion occurs. If you do not
  5190. // provide a waiting period, the default period of 30 days is used. When this
  5191. // operation is successful, the key state of the CMK changes to PendingDeletion.
  5192. // Before the waiting period ends, you can use CancelKeyDeletion to cancel the
  5193. // deletion of the CMK. After the waiting period ends, AWS KMS deletes the CMK
  5194. // and all AWS KMS data associated with it, including all aliases that refer
  5195. // to it.
  5196. //
  5197. // Deleting a CMK is a destructive and potentially dangerous operation. When
  5198. // a CMK is deleted, all data that was encrypted under the CMK is unrecoverable.
  5199. // To prevent the use of a CMK without deleting it, use DisableKey.
  5200. //
  5201. // If you schedule deletion of a CMK from a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html),
  5202. // when the waiting period expires, ScheduleKeyDeletion deletes the CMK from
  5203. // AWS KMS. Then AWS KMS makes a best effort to delete the key material from
  5204. // the associated AWS CloudHSM cluster. However, you might need to manually
  5205. // delete the orphaned key material (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key)
  5206. // from the cluster and its backups.
  5207. //
  5208. // You cannot perform this operation on a CMK in a different AWS account.
  5209. //
  5210. // For more information about scheduling a CMK for deletion, see Deleting Customer
  5211. // Master Keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html)
  5212. // in the AWS Key Management Service Developer Guide.
  5213. //
  5214. // The CMK that you use for this operation must be in a compatible key state.
  5215. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5216. // in the AWS Key Management Service Developer Guide.
  5217. //
  5218. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5219. // with awserr.Error's Code and Message methods to get detailed information about
  5220. // the error.
  5221. //
  5222. // See the AWS API reference guide for AWS Key Management Service's
  5223. // API operation ScheduleKeyDeletion for usage and error information.
  5224. //
  5225. // Returned Error Types:
  5226. // * NotFoundException
  5227. // The request was rejected because the specified entity or resource could not
  5228. // be found.
  5229. //
  5230. // * InvalidArnException
  5231. // The request was rejected because a specified ARN, or an ARN in a key policy,
  5232. // is not valid.
  5233. //
  5234. // * DependencyTimeoutException
  5235. // The system timed out while trying to fulfill the request. The request can
  5236. // be retried.
  5237. //
  5238. // * InternalException
  5239. // The request was rejected because an internal exception occurred. The request
  5240. // can be retried.
  5241. //
  5242. // * InvalidStateException
  5243. // The request was rejected because the state of the specified resource is not
  5244. // valid for this request.
  5245. //
  5246. // For more information about how key state affects the use of a CMK, see How
  5247. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5248. // in the AWS Key Management Service Developer Guide .
  5249. //
  5250. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion
  5251. func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) {
  5252. req, out := c.ScheduleKeyDeletionRequest(input)
  5253. return out, req.Send()
  5254. }
  5255. // ScheduleKeyDeletionWithContext is the same as ScheduleKeyDeletion with the addition of
  5256. // the ability to pass a context and additional request options.
  5257. //
  5258. // See ScheduleKeyDeletion for details on how to use this API operation.
  5259. //
  5260. // The context must be non-nil and will be used for request cancellation. If
  5261. // the context is nil a panic will occur. In the future the SDK may create
  5262. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5263. // for more information on using Contexts.
  5264. func (c *KMS) ScheduleKeyDeletionWithContext(ctx aws.Context, input *ScheduleKeyDeletionInput, opts ...request.Option) (*ScheduleKeyDeletionOutput, error) {
  5265. req, out := c.ScheduleKeyDeletionRequest(input)
  5266. req.SetContext(ctx)
  5267. req.ApplyOptions(opts...)
  5268. return out, req.Send()
  5269. }
  5270. const opSign = "Sign"
  5271. // SignRequest generates a "aws/request.Request" representing the
  5272. // client's request for the Sign operation. The "output" return
  5273. // value will be populated with the request's response once the request completes
  5274. // successfully.
  5275. //
  5276. // Use "Send" method on the returned Request to send the API call to the service.
  5277. // the "output" return value is not valid until after Send returns without error.
  5278. //
  5279. // See Sign for more information on using the Sign
  5280. // API call, and error handling.
  5281. //
  5282. // This method is useful when you want to inject custom logic or configuration
  5283. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5284. //
  5285. //
  5286. // // Example sending a request using the SignRequest method.
  5287. // req, resp := client.SignRequest(params)
  5288. //
  5289. // err := req.Send()
  5290. // if err == nil { // resp is now filled
  5291. // fmt.Println(resp)
  5292. // }
  5293. //
  5294. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign
  5295. func (c *KMS) SignRequest(input *SignInput) (req *request.Request, output *SignOutput) {
  5296. op := &request.Operation{
  5297. Name: opSign,
  5298. HTTPMethod: "POST",
  5299. HTTPPath: "/",
  5300. }
  5301. if input == nil {
  5302. input = &SignInput{}
  5303. }
  5304. output = &SignOutput{}
  5305. req = c.newRequest(op, input, output)
  5306. return
  5307. }
  5308. // Sign API operation for AWS Key Management Service.
  5309. //
  5310. // Creates a digital signature (https://en.wikipedia.org/wiki/Digital_signature)
  5311. // for a message or message digest by using the private key in an asymmetric
  5312. // CMK. To verify the signature, use the Verify operation, or use the public
  5313. // key in the same asymmetric CMK outside of AWS KMS. For information about
  5314. // symmetric and asymmetric CMKs, see Using Symmetric and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
  5315. // in the AWS Key Management Service Developer Guide.
  5316. //
  5317. // Digital signatures are generated and verified by using asymmetric key pair,
  5318. // such as an RSA or ECC pair that is represented by an asymmetric customer
  5319. // master key (CMK). The key owner (or an authorized user) uses their private
  5320. // key to sign a message. Anyone with the public key can verify that the message
  5321. // was signed with that particular private key and that the message hasn't changed
  5322. // since it was signed.
  5323. //
  5324. // To use the Sign operation, provide the following information:
  5325. //
  5326. // * Use the KeyId parameter to identify an asymmetric CMK with a KeyUsage
  5327. // value of SIGN_VERIFY. To get the KeyUsage value of a CMK, use the DescribeKey
  5328. // operation. The caller must have kms:Sign permission on the CMK.
  5329. //
  5330. // * Use the Message parameter to specify the message or message digest to
  5331. // sign. You can submit messages of up to 4096 bytes. To sign a larger message,
  5332. // generate a hash digest of the message, and then provide the hash digest
  5333. // in the Message parameter. To indicate whether the message is a full message
  5334. // or a digest, use the MessageType parameter.
  5335. //
  5336. // * Choose a signing algorithm that is compatible with the CMK.
  5337. //
  5338. // When signing a message, be sure to record the CMK and the signing algorithm.
  5339. // This information is required to verify the signature.
  5340. //
  5341. // To verify the signature that this operation generates, use the Verify operation.
  5342. // Or use the GetPublicKey operation to download the public key and then use
  5343. // the public key to verify the signature outside of AWS KMS.
  5344. //
  5345. // The CMK that you use for this operation must be in a compatible key state.
  5346. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5347. // in the AWS Key Management Service Developer Guide.
  5348. //
  5349. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5350. // with awserr.Error's Code and Message methods to get detailed information about
  5351. // the error.
  5352. //
  5353. // See the AWS API reference guide for AWS Key Management Service's
  5354. // API operation Sign for usage and error information.
  5355. //
  5356. // Returned Error Types:
  5357. // * NotFoundException
  5358. // The request was rejected because the specified entity or resource could not
  5359. // be found.
  5360. //
  5361. // * DisabledException
  5362. // The request was rejected because the specified CMK is not enabled.
  5363. //
  5364. // * KeyUnavailableException
  5365. // The request was rejected because the specified CMK was not available. You
  5366. // can retry the request.
  5367. //
  5368. // * DependencyTimeoutException
  5369. // The system timed out while trying to fulfill the request. The request can
  5370. // be retried.
  5371. //
  5372. // * InvalidKeyUsageException
  5373. // The request was rejected for one of the following reasons:
  5374. //
  5375. // * The KeyUsage value of the CMK is incompatible with the API operation.
  5376. //
  5377. // * The encryption algorithm or signing algorithm specified for the operation
  5378. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  5379. //
  5380. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  5381. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  5382. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  5383. //
  5384. // To find the encryption or signing algorithms supported for a particular CMK,
  5385. // use the DescribeKey operation.
  5386. //
  5387. // * InvalidGrantTokenException
  5388. // The request was rejected because the specified grant token is not valid.
  5389. //
  5390. // * InternalException
  5391. // The request was rejected because an internal exception occurred. The request
  5392. // can be retried.
  5393. //
  5394. // * InvalidStateException
  5395. // The request was rejected because the state of the specified resource is not
  5396. // valid for this request.
  5397. //
  5398. // For more information about how key state affects the use of a CMK, see How
  5399. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5400. // in the AWS Key Management Service Developer Guide .
  5401. //
  5402. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign
  5403. func (c *KMS) Sign(input *SignInput) (*SignOutput, error) {
  5404. req, out := c.SignRequest(input)
  5405. return out, req.Send()
  5406. }
  5407. // SignWithContext is the same as Sign with the addition of
  5408. // the ability to pass a context and additional request options.
  5409. //
  5410. // See Sign for details on how to use this API operation.
  5411. //
  5412. // The context must be non-nil and will be used for request cancellation. If
  5413. // the context is nil a panic will occur. In the future the SDK may create
  5414. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5415. // for more information on using Contexts.
  5416. func (c *KMS) SignWithContext(ctx aws.Context, input *SignInput, opts ...request.Option) (*SignOutput, error) {
  5417. req, out := c.SignRequest(input)
  5418. req.SetContext(ctx)
  5419. req.ApplyOptions(opts...)
  5420. return out, req.Send()
  5421. }
  5422. const opTagResource = "TagResource"
  5423. // TagResourceRequest generates a "aws/request.Request" representing the
  5424. // client's request for the TagResource operation. The "output" return
  5425. // value will be populated with the request's response once the request completes
  5426. // successfully.
  5427. //
  5428. // Use "Send" method on the returned Request to send the API call to the service.
  5429. // the "output" return value is not valid until after Send returns without error.
  5430. //
  5431. // See TagResource for more information on using the TagResource
  5432. // API call, and error handling.
  5433. //
  5434. // This method is useful when you want to inject custom logic or configuration
  5435. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5436. //
  5437. //
  5438. // // Example sending a request using the TagResourceRequest method.
  5439. // req, resp := client.TagResourceRequest(params)
  5440. //
  5441. // err := req.Send()
  5442. // if err == nil { // resp is now filled
  5443. // fmt.Println(resp)
  5444. // }
  5445. //
  5446. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource
  5447. func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) {
  5448. op := &request.Operation{
  5449. Name: opTagResource,
  5450. HTTPMethod: "POST",
  5451. HTTPPath: "/",
  5452. }
  5453. if input == nil {
  5454. input = &TagResourceInput{}
  5455. }
  5456. output = &TagResourceOutput{}
  5457. req = c.newRequest(op, input, output)
  5458. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  5459. return
  5460. }
  5461. // TagResource API operation for AWS Key Management Service.
  5462. //
  5463. // Adds or edits tags for a customer master key (CMK). You cannot perform this
  5464. // operation on a CMK in a different AWS account.
  5465. //
  5466. // Each tag consists of a tag key and a tag value. Tag keys and tag values are
  5467. // both required, but tag values can be empty (null) strings.
  5468. //
  5469. // You can only use a tag key once for each CMK. If you use the tag key again,
  5470. // AWS KMS replaces the current tag value with the specified value.
  5471. //
  5472. // For information about the rules that apply to tag keys and tag values, see
  5473. // User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html)
  5474. // in the AWS Billing and Cost Management User Guide.
  5475. //
  5476. // The CMK that you use for this operation must be in a compatible key state.
  5477. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5478. // in the AWS Key Management Service Developer Guide.
  5479. //
  5480. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5481. // with awserr.Error's Code and Message methods to get detailed information about
  5482. // the error.
  5483. //
  5484. // See the AWS API reference guide for AWS Key Management Service's
  5485. // API operation TagResource for usage and error information.
  5486. //
  5487. // Returned Error Types:
  5488. // * InternalException
  5489. // The request was rejected because an internal exception occurred. The request
  5490. // can be retried.
  5491. //
  5492. // * NotFoundException
  5493. // The request was rejected because the specified entity or resource could not
  5494. // be found.
  5495. //
  5496. // * InvalidArnException
  5497. // The request was rejected because a specified ARN, or an ARN in a key policy,
  5498. // is not valid.
  5499. //
  5500. // * InvalidStateException
  5501. // The request was rejected because the state of the specified resource is not
  5502. // valid for this request.
  5503. //
  5504. // For more information about how key state affects the use of a CMK, see How
  5505. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5506. // in the AWS Key Management Service Developer Guide .
  5507. //
  5508. // * LimitExceededException
  5509. // The request was rejected because a limit was exceeded. For more information,
  5510. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  5511. // in the AWS Key Management Service Developer Guide.
  5512. //
  5513. // * TagException
  5514. // The request was rejected because one or more tags are not valid.
  5515. //
  5516. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource
  5517. func (c *KMS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) {
  5518. req, out := c.TagResourceRequest(input)
  5519. return out, req.Send()
  5520. }
  5521. // TagResourceWithContext is the same as TagResource with the addition of
  5522. // the ability to pass a context and additional request options.
  5523. //
  5524. // See TagResource for details on how to use this API operation.
  5525. //
  5526. // The context must be non-nil and will be used for request cancellation. If
  5527. // the context is nil a panic will occur. In the future the SDK may create
  5528. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5529. // for more information on using Contexts.
  5530. func (c *KMS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {
  5531. req, out := c.TagResourceRequest(input)
  5532. req.SetContext(ctx)
  5533. req.ApplyOptions(opts...)
  5534. return out, req.Send()
  5535. }
  5536. const opUntagResource = "UntagResource"
  5537. // UntagResourceRequest generates a "aws/request.Request" representing the
  5538. // client's request for the UntagResource operation. The "output" return
  5539. // value will be populated with the request's response once the request completes
  5540. // successfully.
  5541. //
  5542. // Use "Send" method on the returned Request to send the API call to the service.
  5543. // the "output" return value is not valid until after Send returns without error.
  5544. //
  5545. // See UntagResource for more information on using the UntagResource
  5546. // API call, and error handling.
  5547. //
  5548. // This method is useful when you want to inject custom logic or configuration
  5549. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5550. //
  5551. //
  5552. // // Example sending a request using the UntagResourceRequest method.
  5553. // req, resp := client.UntagResourceRequest(params)
  5554. //
  5555. // err := req.Send()
  5556. // if err == nil { // resp is now filled
  5557. // fmt.Println(resp)
  5558. // }
  5559. //
  5560. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource
  5561. func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) {
  5562. op := &request.Operation{
  5563. Name: opUntagResource,
  5564. HTTPMethod: "POST",
  5565. HTTPPath: "/",
  5566. }
  5567. if input == nil {
  5568. input = &UntagResourceInput{}
  5569. }
  5570. output = &UntagResourceOutput{}
  5571. req = c.newRequest(op, input, output)
  5572. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  5573. return
  5574. }
  5575. // UntagResource API operation for AWS Key Management Service.
  5576. //
  5577. // Removes the specified tags from the specified customer master key (CMK).
  5578. // You cannot perform this operation on a CMK in a different AWS account.
  5579. //
  5580. // To remove a tag, specify the tag key. To change the tag value of an existing
  5581. // tag key, use TagResource.
  5582. //
  5583. // The CMK that you use for this operation must be in a compatible key state.
  5584. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5585. // in the AWS Key Management Service Developer Guide.
  5586. //
  5587. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5588. // with awserr.Error's Code and Message methods to get detailed information about
  5589. // the error.
  5590. //
  5591. // See the AWS API reference guide for AWS Key Management Service's
  5592. // API operation UntagResource for usage and error information.
  5593. //
  5594. // Returned Error Types:
  5595. // * InternalException
  5596. // The request was rejected because an internal exception occurred. The request
  5597. // can be retried.
  5598. //
  5599. // * NotFoundException
  5600. // The request was rejected because the specified entity or resource could not
  5601. // be found.
  5602. //
  5603. // * InvalidArnException
  5604. // The request was rejected because a specified ARN, or an ARN in a key policy,
  5605. // is not valid.
  5606. //
  5607. // * InvalidStateException
  5608. // The request was rejected because the state of the specified resource is not
  5609. // valid for this request.
  5610. //
  5611. // For more information about how key state affects the use of a CMK, see How
  5612. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5613. // in the AWS Key Management Service Developer Guide .
  5614. //
  5615. // * TagException
  5616. // The request was rejected because one or more tags are not valid.
  5617. //
  5618. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource
  5619. func (c *KMS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) {
  5620. req, out := c.UntagResourceRequest(input)
  5621. return out, req.Send()
  5622. }
  5623. // UntagResourceWithContext is the same as UntagResource with the addition of
  5624. // the ability to pass a context and additional request options.
  5625. //
  5626. // See UntagResource for details on how to use this API operation.
  5627. //
  5628. // The context must be non-nil and will be used for request cancellation. If
  5629. // the context is nil a panic will occur. In the future the SDK may create
  5630. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5631. // for more information on using Contexts.
  5632. func (c *KMS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {
  5633. req, out := c.UntagResourceRequest(input)
  5634. req.SetContext(ctx)
  5635. req.ApplyOptions(opts...)
  5636. return out, req.Send()
  5637. }
  5638. const opUpdateAlias = "UpdateAlias"
  5639. // UpdateAliasRequest generates a "aws/request.Request" representing the
  5640. // client's request for the UpdateAlias operation. The "output" return
  5641. // value will be populated with the request's response once the request completes
  5642. // successfully.
  5643. //
  5644. // Use "Send" method on the returned Request to send the API call to the service.
  5645. // the "output" return value is not valid until after Send returns without error.
  5646. //
  5647. // See UpdateAlias for more information on using the UpdateAlias
  5648. // API call, and error handling.
  5649. //
  5650. // This method is useful when you want to inject custom logic or configuration
  5651. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5652. //
  5653. //
  5654. // // Example sending a request using the UpdateAliasRequest method.
  5655. // req, resp := client.UpdateAliasRequest(params)
  5656. //
  5657. // err := req.Send()
  5658. // if err == nil { // resp is now filled
  5659. // fmt.Println(resp)
  5660. // }
  5661. //
  5662. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias
  5663. func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) {
  5664. op := &request.Operation{
  5665. Name: opUpdateAlias,
  5666. HTTPMethod: "POST",
  5667. HTTPPath: "/",
  5668. }
  5669. if input == nil {
  5670. input = &UpdateAliasInput{}
  5671. }
  5672. output = &UpdateAliasOutput{}
  5673. req = c.newRequest(op, input, output)
  5674. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  5675. return
  5676. }
  5677. // UpdateAlias API operation for AWS Key Management Service.
  5678. //
  5679. // Associates an existing AWS KMS alias with a different customer master key
  5680. // (CMK). Each alias is associated with only one CMK at a time, although a CMK
  5681. // can have multiple aliases. The alias and the CMK must be in the same AWS
  5682. // account and region. You cannot perform this operation on an alias in a different
  5683. // AWS account.
  5684. //
  5685. // The current and new CMK must be the same type (both symmetric or both asymmetric),
  5686. // and they must have the same key usage (ENCRYPT_DECRYPT or SIGN_VERIFY). This
  5687. // restriction prevents errors in code that uses aliases. If you must assign
  5688. // an alias to a different type of CMK, use DeleteAlias to delete the old alias
  5689. // and CreateAlias to create a new alias.
  5690. //
  5691. // You cannot use UpdateAlias to change an alias name. To change an alias name,
  5692. // use DeleteAlias to delete the old alias and CreateAlias to create a new alias.
  5693. //
  5694. // Because an alias is not a property of a CMK, you can create, update, and
  5695. // delete the aliases of a CMK without affecting the CMK. Also, aliases do not
  5696. // appear in the response from the DescribeKey operation. To get the aliases
  5697. // of all CMKs in the account, use the ListAliases operation.
  5698. //
  5699. // The CMK that you use for this operation must be in a compatible key state.
  5700. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5701. // in the AWS Key Management Service Developer Guide.
  5702. //
  5703. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5704. // with awserr.Error's Code and Message methods to get detailed information about
  5705. // the error.
  5706. //
  5707. // See the AWS API reference guide for AWS Key Management Service's
  5708. // API operation UpdateAlias for usage and error information.
  5709. //
  5710. // Returned Error Types:
  5711. // * DependencyTimeoutException
  5712. // The system timed out while trying to fulfill the request. The request can
  5713. // be retried.
  5714. //
  5715. // * NotFoundException
  5716. // The request was rejected because the specified entity or resource could not
  5717. // be found.
  5718. //
  5719. // * InternalException
  5720. // The request was rejected because an internal exception occurred. The request
  5721. // can be retried.
  5722. //
  5723. // * InvalidStateException
  5724. // The request was rejected because the state of the specified resource is not
  5725. // valid for this request.
  5726. //
  5727. // For more information about how key state affects the use of a CMK, see How
  5728. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5729. // in the AWS Key Management Service Developer Guide .
  5730. //
  5731. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias
  5732. func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) {
  5733. req, out := c.UpdateAliasRequest(input)
  5734. return out, req.Send()
  5735. }
  5736. // UpdateAliasWithContext is the same as UpdateAlias with the addition of
  5737. // the ability to pass a context and additional request options.
  5738. //
  5739. // See UpdateAlias for details on how to use this API operation.
  5740. //
  5741. // The context must be non-nil and will be used for request cancellation. If
  5742. // the context is nil a panic will occur. In the future the SDK may create
  5743. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5744. // for more information on using Contexts.
  5745. func (c *KMS) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) {
  5746. req, out := c.UpdateAliasRequest(input)
  5747. req.SetContext(ctx)
  5748. req.ApplyOptions(opts...)
  5749. return out, req.Send()
  5750. }
  5751. const opUpdateCustomKeyStore = "UpdateCustomKeyStore"
  5752. // UpdateCustomKeyStoreRequest generates a "aws/request.Request" representing the
  5753. // client's request for the UpdateCustomKeyStore operation. The "output" return
  5754. // value will be populated with the request's response once the request completes
  5755. // successfully.
  5756. //
  5757. // Use "Send" method on the returned Request to send the API call to the service.
  5758. // the "output" return value is not valid until after Send returns without error.
  5759. //
  5760. // See UpdateCustomKeyStore for more information on using the UpdateCustomKeyStore
  5761. // API call, and error handling.
  5762. //
  5763. // This method is useful when you want to inject custom logic or configuration
  5764. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5765. //
  5766. //
  5767. // // Example sending a request using the UpdateCustomKeyStoreRequest method.
  5768. // req, resp := client.UpdateCustomKeyStoreRequest(params)
  5769. //
  5770. // err := req.Send()
  5771. // if err == nil { // resp is now filled
  5772. // fmt.Println(resp)
  5773. // }
  5774. //
  5775. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateCustomKeyStore
  5776. func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req *request.Request, output *UpdateCustomKeyStoreOutput) {
  5777. op := &request.Operation{
  5778. Name: opUpdateCustomKeyStore,
  5779. HTTPMethod: "POST",
  5780. HTTPPath: "/",
  5781. }
  5782. if input == nil {
  5783. input = &UpdateCustomKeyStoreInput{}
  5784. }
  5785. output = &UpdateCustomKeyStoreOutput{}
  5786. req = c.newRequest(op, input, output)
  5787. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  5788. return
  5789. }
  5790. // UpdateCustomKeyStore API operation for AWS Key Management Service.
  5791. //
  5792. // Changes the properties of a custom key store. Use the CustomKeyStoreId parameter
  5793. // to identify the custom key store you want to edit. Use the remaining parameters
  5794. // to change the properties of the custom key store.
  5795. //
  5796. // You can only update a custom key store that is disconnected. To disconnect
  5797. // the custom key store, use DisconnectCustomKeyStore. To reconnect the custom
  5798. // key store after the update completes, use ConnectCustomKeyStore. To find
  5799. // the connection state of a custom key store, use the DescribeCustomKeyStores
  5800. // operation.
  5801. //
  5802. // Use the parameters of UpdateCustomKeyStore to edit your keystore settings.
  5803. //
  5804. // * Use the NewCustomKeyStoreName parameter to change the friendly name
  5805. // of the custom key store to the value that you specify.
  5806. //
  5807. // * Use the KeyStorePassword parameter tell AWS KMS the current password
  5808. // of the kmsuser crypto user (CU) (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser)
  5809. // in the associated AWS CloudHSM cluster. You can use this parameter to
  5810. // fix connection failures (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-password)
  5811. // that occur when AWS KMS cannot log into the associated cluster because
  5812. // the kmsuser password has changed. This value does not change the password
  5813. // in the AWS CloudHSM cluster.
  5814. //
  5815. // * Use the CloudHsmClusterId parameter to associate the custom key store
  5816. // with a different, but related, AWS CloudHSM cluster. You can use this
  5817. // parameter to repair a custom key store if its AWS CloudHSM cluster becomes
  5818. // corrupted or is deleted, or when you need to create or restore a cluster
  5819. // from a backup.
  5820. //
  5821. // If the operation succeeds, it returns a JSON object with no properties.
  5822. //
  5823. // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  5824. // feature in AWS KMS, which combines the convenience and extensive integration
  5825. // of AWS KMS with the isolation and control of a single-tenant key store.
  5826. //
  5827. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5828. // with awserr.Error's Code and Message methods to get detailed information about
  5829. // the error.
  5830. //
  5831. // See the AWS API reference guide for AWS Key Management Service's
  5832. // API operation UpdateCustomKeyStore for usage and error information.
  5833. //
  5834. // Returned Error Types:
  5835. // * CustomKeyStoreNotFoundException
  5836. // The request was rejected because AWS KMS cannot find a custom key store with
  5837. // the specified key store name or ID.
  5838. //
  5839. // * CustomKeyStoreNameInUseException
  5840. // The request was rejected because the specified custom key store name is already
  5841. // assigned to another custom key store in the account. Try again with a custom
  5842. // key store name that is unique in the account.
  5843. //
  5844. // * CloudHsmClusterNotFoundException
  5845. // The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster
  5846. // with the specified cluster ID. Retry the request with a different cluster
  5847. // ID.
  5848. //
  5849. // * CloudHsmClusterNotRelatedException
  5850. // The request was rejected because the specified AWS CloudHSM cluster has a
  5851. // different cluster certificate than the original cluster. You cannot use the
  5852. // operation to specify an unrelated cluster.
  5853. //
  5854. // Specify a cluster that shares a backup history with the original cluster.
  5855. // This includes clusters that were created from a backup of the current cluster,
  5856. // and clusters that were created from the same backup that produced the current
  5857. // cluster.
  5858. //
  5859. // Clusters that share a backup history have the same cluster certificate. To
  5860. // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  5861. // operation.
  5862. //
  5863. // * CustomKeyStoreInvalidStateException
  5864. // The request was rejected because of the ConnectionState of the custom key
  5865. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  5866. // operation.
  5867. //
  5868. // This exception is thrown under the following conditions:
  5869. //
  5870. // * You requested the CreateKey or GenerateRandom operation in a custom
  5871. // key store that is not connected. These operations are valid only when
  5872. // the custom key store ConnectionState is CONNECTED.
  5873. //
  5874. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  5875. // on a custom key store that is not disconnected. This operation is valid
  5876. // only when the custom key store ConnectionState is DISCONNECTED.
  5877. //
  5878. // * You requested the ConnectCustomKeyStore operation on a custom key store
  5879. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  5880. // for all other ConnectionState values.
  5881. //
  5882. // * InternalException
  5883. // The request was rejected because an internal exception occurred. The request
  5884. // can be retried.
  5885. //
  5886. // * CloudHsmClusterNotActiveException
  5887. // The request was rejected because the AWS CloudHSM cluster that is associated
  5888. // with the custom key store is not active. Initialize and activate the cluster
  5889. // and try the command again. For detailed instructions, see Getting Started
  5890. // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
  5891. // in the AWS CloudHSM User Guide.
  5892. //
  5893. // * CloudHsmClusterInvalidConfigurationException
  5894. // The request was rejected because the associated AWS CloudHSM cluster did
  5895. // not meet the configuration requirements for a custom key store.
  5896. //
  5897. // * The cluster must be configured with private subnets in at least two
  5898. // different Availability Zones in the Region.
  5899. //
  5900. // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  5901. // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
  5902. // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
  5903. // rules and the Destination in the outbound rules must match the security
  5904. // group ID. These rules are set by default when you create the cluster.
  5905. // Do not delete or change them. To get information about a particular security
  5906. // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
  5907. // operation.
  5908. //
  5909. // * The cluster must contain at least as many HSMs as the operation requires.
  5910. // To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  5911. // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
  5912. // operations, the AWS CloudHSM cluster must have at least two active HSMs,
  5913. // each in a different Availability Zone. For the ConnectCustomKeyStore operation,
  5914. // the AWS CloudHSM must contain at least one active HSM.
  5915. //
  5916. // For information about the requirements for an AWS CloudHSM cluster that is
  5917. // associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  5918. // in the AWS Key Management Service Developer Guide. For information about
  5919. // creating a private subnet for an AWS CloudHSM cluster, see Create a Private
  5920. // Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
  5921. // in the AWS CloudHSM User Guide. For information about cluster security groups,
  5922. // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  5923. // in the AWS CloudHSM User Guide .
  5924. //
  5925. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateCustomKeyStore
  5926. func (c *KMS) UpdateCustomKeyStore(input *UpdateCustomKeyStoreInput) (*UpdateCustomKeyStoreOutput, error) {
  5927. req, out := c.UpdateCustomKeyStoreRequest(input)
  5928. return out, req.Send()
  5929. }
  5930. // UpdateCustomKeyStoreWithContext is the same as UpdateCustomKeyStore with the addition of
  5931. // the ability to pass a context and additional request options.
  5932. //
  5933. // See UpdateCustomKeyStore for details on how to use this API operation.
  5934. //
  5935. // The context must be non-nil and will be used for request cancellation. If
  5936. // the context is nil a panic will occur. In the future the SDK may create
  5937. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  5938. // for more information on using Contexts.
  5939. func (c *KMS) UpdateCustomKeyStoreWithContext(ctx aws.Context, input *UpdateCustomKeyStoreInput, opts ...request.Option) (*UpdateCustomKeyStoreOutput, error) {
  5940. req, out := c.UpdateCustomKeyStoreRequest(input)
  5941. req.SetContext(ctx)
  5942. req.ApplyOptions(opts...)
  5943. return out, req.Send()
  5944. }
  5945. const opUpdateKeyDescription = "UpdateKeyDescription"
  5946. // UpdateKeyDescriptionRequest generates a "aws/request.Request" representing the
  5947. // client's request for the UpdateKeyDescription operation. The "output" return
  5948. // value will be populated with the request's response once the request completes
  5949. // successfully.
  5950. //
  5951. // Use "Send" method on the returned Request to send the API call to the service.
  5952. // the "output" return value is not valid until after Send returns without error.
  5953. //
  5954. // See UpdateKeyDescription for more information on using the UpdateKeyDescription
  5955. // API call, and error handling.
  5956. //
  5957. // This method is useful when you want to inject custom logic or configuration
  5958. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  5959. //
  5960. //
  5961. // // Example sending a request using the UpdateKeyDescriptionRequest method.
  5962. // req, resp := client.UpdateKeyDescriptionRequest(params)
  5963. //
  5964. // err := req.Send()
  5965. // if err == nil { // resp is now filled
  5966. // fmt.Println(resp)
  5967. // }
  5968. //
  5969. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription
  5970. func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req *request.Request, output *UpdateKeyDescriptionOutput) {
  5971. op := &request.Operation{
  5972. Name: opUpdateKeyDescription,
  5973. HTTPMethod: "POST",
  5974. HTTPPath: "/",
  5975. }
  5976. if input == nil {
  5977. input = &UpdateKeyDescriptionInput{}
  5978. }
  5979. output = &UpdateKeyDescriptionOutput{}
  5980. req = c.newRequest(op, input, output)
  5981. req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  5982. return
  5983. }
  5984. // UpdateKeyDescription API operation for AWS Key Management Service.
  5985. //
  5986. // Updates the description of a customer master key (CMK). To see the description
  5987. // of a CMK, use DescribeKey.
  5988. //
  5989. // You cannot perform this operation on a CMK in a different AWS account.
  5990. //
  5991. // The CMK that you use for this operation must be in a compatible key state.
  5992. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  5993. // in the AWS Key Management Service Developer Guide.
  5994. //
  5995. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  5996. // with awserr.Error's Code and Message methods to get detailed information about
  5997. // the error.
  5998. //
  5999. // See the AWS API reference guide for AWS Key Management Service's
  6000. // API operation UpdateKeyDescription for usage and error information.
  6001. //
  6002. // Returned Error Types:
  6003. // * NotFoundException
  6004. // The request was rejected because the specified entity or resource could not
  6005. // be found.
  6006. //
  6007. // * InvalidArnException
  6008. // The request was rejected because a specified ARN, or an ARN in a key policy,
  6009. // is not valid.
  6010. //
  6011. // * DependencyTimeoutException
  6012. // The system timed out while trying to fulfill the request. The request can
  6013. // be retried.
  6014. //
  6015. // * InternalException
  6016. // The request was rejected because an internal exception occurred. The request
  6017. // can be retried.
  6018. //
  6019. // * InvalidStateException
  6020. // The request was rejected because the state of the specified resource is not
  6021. // valid for this request.
  6022. //
  6023. // For more information about how key state affects the use of a CMK, see How
  6024. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  6025. // in the AWS Key Management Service Developer Guide .
  6026. //
  6027. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription
  6028. func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) {
  6029. req, out := c.UpdateKeyDescriptionRequest(input)
  6030. return out, req.Send()
  6031. }
  6032. // UpdateKeyDescriptionWithContext is the same as UpdateKeyDescription with the addition of
  6033. // the ability to pass a context and additional request options.
  6034. //
  6035. // See UpdateKeyDescription for details on how to use this API operation.
  6036. //
  6037. // The context must be non-nil and will be used for request cancellation. If
  6038. // the context is nil a panic will occur. In the future the SDK may create
  6039. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  6040. // for more information on using Contexts.
  6041. func (c *KMS) UpdateKeyDescriptionWithContext(ctx aws.Context, input *UpdateKeyDescriptionInput, opts ...request.Option) (*UpdateKeyDescriptionOutput, error) {
  6042. req, out := c.UpdateKeyDescriptionRequest(input)
  6043. req.SetContext(ctx)
  6044. req.ApplyOptions(opts...)
  6045. return out, req.Send()
  6046. }
  6047. const opVerify = "Verify"
  6048. // VerifyRequest generates a "aws/request.Request" representing the
  6049. // client's request for the Verify operation. The "output" return
  6050. // value will be populated with the request's response once the request completes
  6051. // successfully.
  6052. //
  6053. // Use "Send" method on the returned Request to send the API call to the service.
  6054. // the "output" return value is not valid until after Send returns without error.
  6055. //
  6056. // See Verify for more information on using the Verify
  6057. // API call, and error handling.
  6058. //
  6059. // This method is useful when you want to inject custom logic or configuration
  6060. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  6061. //
  6062. //
  6063. // // Example sending a request using the VerifyRequest method.
  6064. // req, resp := client.VerifyRequest(params)
  6065. //
  6066. // err := req.Send()
  6067. // if err == nil { // resp is now filled
  6068. // fmt.Println(resp)
  6069. // }
  6070. //
  6071. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify
  6072. func (c *KMS) VerifyRequest(input *VerifyInput) (req *request.Request, output *VerifyOutput) {
  6073. op := &request.Operation{
  6074. Name: opVerify,
  6075. HTTPMethod: "POST",
  6076. HTTPPath: "/",
  6077. }
  6078. if input == nil {
  6079. input = &VerifyInput{}
  6080. }
  6081. output = &VerifyOutput{}
  6082. req = c.newRequest(op, input, output)
  6083. return
  6084. }
  6085. // Verify API operation for AWS Key Management Service.
  6086. //
  6087. // Verifies a digital signature that was generated by the Sign operation.
  6088. //
  6089. // Verification confirms that an authorized user signed the message with the
  6090. // specified CMK and signing algorithm, and the message hasn't changed since
  6091. // it was signed. If the signature is verified, the value of the SignatureValid
  6092. // field in the response is True. If the signature verification fails, the Verify
  6093. // operation fails with an KMSInvalidSignatureException exception.
  6094. //
  6095. // A digital signature is generated by using the private key in an asymmetric
  6096. // CMK. The signature is verified by using the public key in the same asymmetric
  6097. // CMK. For information about symmetric and asymmetric CMKs, see Using Symmetric
  6098. // and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
  6099. // in the AWS Key Management Service Developer Guide.
  6100. //
  6101. // To verify a digital signature, you can use the Verify operation. Specify
  6102. // the same asymmetric CMK, message, and signing algorithm that were used to
  6103. // produce the signature.
  6104. //
  6105. // You can also verify the digital signature by using the public key of the
  6106. // CMK outside of AWS KMS. Use the GetPublicKey operation to download the public
  6107. // key in the asymmetric CMK and then use the public key to verify the signature
  6108. // outside of AWS KMS. The advantage of using the Verify operation is that it
  6109. // is performed within AWS KMS. As a result, it's easy to call, the operation
  6110. // is performed within the FIPS boundary, it is logged in AWS CloudTrail, and
  6111. // you can use key policy and IAM policy to determine who is authorized to use
  6112. // the CMK to verify signatures.
  6113. //
  6114. // The CMK that you use for this operation must be in a compatible key state.
  6115. // For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  6116. // in the AWS Key Management Service Developer Guide.
  6117. //
  6118. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  6119. // with awserr.Error's Code and Message methods to get detailed information about
  6120. // the error.
  6121. //
  6122. // See the AWS API reference guide for AWS Key Management Service's
  6123. // API operation Verify for usage and error information.
  6124. //
  6125. // Returned Error Types:
  6126. // * NotFoundException
  6127. // The request was rejected because the specified entity or resource could not
  6128. // be found.
  6129. //
  6130. // * DisabledException
  6131. // The request was rejected because the specified CMK is not enabled.
  6132. //
  6133. // * KeyUnavailableException
  6134. // The request was rejected because the specified CMK was not available. You
  6135. // can retry the request.
  6136. //
  6137. // * DependencyTimeoutException
  6138. // The system timed out while trying to fulfill the request. The request can
  6139. // be retried.
  6140. //
  6141. // * InvalidKeyUsageException
  6142. // The request was rejected for one of the following reasons:
  6143. //
  6144. // * The KeyUsage value of the CMK is incompatible with the API operation.
  6145. //
  6146. // * The encryption algorithm or signing algorithm specified for the operation
  6147. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  6148. //
  6149. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  6150. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  6151. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  6152. //
  6153. // To find the encryption or signing algorithms supported for a particular CMK,
  6154. // use the DescribeKey operation.
  6155. //
  6156. // * InvalidGrantTokenException
  6157. // The request was rejected because the specified grant token is not valid.
  6158. //
  6159. // * InternalException
  6160. // The request was rejected because an internal exception occurred. The request
  6161. // can be retried.
  6162. //
  6163. // * InvalidStateException
  6164. // The request was rejected because the state of the specified resource is not
  6165. // valid for this request.
  6166. //
  6167. // For more information about how key state affects the use of a CMK, see How
  6168. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  6169. // in the AWS Key Management Service Developer Guide .
  6170. //
  6171. // * KMSInvalidSignatureException
  6172. // The request was rejected because the signature verification failed. Signature
  6173. // verification fails when it cannot confirm that signature was produced by
  6174. // signing the specified message with the specified CMK and signing algorithm.
  6175. //
  6176. // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify
  6177. func (c *KMS) Verify(input *VerifyInput) (*VerifyOutput, error) {
  6178. req, out := c.VerifyRequest(input)
  6179. return out, req.Send()
  6180. }
  6181. // VerifyWithContext is the same as Verify with the addition of
  6182. // the ability to pass a context and additional request options.
  6183. //
  6184. // See Verify for details on how to use this API operation.
  6185. //
  6186. // The context must be non-nil and will be used for request cancellation. If
  6187. // the context is nil a panic will occur. In the future the SDK may create
  6188. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  6189. // for more information on using Contexts.
  6190. func (c *KMS) VerifyWithContext(ctx aws.Context, input *VerifyInput, opts ...request.Option) (*VerifyOutput, error) {
  6191. req, out := c.VerifyRequest(input)
  6192. req.SetContext(ctx)
  6193. req.ApplyOptions(opts...)
  6194. return out, req.Send()
  6195. }
  6196. // Contains information about an alias.
  6197. type AliasListEntry struct {
  6198. _ struct{} `type:"structure"`
  6199. // String that contains the key ARN.
  6200. AliasArn *string `min:"20" type:"string"`
  6201. // String that contains the alias. This value begins with alias/.
  6202. AliasName *string `min:"1" type:"string"`
  6203. // String that contains the key identifier referred to by the alias.
  6204. TargetKeyId *string `min:"1" type:"string"`
  6205. }
  6206. // String returns the string representation
  6207. func (s AliasListEntry) String() string {
  6208. return awsutil.Prettify(s)
  6209. }
  6210. // GoString returns the string representation
  6211. func (s AliasListEntry) GoString() string {
  6212. return s.String()
  6213. }
  6214. // SetAliasArn sets the AliasArn field's value.
  6215. func (s *AliasListEntry) SetAliasArn(v string) *AliasListEntry {
  6216. s.AliasArn = &v
  6217. return s
  6218. }
  6219. // SetAliasName sets the AliasName field's value.
  6220. func (s *AliasListEntry) SetAliasName(v string) *AliasListEntry {
  6221. s.AliasName = &v
  6222. return s
  6223. }
  6224. // SetTargetKeyId sets the TargetKeyId field's value.
  6225. func (s *AliasListEntry) SetTargetKeyId(v string) *AliasListEntry {
  6226. s.TargetKeyId = &v
  6227. return s
  6228. }
  6229. // The request was rejected because it attempted to create a resource that already
  6230. // exists.
  6231. type AlreadyExistsException struct {
  6232. _ struct{} `type:"structure"`
  6233. respMetadata protocol.ResponseMetadata
  6234. Message_ *string `locationName:"message" type:"string"`
  6235. }
  6236. // String returns the string representation
  6237. func (s AlreadyExistsException) String() string {
  6238. return awsutil.Prettify(s)
  6239. }
  6240. // GoString returns the string representation
  6241. func (s AlreadyExistsException) GoString() string {
  6242. return s.String()
  6243. }
  6244. func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error {
  6245. return &AlreadyExistsException{
  6246. respMetadata: v,
  6247. }
  6248. }
  6249. // Code returns the exception type name.
  6250. func (s AlreadyExistsException) Code() string {
  6251. return "AlreadyExistsException"
  6252. }
  6253. // Message returns the exception's message.
  6254. func (s AlreadyExistsException) Message() string {
  6255. if s.Message_ != nil {
  6256. return *s.Message_
  6257. }
  6258. return ""
  6259. }
  6260. // OrigErr always returns nil, satisfies awserr.Error interface.
  6261. func (s AlreadyExistsException) OrigErr() error {
  6262. return nil
  6263. }
  6264. func (s AlreadyExistsException) Error() string {
  6265. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  6266. }
  6267. // Status code returns the HTTP status code for the request's response error.
  6268. func (s AlreadyExistsException) StatusCode() int {
  6269. return s.respMetadata.StatusCode
  6270. }
  6271. // RequestID returns the service's response RequestID for request.
  6272. func (s AlreadyExistsException) RequestID() string {
  6273. return s.respMetadata.RequestID
  6274. }
  6275. type CancelKeyDeletionInput struct {
  6276. _ struct{} `type:"structure"`
  6277. // The unique identifier for the customer master key (CMK) for which to cancel
  6278. // deletion.
  6279. //
  6280. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  6281. //
  6282. // For example:
  6283. //
  6284. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  6285. //
  6286. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  6287. //
  6288. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  6289. //
  6290. // KeyId is a required field
  6291. KeyId *string `min:"1" type:"string" required:"true"`
  6292. }
  6293. // String returns the string representation
  6294. func (s CancelKeyDeletionInput) String() string {
  6295. return awsutil.Prettify(s)
  6296. }
  6297. // GoString returns the string representation
  6298. func (s CancelKeyDeletionInput) GoString() string {
  6299. return s.String()
  6300. }
  6301. // Validate inspects the fields of the type to determine if they are valid.
  6302. func (s *CancelKeyDeletionInput) Validate() error {
  6303. invalidParams := request.ErrInvalidParams{Context: "CancelKeyDeletionInput"}
  6304. if s.KeyId == nil {
  6305. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  6306. }
  6307. if s.KeyId != nil && len(*s.KeyId) < 1 {
  6308. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  6309. }
  6310. if invalidParams.Len() > 0 {
  6311. return invalidParams
  6312. }
  6313. return nil
  6314. }
  6315. // SetKeyId sets the KeyId field's value.
  6316. func (s *CancelKeyDeletionInput) SetKeyId(v string) *CancelKeyDeletionInput {
  6317. s.KeyId = &v
  6318. return s
  6319. }
  6320. type CancelKeyDeletionOutput struct {
  6321. _ struct{} `type:"structure"`
  6322. // The unique identifier of the master key for which deletion is canceled.
  6323. KeyId *string `min:"1" type:"string"`
  6324. }
  6325. // String returns the string representation
  6326. func (s CancelKeyDeletionOutput) String() string {
  6327. return awsutil.Prettify(s)
  6328. }
  6329. // GoString returns the string representation
  6330. func (s CancelKeyDeletionOutput) GoString() string {
  6331. return s.String()
  6332. }
  6333. // SetKeyId sets the KeyId field's value.
  6334. func (s *CancelKeyDeletionOutput) SetKeyId(v string) *CancelKeyDeletionOutput {
  6335. s.KeyId = &v
  6336. return s
  6337. }
  6338. // The request was rejected because the specified AWS CloudHSM cluster is already
  6339. // associated with a custom key store or it shares a backup history with a cluster
  6340. // that is associated with a custom key store. Each custom key store must be
  6341. // associated with a different AWS CloudHSM cluster.
  6342. //
  6343. // Clusters that share a backup history have the same cluster certificate. To
  6344. // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  6345. // operation.
  6346. type CloudHsmClusterInUseException struct {
  6347. _ struct{} `type:"structure"`
  6348. respMetadata protocol.ResponseMetadata
  6349. Message_ *string `locationName:"message" type:"string"`
  6350. }
  6351. // String returns the string representation
  6352. func (s CloudHsmClusterInUseException) String() string {
  6353. return awsutil.Prettify(s)
  6354. }
  6355. // GoString returns the string representation
  6356. func (s CloudHsmClusterInUseException) GoString() string {
  6357. return s.String()
  6358. }
  6359. func newErrorCloudHsmClusterInUseException(v protocol.ResponseMetadata) error {
  6360. return &CloudHsmClusterInUseException{
  6361. respMetadata: v,
  6362. }
  6363. }
  6364. // Code returns the exception type name.
  6365. func (s CloudHsmClusterInUseException) Code() string {
  6366. return "CloudHsmClusterInUseException"
  6367. }
  6368. // Message returns the exception's message.
  6369. func (s CloudHsmClusterInUseException) Message() string {
  6370. if s.Message_ != nil {
  6371. return *s.Message_
  6372. }
  6373. return ""
  6374. }
  6375. // OrigErr always returns nil, satisfies awserr.Error interface.
  6376. func (s CloudHsmClusterInUseException) OrigErr() error {
  6377. return nil
  6378. }
  6379. func (s CloudHsmClusterInUseException) Error() string {
  6380. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  6381. }
  6382. // Status code returns the HTTP status code for the request's response error.
  6383. func (s CloudHsmClusterInUseException) StatusCode() int {
  6384. return s.respMetadata.StatusCode
  6385. }
  6386. // RequestID returns the service's response RequestID for request.
  6387. func (s CloudHsmClusterInUseException) RequestID() string {
  6388. return s.respMetadata.RequestID
  6389. }
  6390. // The request was rejected because the associated AWS CloudHSM cluster did
  6391. // not meet the configuration requirements for a custom key store.
  6392. //
  6393. // * The cluster must be configured with private subnets in at least two
  6394. // different Availability Zones in the Region.
  6395. //
  6396. // * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  6397. // (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
  6398. // rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
  6399. // rules and the Destination in the outbound rules must match the security
  6400. // group ID. These rules are set by default when you create the cluster.
  6401. // Do not delete or change them. To get information about a particular security
  6402. // group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
  6403. // operation.
  6404. //
  6405. // * The cluster must contain at least as many HSMs as the operation requires.
  6406. // To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
  6407. // operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
  6408. // operations, the AWS CloudHSM cluster must have at least two active HSMs,
  6409. // each in a different Availability Zone. For the ConnectCustomKeyStore operation,
  6410. // the AWS CloudHSM must contain at least one active HSM.
  6411. //
  6412. // For information about the requirements for an AWS CloudHSM cluster that is
  6413. // associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  6414. // in the AWS Key Management Service Developer Guide. For information about
  6415. // creating a private subnet for an AWS CloudHSM cluster, see Create a Private
  6416. // Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
  6417. // in the AWS CloudHSM User Guide. For information about cluster security groups,
  6418. // see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
  6419. // in the AWS CloudHSM User Guide .
  6420. type CloudHsmClusterInvalidConfigurationException struct {
  6421. _ struct{} `type:"structure"`
  6422. respMetadata protocol.ResponseMetadata
  6423. Message_ *string `locationName:"message" type:"string"`
  6424. }
  6425. // String returns the string representation
  6426. func (s CloudHsmClusterInvalidConfigurationException) String() string {
  6427. return awsutil.Prettify(s)
  6428. }
  6429. // GoString returns the string representation
  6430. func (s CloudHsmClusterInvalidConfigurationException) GoString() string {
  6431. return s.String()
  6432. }
  6433. func newErrorCloudHsmClusterInvalidConfigurationException(v protocol.ResponseMetadata) error {
  6434. return &CloudHsmClusterInvalidConfigurationException{
  6435. respMetadata: v,
  6436. }
  6437. }
  6438. // Code returns the exception type name.
  6439. func (s CloudHsmClusterInvalidConfigurationException) Code() string {
  6440. return "CloudHsmClusterInvalidConfigurationException"
  6441. }
  6442. // Message returns the exception's message.
  6443. func (s CloudHsmClusterInvalidConfigurationException) Message() string {
  6444. if s.Message_ != nil {
  6445. return *s.Message_
  6446. }
  6447. return ""
  6448. }
  6449. // OrigErr always returns nil, satisfies awserr.Error interface.
  6450. func (s CloudHsmClusterInvalidConfigurationException) OrigErr() error {
  6451. return nil
  6452. }
  6453. func (s CloudHsmClusterInvalidConfigurationException) Error() string {
  6454. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  6455. }
  6456. // Status code returns the HTTP status code for the request's response error.
  6457. func (s CloudHsmClusterInvalidConfigurationException) StatusCode() int {
  6458. return s.respMetadata.StatusCode
  6459. }
  6460. // RequestID returns the service's response RequestID for request.
  6461. func (s CloudHsmClusterInvalidConfigurationException) RequestID() string {
  6462. return s.respMetadata.RequestID
  6463. }
  6464. // The request was rejected because the AWS CloudHSM cluster that is associated
  6465. // with the custom key store is not active. Initialize and activate the cluster
  6466. // and try the command again. For detailed instructions, see Getting Started
  6467. // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
  6468. // in the AWS CloudHSM User Guide.
  6469. type CloudHsmClusterNotActiveException struct {
  6470. _ struct{} `type:"structure"`
  6471. respMetadata protocol.ResponseMetadata
  6472. Message_ *string `locationName:"message" type:"string"`
  6473. }
  6474. // String returns the string representation
  6475. func (s CloudHsmClusterNotActiveException) String() string {
  6476. return awsutil.Prettify(s)
  6477. }
  6478. // GoString returns the string representation
  6479. func (s CloudHsmClusterNotActiveException) GoString() string {
  6480. return s.String()
  6481. }
  6482. func newErrorCloudHsmClusterNotActiveException(v protocol.ResponseMetadata) error {
  6483. return &CloudHsmClusterNotActiveException{
  6484. respMetadata: v,
  6485. }
  6486. }
  6487. // Code returns the exception type name.
  6488. func (s CloudHsmClusterNotActiveException) Code() string {
  6489. return "CloudHsmClusterNotActiveException"
  6490. }
  6491. // Message returns the exception's message.
  6492. func (s CloudHsmClusterNotActiveException) Message() string {
  6493. if s.Message_ != nil {
  6494. return *s.Message_
  6495. }
  6496. return ""
  6497. }
  6498. // OrigErr always returns nil, satisfies awserr.Error interface.
  6499. func (s CloudHsmClusterNotActiveException) OrigErr() error {
  6500. return nil
  6501. }
  6502. func (s CloudHsmClusterNotActiveException) Error() string {
  6503. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  6504. }
  6505. // Status code returns the HTTP status code for the request's response error.
  6506. func (s CloudHsmClusterNotActiveException) StatusCode() int {
  6507. return s.respMetadata.StatusCode
  6508. }
  6509. // RequestID returns the service's response RequestID for request.
  6510. func (s CloudHsmClusterNotActiveException) RequestID() string {
  6511. return s.respMetadata.RequestID
  6512. }
  6513. // The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster
  6514. // with the specified cluster ID. Retry the request with a different cluster
  6515. // ID.
  6516. type CloudHsmClusterNotFoundException struct {
  6517. _ struct{} `type:"structure"`
  6518. respMetadata protocol.ResponseMetadata
  6519. Message_ *string `locationName:"message" type:"string"`
  6520. }
  6521. // String returns the string representation
  6522. func (s CloudHsmClusterNotFoundException) String() string {
  6523. return awsutil.Prettify(s)
  6524. }
  6525. // GoString returns the string representation
  6526. func (s CloudHsmClusterNotFoundException) GoString() string {
  6527. return s.String()
  6528. }
  6529. func newErrorCloudHsmClusterNotFoundException(v protocol.ResponseMetadata) error {
  6530. return &CloudHsmClusterNotFoundException{
  6531. respMetadata: v,
  6532. }
  6533. }
  6534. // Code returns the exception type name.
  6535. func (s CloudHsmClusterNotFoundException) Code() string {
  6536. return "CloudHsmClusterNotFoundException"
  6537. }
  6538. // Message returns the exception's message.
  6539. func (s CloudHsmClusterNotFoundException) Message() string {
  6540. if s.Message_ != nil {
  6541. return *s.Message_
  6542. }
  6543. return ""
  6544. }
  6545. // OrigErr always returns nil, satisfies awserr.Error interface.
  6546. func (s CloudHsmClusterNotFoundException) OrigErr() error {
  6547. return nil
  6548. }
  6549. func (s CloudHsmClusterNotFoundException) Error() string {
  6550. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  6551. }
  6552. // Status code returns the HTTP status code for the request's response error.
  6553. func (s CloudHsmClusterNotFoundException) StatusCode() int {
  6554. return s.respMetadata.StatusCode
  6555. }
  6556. // RequestID returns the service's response RequestID for request.
  6557. func (s CloudHsmClusterNotFoundException) RequestID() string {
  6558. return s.respMetadata.RequestID
  6559. }
  6560. // The request was rejected because the specified AWS CloudHSM cluster has a
  6561. // different cluster certificate than the original cluster. You cannot use the
  6562. // operation to specify an unrelated cluster.
  6563. //
  6564. // Specify a cluster that shares a backup history with the original cluster.
  6565. // This includes clusters that were created from a backup of the current cluster,
  6566. // and clusters that were created from the same backup that produced the current
  6567. // cluster.
  6568. //
  6569. // Clusters that share a backup history have the same cluster certificate. To
  6570. // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  6571. // operation.
  6572. type CloudHsmClusterNotRelatedException struct {
  6573. _ struct{} `type:"structure"`
  6574. respMetadata protocol.ResponseMetadata
  6575. Message_ *string `locationName:"message" type:"string"`
  6576. }
  6577. // String returns the string representation
  6578. func (s CloudHsmClusterNotRelatedException) String() string {
  6579. return awsutil.Prettify(s)
  6580. }
  6581. // GoString returns the string representation
  6582. func (s CloudHsmClusterNotRelatedException) GoString() string {
  6583. return s.String()
  6584. }
  6585. func newErrorCloudHsmClusterNotRelatedException(v protocol.ResponseMetadata) error {
  6586. return &CloudHsmClusterNotRelatedException{
  6587. respMetadata: v,
  6588. }
  6589. }
  6590. // Code returns the exception type name.
  6591. func (s CloudHsmClusterNotRelatedException) Code() string {
  6592. return "CloudHsmClusterNotRelatedException"
  6593. }
  6594. // Message returns the exception's message.
  6595. func (s CloudHsmClusterNotRelatedException) Message() string {
  6596. if s.Message_ != nil {
  6597. return *s.Message_
  6598. }
  6599. return ""
  6600. }
  6601. // OrigErr always returns nil, satisfies awserr.Error interface.
  6602. func (s CloudHsmClusterNotRelatedException) OrigErr() error {
  6603. return nil
  6604. }
  6605. func (s CloudHsmClusterNotRelatedException) Error() string {
  6606. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  6607. }
  6608. // Status code returns the HTTP status code for the request's response error.
  6609. func (s CloudHsmClusterNotRelatedException) StatusCode() int {
  6610. return s.respMetadata.StatusCode
  6611. }
  6612. // RequestID returns the service's response RequestID for request.
  6613. func (s CloudHsmClusterNotRelatedException) RequestID() string {
  6614. return s.respMetadata.RequestID
  6615. }
  6616. type ConnectCustomKeyStoreInput struct {
  6617. _ struct{} `type:"structure"`
  6618. // Enter the key store ID of the custom key store that you want to connect.
  6619. // To find the ID of a custom key store, use the DescribeCustomKeyStores operation.
  6620. //
  6621. // CustomKeyStoreId is a required field
  6622. CustomKeyStoreId *string `min:"1" type:"string" required:"true"`
  6623. }
  6624. // String returns the string representation
  6625. func (s ConnectCustomKeyStoreInput) String() string {
  6626. return awsutil.Prettify(s)
  6627. }
  6628. // GoString returns the string representation
  6629. func (s ConnectCustomKeyStoreInput) GoString() string {
  6630. return s.String()
  6631. }
  6632. // Validate inspects the fields of the type to determine if they are valid.
  6633. func (s *ConnectCustomKeyStoreInput) Validate() error {
  6634. invalidParams := request.ErrInvalidParams{Context: "ConnectCustomKeyStoreInput"}
  6635. if s.CustomKeyStoreId == nil {
  6636. invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId"))
  6637. }
  6638. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  6639. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  6640. }
  6641. if invalidParams.Len() > 0 {
  6642. return invalidParams
  6643. }
  6644. return nil
  6645. }
  6646. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  6647. func (s *ConnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *ConnectCustomKeyStoreInput {
  6648. s.CustomKeyStoreId = &v
  6649. return s
  6650. }
  6651. type ConnectCustomKeyStoreOutput struct {
  6652. _ struct{} `type:"structure"`
  6653. }
  6654. // String returns the string representation
  6655. func (s ConnectCustomKeyStoreOutput) String() string {
  6656. return awsutil.Prettify(s)
  6657. }
  6658. // GoString returns the string representation
  6659. func (s ConnectCustomKeyStoreOutput) GoString() string {
  6660. return s.String()
  6661. }
  6662. type CreateAliasInput struct {
  6663. _ struct{} `type:"structure"`
  6664. // Specifies the alias name. This value must begin with alias/ followed by a
  6665. // name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/.
  6666. // The alias/aws/ prefix is reserved for AWS managed CMKs.
  6667. //
  6668. // AliasName is a required field
  6669. AliasName *string `min:"1" type:"string" required:"true"`
  6670. // Identifies the CMK to which the alias refers. Specify the key ID or the Amazon
  6671. // Resource Name (ARN) of the CMK. You cannot specify another alias. For help
  6672. // finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn)
  6673. // in the AWS Key Management Service Developer Guide.
  6674. //
  6675. // TargetKeyId is a required field
  6676. TargetKeyId *string `min:"1" type:"string" required:"true"`
  6677. }
  6678. // String returns the string representation
  6679. func (s CreateAliasInput) String() string {
  6680. return awsutil.Prettify(s)
  6681. }
  6682. // GoString returns the string representation
  6683. func (s CreateAliasInput) GoString() string {
  6684. return s.String()
  6685. }
  6686. // Validate inspects the fields of the type to determine if they are valid.
  6687. func (s *CreateAliasInput) Validate() error {
  6688. invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"}
  6689. if s.AliasName == nil {
  6690. invalidParams.Add(request.NewErrParamRequired("AliasName"))
  6691. }
  6692. if s.AliasName != nil && len(*s.AliasName) < 1 {
  6693. invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
  6694. }
  6695. if s.TargetKeyId == nil {
  6696. invalidParams.Add(request.NewErrParamRequired("TargetKeyId"))
  6697. }
  6698. if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 {
  6699. invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1))
  6700. }
  6701. if invalidParams.Len() > 0 {
  6702. return invalidParams
  6703. }
  6704. return nil
  6705. }
  6706. // SetAliasName sets the AliasName field's value.
  6707. func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput {
  6708. s.AliasName = &v
  6709. return s
  6710. }
  6711. // SetTargetKeyId sets the TargetKeyId field's value.
  6712. func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput {
  6713. s.TargetKeyId = &v
  6714. return s
  6715. }
  6716. type CreateAliasOutput struct {
  6717. _ struct{} `type:"structure"`
  6718. }
  6719. // String returns the string representation
  6720. func (s CreateAliasOutput) String() string {
  6721. return awsutil.Prettify(s)
  6722. }
  6723. // GoString returns the string representation
  6724. func (s CreateAliasOutput) GoString() string {
  6725. return s.String()
  6726. }
  6727. type CreateCustomKeyStoreInput struct {
  6728. _ struct{} `type:"structure"`
  6729. // Identifies the AWS CloudHSM cluster for the custom key store. Enter the cluster
  6730. // ID of any active AWS CloudHSM cluster that is not already associated with
  6731. // a custom key store. To find the cluster ID, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  6732. // operation.
  6733. //
  6734. // CloudHsmClusterId is a required field
  6735. CloudHsmClusterId *string `min:"19" type:"string" required:"true"`
  6736. // Specifies a friendly name for the custom key store. The name must be unique
  6737. // in your AWS account.
  6738. //
  6739. // CustomKeyStoreName is a required field
  6740. CustomKeyStoreName *string `min:"1" type:"string" required:"true"`
  6741. // Enter the password of the kmsuser crypto user (CU) account (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser)
  6742. // in the specified AWS CloudHSM cluster. AWS KMS logs into the cluster as this
  6743. // user to manage key material on your behalf.
  6744. //
  6745. // This parameter tells AWS KMS the kmsuser account password; it does not change
  6746. // the password in the AWS CloudHSM cluster.
  6747. //
  6748. // KeyStorePassword is a required field
  6749. KeyStorePassword *string `min:"1" type:"string" required:"true" sensitive:"true"`
  6750. // Enter the content of the trust anchor certificate for the cluster. This is
  6751. // the content of the customerCA.crt file that you created when you initialized
  6752. // the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html).
  6753. //
  6754. // TrustAnchorCertificate is a required field
  6755. TrustAnchorCertificate *string `min:"1" type:"string" required:"true"`
  6756. }
  6757. // String returns the string representation
  6758. func (s CreateCustomKeyStoreInput) String() string {
  6759. return awsutil.Prettify(s)
  6760. }
  6761. // GoString returns the string representation
  6762. func (s CreateCustomKeyStoreInput) GoString() string {
  6763. return s.String()
  6764. }
  6765. // Validate inspects the fields of the type to determine if they are valid.
  6766. func (s *CreateCustomKeyStoreInput) Validate() error {
  6767. invalidParams := request.ErrInvalidParams{Context: "CreateCustomKeyStoreInput"}
  6768. if s.CloudHsmClusterId == nil {
  6769. invalidParams.Add(request.NewErrParamRequired("CloudHsmClusterId"))
  6770. }
  6771. if s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId) < 19 {
  6772. invalidParams.Add(request.NewErrParamMinLen("CloudHsmClusterId", 19))
  6773. }
  6774. if s.CustomKeyStoreName == nil {
  6775. invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreName"))
  6776. }
  6777. if s.CustomKeyStoreName != nil && len(*s.CustomKeyStoreName) < 1 {
  6778. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreName", 1))
  6779. }
  6780. if s.KeyStorePassword == nil {
  6781. invalidParams.Add(request.NewErrParamRequired("KeyStorePassword"))
  6782. }
  6783. if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 1 {
  6784. invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 1))
  6785. }
  6786. if s.TrustAnchorCertificate == nil {
  6787. invalidParams.Add(request.NewErrParamRequired("TrustAnchorCertificate"))
  6788. }
  6789. if s.TrustAnchorCertificate != nil && len(*s.TrustAnchorCertificate) < 1 {
  6790. invalidParams.Add(request.NewErrParamMinLen("TrustAnchorCertificate", 1))
  6791. }
  6792. if invalidParams.Len() > 0 {
  6793. return invalidParams
  6794. }
  6795. return nil
  6796. }
  6797. // SetCloudHsmClusterId sets the CloudHsmClusterId field's value.
  6798. func (s *CreateCustomKeyStoreInput) SetCloudHsmClusterId(v string) *CreateCustomKeyStoreInput {
  6799. s.CloudHsmClusterId = &v
  6800. return s
  6801. }
  6802. // SetCustomKeyStoreName sets the CustomKeyStoreName field's value.
  6803. func (s *CreateCustomKeyStoreInput) SetCustomKeyStoreName(v string) *CreateCustomKeyStoreInput {
  6804. s.CustomKeyStoreName = &v
  6805. return s
  6806. }
  6807. // SetKeyStorePassword sets the KeyStorePassword field's value.
  6808. func (s *CreateCustomKeyStoreInput) SetKeyStorePassword(v string) *CreateCustomKeyStoreInput {
  6809. s.KeyStorePassword = &v
  6810. return s
  6811. }
  6812. // SetTrustAnchorCertificate sets the TrustAnchorCertificate field's value.
  6813. func (s *CreateCustomKeyStoreInput) SetTrustAnchorCertificate(v string) *CreateCustomKeyStoreInput {
  6814. s.TrustAnchorCertificate = &v
  6815. return s
  6816. }
  6817. type CreateCustomKeyStoreOutput struct {
  6818. _ struct{} `type:"structure"`
  6819. // A unique identifier for the new custom key store.
  6820. CustomKeyStoreId *string `min:"1" type:"string"`
  6821. }
  6822. // String returns the string representation
  6823. func (s CreateCustomKeyStoreOutput) String() string {
  6824. return awsutil.Prettify(s)
  6825. }
  6826. // GoString returns the string representation
  6827. func (s CreateCustomKeyStoreOutput) GoString() string {
  6828. return s.String()
  6829. }
  6830. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  6831. func (s *CreateCustomKeyStoreOutput) SetCustomKeyStoreId(v string) *CreateCustomKeyStoreOutput {
  6832. s.CustomKeyStoreId = &v
  6833. return s
  6834. }
  6835. type CreateGrantInput struct {
  6836. _ struct{} `type:"structure"`
  6837. // Allows a cryptographic operation only when the encryption context matches
  6838. // or includes the encryption context specified in this structure. For more
  6839. // information about encryption context, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  6840. // in the AWS Key Management Service Developer Guide .
  6841. Constraints *GrantConstraints `type:"structure"`
  6842. // A list of grant tokens.
  6843. //
  6844. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  6845. // in the AWS Key Management Service Developer Guide.
  6846. GrantTokens []*string `type:"list"`
  6847. // The principal that is given permission to perform the operations that the
  6848. // grant permits.
  6849. //
  6850. // To specify the principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  6851. // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM
  6852. // users, IAM roles, federated users, and assumed role users. For examples of
  6853. // the ARN syntax to use for specifying a principal, see AWS Identity and Access
  6854. // Management (IAM) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
  6855. // in the Example ARNs section of the AWS General Reference.
  6856. //
  6857. // GranteePrincipal is a required field
  6858. GranteePrincipal *string `min:"1" type:"string" required:"true"`
  6859. // The unique identifier for the customer master key (CMK) that the grant applies
  6860. // to.
  6861. //
  6862. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify
  6863. // a CMK in a different AWS account, you must use the key ARN.
  6864. //
  6865. // For example:
  6866. //
  6867. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  6868. //
  6869. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  6870. //
  6871. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  6872. //
  6873. // KeyId is a required field
  6874. KeyId *string `min:"1" type:"string" required:"true"`
  6875. // A friendly name for identifying the grant. Use this value to prevent the
  6876. // unintended creation of duplicate grants when retrying this request.
  6877. //
  6878. // When this value is absent, all CreateGrant requests result in a new grant
  6879. // with a unique GrantId even if all the supplied parameters are identical.
  6880. // This can result in unintended duplicates when you retry the CreateGrant request.
  6881. //
  6882. // When this value is present, you can retry a CreateGrant request with identical
  6883. // parameters; if the grant already exists, the original GrantId is returned
  6884. // without creating a new grant. Note that the returned grant token is unique
  6885. // with every CreateGrant request, even when a duplicate GrantId is returned.
  6886. // All grant tokens obtained in this way can be used interchangeably.
  6887. Name *string `min:"1" type:"string"`
  6888. // A list of operations that the grant permits.
  6889. //
  6890. // Operations is a required field
  6891. Operations []*string `type:"list" required:"true"`
  6892. // The principal that is given permission to retire the grant by using RetireGrant
  6893. // operation.
  6894. //
  6895. // To specify the principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  6896. // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM
  6897. // users, federated users, and assumed role users. For examples of the ARN syntax
  6898. // to use for specifying a principal, see AWS Identity and Access Management
  6899. // (IAM) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
  6900. // in the Example ARNs section of the AWS General Reference.
  6901. RetiringPrincipal *string `min:"1" type:"string"`
  6902. }
  6903. // String returns the string representation
  6904. func (s CreateGrantInput) String() string {
  6905. return awsutil.Prettify(s)
  6906. }
  6907. // GoString returns the string representation
  6908. func (s CreateGrantInput) GoString() string {
  6909. return s.String()
  6910. }
  6911. // Validate inspects the fields of the type to determine if they are valid.
  6912. func (s *CreateGrantInput) Validate() error {
  6913. invalidParams := request.ErrInvalidParams{Context: "CreateGrantInput"}
  6914. if s.GranteePrincipal == nil {
  6915. invalidParams.Add(request.NewErrParamRequired("GranteePrincipal"))
  6916. }
  6917. if s.GranteePrincipal != nil && len(*s.GranteePrincipal) < 1 {
  6918. invalidParams.Add(request.NewErrParamMinLen("GranteePrincipal", 1))
  6919. }
  6920. if s.KeyId == nil {
  6921. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  6922. }
  6923. if s.KeyId != nil && len(*s.KeyId) < 1 {
  6924. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  6925. }
  6926. if s.Name != nil && len(*s.Name) < 1 {
  6927. invalidParams.Add(request.NewErrParamMinLen("Name", 1))
  6928. }
  6929. if s.Operations == nil {
  6930. invalidParams.Add(request.NewErrParamRequired("Operations"))
  6931. }
  6932. if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 {
  6933. invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1))
  6934. }
  6935. if invalidParams.Len() > 0 {
  6936. return invalidParams
  6937. }
  6938. return nil
  6939. }
  6940. // SetConstraints sets the Constraints field's value.
  6941. func (s *CreateGrantInput) SetConstraints(v *GrantConstraints) *CreateGrantInput {
  6942. s.Constraints = v
  6943. return s
  6944. }
  6945. // SetGrantTokens sets the GrantTokens field's value.
  6946. func (s *CreateGrantInput) SetGrantTokens(v []*string) *CreateGrantInput {
  6947. s.GrantTokens = v
  6948. return s
  6949. }
  6950. // SetGranteePrincipal sets the GranteePrincipal field's value.
  6951. func (s *CreateGrantInput) SetGranteePrincipal(v string) *CreateGrantInput {
  6952. s.GranteePrincipal = &v
  6953. return s
  6954. }
  6955. // SetKeyId sets the KeyId field's value.
  6956. func (s *CreateGrantInput) SetKeyId(v string) *CreateGrantInput {
  6957. s.KeyId = &v
  6958. return s
  6959. }
  6960. // SetName sets the Name field's value.
  6961. func (s *CreateGrantInput) SetName(v string) *CreateGrantInput {
  6962. s.Name = &v
  6963. return s
  6964. }
  6965. // SetOperations sets the Operations field's value.
  6966. func (s *CreateGrantInput) SetOperations(v []*string) *CreateGrantInput {
  6967. s.Operations = v
  6968. return s
  6969. }
  6970. // SetRetiringPrincipal sets the RetiringPrincipal field's value.
  6971. func (s *CreateGrantInput) SetRetiringPrincipal(v string) *CreateGrantInput {
  6972. s.RetiringPrincipal = &v
  6973. return s
  6974. }
  6975. type CreateGrantOutput struct {
  6976. _ struct{} `type:"structure"`
  6977. // The unique identifier for the grant.
  6978. //
  6979. // You can use the GrantId in a subsequent RetireGrant or RevokeGrant operation.
  6980. GrantId *string `min:"1" type:"string"`
  6981. // The grant token.
  6982. //
  6983. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  6984. // in the AWS Key Management Service Developer Guide.
  6985. GrantToken *string `min:"1" type:"string"`
  6986. }
  6987. // String returns the string representation
  6988. func (s CreateGrantOutput) String() string {
  6989. return awsutil.Prettify(s)
  6990. }
  6991. // GoString returns the string representation
  6992. func (s CreateGrantOutput) GoString() string {
  6993. return s.String()
  6994. }
  6995. // SetGrantId sets the GrantId field's value.
  6996. func (s *CreateGrantOutput) SetGrantId(v string) *CreateGrantOutput {
  6997. s.GrantId = &v
  6998. return s
  6999. }
  7000. // SetGrantToken sets the GrantToken field's value.
  7001. func (s *CreateGrantOutput) SetGrantToken(v string) *CreateGrantOutput {
  7002. s.GrantToken = &v
  7003. return s
  7004. }
  7005. type CreateKeyInput struct {
  7006. _ struct{} `type:"structure"`
  7007. // A flag to indicate whether to bypass the key policy lockout safety check.
  7008. //
  7009. // Setting this value to true increases the risk that the CMK becomes unmanageable.
  7010. // Do not set this value to true indiscriminately.
  7011. //
  7012. // For more information, refer to the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  7013. // section in the AWS Key Management Service Developer Guide .
  7014. //
  7015. // Use this parameter only when you include a policy in the request and you
  7016. // intend to prevent the principal that is making the request from making a
  7017. // subsequent PutKeyPolicy request on the CMK.
  7018. //
  7019. // The default value is false.
  7020. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
  7021. // Creates the CMK in the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  7022. // and the key material in its associated AWS CloudHSM cluster. To create a
  7023. // CMK in a custom key store, you must also specify the Origin parameter with
  7024. // a value of AWS_CLOUDHSM. The AWS CloudHSM cluster that is associated with
  7025. // the custom key store must have at least two active HSMs, each in a different
  7026. // Availability Zone in the Region.
  7027. //
  7028. // This parameter is valid only for symmetric CMKs. You cannot create an asymmetric
  7029. // CMK in a custom key store.
  7030. //
  7031. // To find the ID of a custom key store, use the DescribeCustomKeyStores operation.
  7032. //
  7033. // The response includes the custom key store ID and the ID of the AWS CloudHSM
  7034. // cluster.
  7035. //
  7036. // This operation is part of the Custom Key Store feature (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  7037. // feature in AWS KMS, which combines the convenience and extensive integration
  7038. // of AWS KMS with the isolation and control of a single-tenant key store.
  7039. CustomKeyStoreId *string `min:"1" type:"string"`
  7040. // Specifies the type of CMK to create. The CustomerMasterKeySpec determines
  7041. // whether the CMK contains a symmetric key or an asymmetric key pair. It also
  7042. // determines the encryption algorithms or signing algorithms that the CMK supports.
  7043. // You can't change the CustomerMasterKeySpec after the CMK is created. To further
  7044. // restrict the algorithms that can be used with the CMK, use its key policy
  7045. // or IAM policy.
  7046. //
  7047. // For help with choosing a key spec for your CMK, see Selecting a Customer
  7048. // Master Key Spec (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#cmk-key-spec)
  7049. // in the AWS Key Management Service Developer Guide.
  7050. //
  7051. // The default value, SYMMETRIC_DEFAULT, creates a CMK with a 256-bit symmetric
  7052. // key.
  7053. //
  7054. // AWS KMS supports the following key specs for CMKs:
  7055. //
  7056. // * Symmetric key (default) SYMMETRIC_DEFAULT (AES-256-GCM)
  7057. //
  7058. // * Asymmetric RSA key pairs RSA_2048 RSA_3072 RSA_4096
  7059. //
  7060. // * Asymmetric NIST-recommended elliptic curve key pairs ECC_NIST_P256 (secp256r1)
  7061. // ECC_NIST_P384 (secp384r1) ECC_NIST_P521 (secp521r1)
  7062. //
  7063. // * Other asymmetric elliptic curve key pairs ECC_SECG_P256K1 (secp256k1),
  7064. // commonly used for cryptocurrencies.
  7065. CustomerMasterKeySpec *string `type:"string" enum:"CustomerMasterKeySpec"`
  7066. // A description of the CMK.
  7067. //
  7068. // Use a description that helps you decide whether the CMK is appropriate for
  7069. // a task.
  7070. Description *string `type:"string"`
  7071. // Determines the cryptographic operations for which you can use the CMK. The
  7072. // default value is ENCRYPT_DECRYPT. This parameter is required only for asymmetric
  7073. // CMKs. You can't change the KeyUsage value after the CMK is created.
  7074. //
  7075. // Select only one valid value.
  7076. //
  7077. // * For symmetric CMKs, omit the parameter or specify ENCRYPT_DECRYPT.
  7078. //
  7079. // * For asymmetric CMKs with RSA key material, specify ENCRYPT_DECRYPT or
  7080. // SIGN_VERIFY.
  7081. //
  7082. // * For asymmetric CMKs with ECC key material, specify SIGN_VERIFY.
  7083. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  7084. // The source of the key material for the CMK. You cannot change the origin
  7085. // after you create the CMK. The default is AWS_KMS, which means AWS KMS creates
  7086. // the key material.
  7087. //
  7088. // When the parameter value is EXTERNAL, AWS KMS creates a CMK without key material
  7089. // so that you can import key material from your existing key management infrastructure.
  7090. // For more information about importing key material into AWS KMS, see Importing
  7091. // Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)
  7092. // in the AWS Key Management Service Developer Guide. This value is valid only
  7093. // for symmetric CMKs.
  7094. //
  7095. // When the parameter value is AWS_CLOUDHSM, AWS KMS creates the CMK in an AWS
  7096. // KMS custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  7097. // and creates its key material in the associated AWS CloudHSM cluster. You
  7098. // must also use the CustomKeyStoreId parameter to identify the custom key store.
  7099. // This value is valid only for symmetric CMKs.
  7100. Origin *string `type:"string" enum:"OriginType"`
  7101. // The key policy to attach to the CMK.
  7102. //
  7103. // If you provide a key policy, it must meet the following criteria:
  7104. //
  7105. // * If you don't set BypassPolicyLockoutSafetyCheck to true, the key policy
  7106. // must allow the principal that is making the CreateKey request to make
  7107. // a subsequent PutKeyPolicy request on the CMK. This reduces the risk that
  7108. // the CMK becomes unmanageable. For more information, refer to the scenario
  7109. // in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  7110. // section of the AWS Key Management Service Developer Guide .
  7111. //
  7112. // * Each statement in the key policy must contain one or more principals.
  7113. // The principals in the key policy must exist and be visible to AWS KMS.
  7114. // When you create a new AWS principal (for example, an IAM user or role),
  7115. // you might need to enforce a delay before including the new principal in
  7116. // a key policy because the new principal might not be immediately visible
  7117. // to AWS KMS. For more information, see Changes that I make are not always
  7118. // immediately visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency)
  7119. // in the AWS Identity and Access Management User Guide.
  7120. //
  7121. // If you do not provide a key policy, AWS KMS attaches a default key policy
  7122. // to the CMK. For more information, see Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default)
  7123. // in the AWS Key Management Service Developer Guide.
  7124. //
  7125. // The key policy size limit is 32 kilobytes (32768 bytes).
  7126. Policy *string `min:"1" type:"string"`
  7127. // One or more tags. Each tag consists of a tag key and a tag value. Both the
  7128. // tag key and the tag value are required, but the tag value can be an empty
  7129. // (null) string.
  7130. //
  7131. // When you add tags to an AWS resource, AWS generates a cost allocation report
  7132. // with usage and costs aggregated by tags. For information about adding, changing,
  7133. // deleting and listing tags for CMKs, see Tagging Keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html).
  7134. //
  7135. // Use this parameter to tag the CMK when it is created. To add tags to an existing
  7136. // CMK, use the TagResource operation.
  7137. Tags []*Tag `type:"list"`
  7138. }
  7139. // String returns the string representation
  7140. func (s CreateKeyInput) String() string {
  7141. return awsutil.Prettify(s)
  7142. }
  7143. // GoString returns the string representation
  7144. func (s CreateKeyInput) GoString() string {
  7145. return s.String()
  7146. }
  7147. // Validate inspects the fields of the type to determine if they are valid.
  7148. func (s *CreateKeyInput) Validate() error {
  7149. invalidParams := request.ErrInvalidParams{Context: "CreateKeyInput"}
  7150. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  7151. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  7152. }
  7153. if s.Policy != nil && len(*s.Policy) < 1 {
  7154. invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
  7155. }
  7156. if s.Tags != nil {
  7157. for i, v := range s.Tags {
  7158. if v == nil {
  7159. continue
  7160. }
  7161. if err := v.Validate(); err != nil {
  7162. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
  7163. }
  7164. }
  7165. }
  7166. if invalidParams.Len() > 0 {
  7167. return invalidParams
  7168. }
  7169. return nil
  7170. }
  7171. // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value.
  7172. func (s *CreateKeyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *CreateKeyInput {
  7173. s.BypassPolicyLockoutSafetyCheck = &v
  7174. return s
  7175. }
  7176. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  7177. func (s *CreateKeyInput) SetCustomKeyStoreId(v string) *CreateKeyInput {
  7178. s.CustomKeyStoreId = &v
  7179. return s
  7180. }
  7181. // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value.
  7182. func (s *CreateKeyInput) SetCustomerMasterKeySpec(v string) *CreateKeyInput {
  7183. s.CustomerMasterKeySpec = &v
  7184. return s
  7185. }
  7186. // SetDescription sets the Description field's value.
  7187. func (s *CreateKeyInput) SetDescription(v string) *CreateKeyInput {
  7188. s.Description = &v
  7189. return s
  7190. }
  7191. // SetKeyUsage sets the KeyUsage field's value.
  7192. func (s *CreateKeyInput) SetKeyUsage(v string) *CreateKeyInput {
  7193. s.KeyUsage = &v
  7194. return s
  7195. }
  7196. // SetOrigin sets the Origin field's value.
  7197. func (s *CreateKeyInput) SetOrigin(v string) *CreateKeyInput {
  7198. s.Origin = &v
  7199. return s
  7200. }
  7201. // SetPolicy sets the Policy field's value.
  7202. func (s *CreateKeyInput) SetPolicy(v string) *CreateKeyInput {
  7203. s.Policy = &v
  7204. return s
  7205. }
  7206. // SetTags sets the Tags field's value.
  7207. func (s *CreateKeyInput) SetTags(v []*Tag) *CreateKeyInput {
  7208. s.Tags = v
  7209. return s
  7210. }
  7211. type CreateKeyOutput struct {
  7212. _ struct{} `type:"structure"`
  7213. // Metadata associated with the CMK.
  7214. KeyMetadata *KeyMetadata `type:"structure"`
  7215. }
  7216. // String returns the string representation
  7217. func (s CreateKeyOutput) String() string {
  7218. return awsutil.Prettify(s)
  7219. }
  7220. // GoString returns the string representation
  7221. func (s CreateKeyOutput) GoString() string {
  7222. return s.String()
  7223. }
  7224. // SetKeyMetadata sets the KeyMetadata field's value.
  7225. func (s *CreateKeyOutput) SetKeyMetadata(v *KeyMetadata) *CreateKeyOutput {
  7226. s.KeyMetadata = v
  7227. return s
  7228. }
  7229. // The request was rejected because the custom key store contains AWS KMS customer
  7230. // master keys (CMKs). After verifying that you do not need to use the CMKs,
  7231. // use the ScheduleKeyDeletion operation to delete the CMKs. After they are
  7232. // deleted, you can delete the custom key store.
  7233. type CustomKeyStoreHasCMKsException struct {
  7234. _ struct{} `type:"structure"`
  7235. respMetadata protocol.ResponseMetadata
  7236. Message_ *string `locationName:"message" type:"string"`
  7237. }
  7238. // String returns the string representation
  7239. func (s CustomKeyStoreHasCMKsException) String() string {
  7240. return awsutil.Prettify(s)
  7241. }
  7242. // GoString returns the string representation
  7243. func (s CustomKeyStoreHasCMKsException) GoString() string {
  7244. return s.String()
  7245. }
  7246. func newErrorCustomKeyStoreHasCMKsException(v protocol.ResponseMetadata) error {
  7247. return &CustomKeyStoreHasCMKsException{
  7248. respMetadata: v,
  7249. }
  7250. }
  7251. // Code returns the exception type name.
  7252. func (s CustomKeyStoreHasCMKsException) Code() string {
  7253. return "CustomKeyStoreHasCMKsException"
  7254. }
  7255. // Message returns the exception's message.
  7256. func (s CustomKeyStoreHasCMKsException) Message() string {
  7257. if s.Message_ != nil {
  7258. return *s.Message_
  7259. }
  7260. return ""
  7261. }
  7262. // OrigErr always returns nil, satisfies awserr.Error interface.
  7263. func (s CustomKeyStoreHasCMKsException) OrigErr() error {
  7264. return nil
  7265. }
  7266. func (s CustomKeyStoreHasCMKsException) Error() string {
  7267. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  7268. }
  7269. // Status code returns the HTTP status code for the request's response error.
  7270. func (s CustomKeyStoreHasCMKsException) StatusCode() int {
  7271. return s.respMetadata.StatusCode
  7272. }
  7273. // RequestID returns the service's response RequestID for request.
  7274. func (s CustomKeyStoreHasCMKsException) RequestID() string {
  7275. return s.respMetadata.RequestID
  7276. }
  7277. // The request was rejected because of the ConnectionState of the custom key
  7278. // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
  7279. // operation.
  7280. //
  7281. // This exception is thrown under the following conditions:
  7282. //
  7283. // * You requested the CreateKey or GenerateRandom operation in a custom
  7284. // key store that is not connected. These operations are valid only when
  7285. // the custom key store ConnectionState is CONNECTED.
  7286. //
  7287. // * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
  7288. // on a custom key store that is not disconnected. This operation is valid
  7289. // only when the custom key store ConnectionState is DISCONNECTED.
  7290. //
  7291. // * You requested the ConnectCustomKeyStore operation on a custom key store
  7292. // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
  7293. // for all other ConnectionState values.
  7294. type CustomKeyStoreInvalidStateException struct {
  7295. _ struct{} `type:"structure"`
  7296. respMetadata protocol.ResponseMetadata
  7297. Message_ *string `locationName:"message" type:"string"`
  7298. }
  7299. // String returns the string representation
  7300. func (s CustomKeyStoreInvalidStateException) String() string {
  7301. return awsutil.Prettify(s)
  7302. }
  7303. // GoString returns the string representation
  7304. func (s CustomKeyStoreInvalidStateException) GoString() string {
  7305. return s.String()
  7306. }
  7307. func newErrorCustomKeyStoreInvalidStateException(v protocol.ResponseMetadata) error {
  7308. return &CustomKeyStoreInvalidStateException{
  7309. respMetadata: v,
  7310. }
  7311. }
  7312. // Code returns the exception type name.
  7313. func (s CustomKeyStoreInvalidStateException) Code() string {
  7314. return "CustomKeyStoreInvalidStateException"
  7315. }
  7316. // Message returns the exception's message.
  7317. func (s CustomKeyStoreInvalidStateException) Message() string {
  7318. if s.Message_ != nil {
  7319. return *s.Message_
  7320. }
  7321. return ""
  7322. }
  7323. // OrigErr always returns nil, satisfies awserr.Error interface.
  7324. func (s CustomKeyStoreInvalidStateException) OrigErr() error {
  7325. return nil
  7326. }
  7327. func (s CustomKeyStoreInvalidStateException) Error() string {
  7328. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  7329. }
  7330. // Status code returns the HTTP status code for the request's response error.
  7331. func (s CustomKeyStoreInvalidStateException) StatusCode() int {
  7332. return s.respMetadata.StatusCode
  7333. }
  7334. // RequestID returns the service's response RequestID for request.
  7335. func (s CustomKeyStoreInvalidStateException) RequestID() string {
  7336. return s.respMetadata.RequestID
  7337. }
  7338. // The request was rejected because the specified custom key store name is already
  7339. // assigned to another custom key store in the account. Try again with a custom
  7340. // key store name that is unique in the account.
  7341. type CustomKeyStoreNameInUseException struct {
  7342. _ struct{} `type:"structure"`
  7343. respMetadata protocol.ResponseMetadata
  7344. Message_ *string `locationName:"message" type:"string"`
  7345. }
  7346. // String returns the string representation
  7347. func (s CustomKeyStoreNameInUseException) String() string {
  7348. return awsutil.Prettify(s)
  7349. }
  7350. // GoString returns the string representation
  7351. func (s CustomKeyStoreNameInUseException) GoString() string {
  7352. return s.String()
  7353. }
  7354. func newErrorCustomKeyStoreNameInUseException(v protocol.ResponseMetadata) error {
  7355. return &CustomKeyStoreNameInUseException{
  7356. respMetadata: v,
  7357. }
  7358. }
  7359. // Code returns the exception type name.
  7360. func (s CustomKeyStoreNameInUseException) Code() string {
  7361. return "CustomKeyStoreNameInUseException"
  7362. }
  7363. // Message returns the exception's message.
  7364. func (s CustomKeyStoreNameInUseException) Message() string {
  7365. if s.Message_ != nil {
  7366. return *s.Message_
  7367. }
  7368. return ""
  7369. }
  7370. // OrigErr always returns nil, satisfies awserr.Error interface.
  7371. func (s CustomKeyStoreNameInUseException) OrigErr() error {
  7372. return nil
  7373. }
  7374. func (s CustomKeyStoreNameInUseException) Error() string {
  7375. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  7376. }
  7377. // Status code returns the HTTP status code for the request's response error.
  7378. func (s CustomKeyStoreNameInUseException) StatusCode() int {
  7379. return s.respMetadata.StatusCode
  7380. }
  7381. // RequestID returns the service's response RequestID for request.
  7382. func (s CustomKeyStoreNameInUseException) RequestID() string {
  7383. return s.respMetadata.RequestID
  7384. }
  7385. // The request was rejected because AWS KMS cannot find a custom key store with
  7386. // the specified key store name or ID.
  7387. type CustomKeyStoreNotFoundException struct {
  7388. _ struct{} `type:"structure"`
  7389. respMetadata protocol.ResponseMetadata
  7390. Message_ *string `locationName:"message" type:"string"`
  7391. }
  7392. // String returns the string representation
  7393. func (s CustomKeyStoreNotFoundException) String() string {
  7394. return awsutil.Prettify(s)
  7395. }
  7396. // GoString returns the string representation
  7397. func (s CustomKeyStoreNotFoundException) GoString() string {
  7398. return s.String()
  7399. }
  7400. func newErrorCustomKeyStoreNotFoundException(v protocol.ResponseMetadata) error {
  7401. return &CustomKeyStoreNotFoundException{
  7402. respMetadata: v,
  7403. }
  7404. }
  7405. // Code returns the exception type name.
  7406. func (s CustomKeyStoreNotFoundException) Code() string {
  7407. return "CustomKeyStoreNotFoundException"
  7408. }
  7409. // Message returns the exception's message.
  7410. func (s CustomKeyStoreNotFoundException) Message() string {
  7411. if s.Message_ != nil {
  7412. return *s.Message_
  7413. }
  7414. return ""
  7415. }
  7416. // OrigErr always returns nil, satisfies awserr.Error interface.
  7417. func (s CustomKeyStoreNotFoundException) OrigErr() error {
  7418. return nil
  7419. }
  7420. func (s CustomKeyStoreNotFoundException) Error() string {
  7421. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  7422. }
  7423. // Status code returns the HTTP status code for the request's response error.
  7424. func (s CustomKeyStoreNotFoundException) StatusCode() int {
  7425. return s.respMetadata.StatusCode
  7426. }
  7427. // RequestID returns the service's response RequestID for request.
  7428. func (s CustomKeyStoreNotFoundException) RequestID() string {
  7429. return s.respMetadata.RequestID
  7430. }
  7431. // Contains information about each custom key store in the custom key store
  7432. // list.
  7433. type CustomKeyStoresListEntry struct {
  7434. _ struct{} `type:"structure"`
  7435. // A unique identifier for the AWS CloudHSM cluster that is associated with
  7436. // the custom key store.
  7437. CloudHsmClusterId *string `min:"19" type:"string"`
  7438. // Describes the connection error. Valid values are:
  7439. //
  7440. // * CLUSTER_NOT_FOUND - AWS KMS cannot find the AWS CloudHSM cluster with
  7441. // the specified cluster ID.
  7442. //
  7443. // * INSUFFICIENT_CLOUDHSM_HSMS - The associated AWS CloudHSM cluster does
  7444. // not contain any active HSMs. To connect a custom key store to its AWS
  7445. // CloudHSM cluster, the cluster must contain at least one active HSM.
  7446. //
  7447. // * INTERNAL_ERROR - AWS KMS could not complete the request due to an internal
  7448. // error. Retry the request. For ConnectCustomKeyStore requests, disconnect
  7449. // the custom key store before trying to connect again.
  7450. //
  7451. // * INVALID_CREDENTIALS - AWS KMS does not have the correct password for
  7452. // the kmsuser crypto user in the AWS CloudHSM cluster.
  7453. //
  7454. // * NETWORK_ERRORS - Network errors are preventing AWS KMS from connecting
  7455. // to the custom key store.
  7456. //
  7457. // * USER_LOCKED_OUT - The kmsuser CU account is locked out of the associated
  7458. // AWS CloudHSM cluster due to too many failed password attempts. Before
  7459. // you can connect your custom key store to its AWS CloudHSM cluster, you
  7460. // must change the kmsuser account password and update the password value
  7461. // for the custom key store.
  7462. //
  7463. // For help with connection failures, see Troubleshooting Custom Key Stores
  7464. // (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html)
  7465. // in the AWS Key Management Service Developer Guide.
  7466. ConnectionErrorCode *string `type:"string" enum:"ConnectionErrorCodeType"`
  7467. // Indicates whether the custom key store is connected to its AWS CloudHSM cluster.
  7468. //
  7469. // You can create and use CMKs in your custom key stores only when its connection
  7470. // state is CONNECTED.
  7471. //
  7472. // The value is DISCONNECTED if the key store has never been connected or you
  7473. // use the DisconnectCustomKeyStore operation to disconnect it. If the value
  7474. // is CONNECTED but you are having trouble using the custom key store, make
  7475. // sure that its associated AWS CloudHSM cluster is active and contains at least
  7476. // one active HSM.
  7477. //
  7478. // A value of FAILED indicates that an attempt to connect was unsuccessful.
  7479. // For help resolving a connection failure, see Troubleshooting a Custom Key
  7480. // Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html)
  7481. // in the AWS Key Management Service Developer Guide.
  7482. ConnectionState *string `type:"string" enum:"ConnectionStateType"`
  7483. // The date and time when the custom key store was created.
  7484. CreationDate *time.Time `type:"timestamp"`
  7485. // A unique identifier for the custom key store.
  7486. CustomKeyStoreId *string `min:"1" type:"string"`
  7487. // The user-specified friendly name for the custom key store.
  7488. CustomKeyStoreName *string `min:"1" type:"string"`
  7489. // The trust anchor certificate of the associated AWS CloudHSM cluster. When
  7490. // you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr),
  7491. // you create this certificate and save it in the customerCA.crt file.
  7492. TrustAnchorCertificate *string `min:"1" type:"string"`
  7493. }
  7494. // String returns the string representation
  7495. func (s CustomKeyStoresListEntry) String() string {
  7496. return awsutil.Prettify(s)
  7497. }
  7498. // GoString returns the string representation
  7499. func (s CustomKeyStoresListEntry) GoString() string {
  7500. return s.String()
  7501. }
  7502. // SetCloudHsmClusterId sets the CloudHsmClusterId field's value.
  7503. func (s *CustomKeyStoresListEntry) SetCloudHsmClusterId(v string) *CustomKeyStoresListEntry {
  7504. s.CloudHsmClusterId = &v
  7505. return s
  7506. }
  7507. // SetConnectionErrorCode sets the ConnectionErrorCode field's value.
  7508. func (s *CustomKeyStoresListEntry) SetConnectionErrorCode(v string) *CustomKeyStoresListEntry {
  7509. s.ConnectionErrorCode = &v
  7510. return s
  7511. }
  7512. // SetConnectionState sets the ConnectionState field's value.
  7513. func (s *CustomKeyStoresListEntry) SetConnectionState(v string) *CustomKeyStoresListEntry {
  7514. s.ConnectionState = &v
  7515. return s
  7516. }
  7517. // SetCreationDate sets the CreationDate field's value.
  7518. func (s *CustomKeyStoresListEntry) SetCreationDate(v time.Time) *CustomKeyStoresListEntry {
  7519. s.CreationDate = &v
  7520. return s
  7521. }
  7522. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  7523. func (s *CustomKeyStoresListEntry) SetCustomKeyStoreId(v string) *CustomKeyStoresListEntry {
  7524. s.CustomKeyStoreId = &v
  7525. return s
  7526. }
  7527. // SetCustomKeyStoreName sets the CustomKeyStoreName field's value.
  7528. func (s *CustomKeyStoresListEntry) SetCustomKeyStoreName(v string) *CustomKeyStoresListEntry {
  7529. s.CustomKeyStoreName = &v
  7530. return s
  7531. }
  7532. // SetTrustAnchorCertificate sets the TrustAnchorCertificate field's value.
  7533. func (s *CustomKeyStoresListEntry) SetTrustAnchorCertificate(v string) *CustomKeyStoresListEntry {
  7534. s.TrustAnchorCertificate = &v
  7535. return s
  7536. }
  7537. type DecryptInput struct {
  7538. _ struct{} `type:"structure"`
  7539. // Ciphertext to be decrypted. The blob includes metadata.
  7540. //
  7541. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  7542. //
  7543. // CiphertextBlob is a required field
  7544. CiphertextBlob []byte `min:"1" type:"blob" required:"true"`
  7545. // Specifies the encryption algorithm that will be used to decrypt the ciphertext.
  7546. // Specify the same algorithm that was used to encrypt the data. If you specify
  7547. // a different algorithm, the Decrypt operation fails.
  7548. //
  7549. // This parameter is required only when the ciphertext was encrypted under an
  7550. // asymmetric CMK. The default value, SYMMETRIC_DEFAULT, represents the only
  7551. // supported algorithm that is valid for symmetric CMKs.
  7552. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  7553. // Specifies the encryption context to use when decrypting the data. An encryption
  7554. // context is valid only for cryptographic operations with a symmetric CMK.
  7555. // The standard asymmetric encryption algorithms that AWS KMS uses do not support
  7556. // an encryption context.
  7557. //
  7558. // An encryption context is a collection of non-secret key-value pairs that
  7559. // represents additional authenticated data. When you use an encryption context
  7560. // to encrypt data, you must specify the same (an exact case-sensitive match)
  7561. // encryption context to decrypt the data. An encryption context is optional
  7562. // when encrypting with a symmetric CMK, but it is highly recommended.
  7563. //
  7564. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  7565. // in the AWS Key Management Service Developer Guide.
  7566. EncryptionContext map[string]*string `type:"map"`
  7567. // A list of grant tokens.
  7568. //
  7569. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  7570. // in the AWS Key Management Service Developer Guide.
  7571. GrantTokens []*string `type:"list"`
  7572. // Specifies the customer master key (CMK) that AWS KMS will use to decrypt
  7573. // the ciphertext. Enter a key ID of the CMK that was used to encrypt the ciphertext.
  7574. //
  7575. // If you specify a KeyId value, the Decrypt operation succeeds only if the
  7576. // specified CMK was used to encrypt the ciphertext.
  7577. //
  7578. // This parameter is required only when the ciphertext was encrypted under an
  7579. // asymmetric CMK. Otherwise, AWS KMS uses the metadata that it adds to the
  7580. // ciphertext blob to determine which CMK was used to encrypt the ciphertext.
  7581. // However, you can use this parameter to ensure that a particular CMK (of any
  7582. // kind) is used to decrypt the ciphertext.
  7583. //
  7584. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  7585. // or alias ARN. When using an alias name, prefix it with "alias/".
  7586. //
  7587. // For example:
  7588. //
  7589. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  7590. //
  7591. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  7592. //
  7593. // * Alias name: alias/ExampleAlias
  7594. //
  7595. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  7596. //
  7597. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  7598. // get the alias name and alias ARN, use ListAliases.
  7599. KeyId *string `min:"1" type:"string"`
  7600. }
  7601. // String returns the string representation
  7602. func (s DecryptInput) String() string {
  7603. return awsutil.Prettify(s)
  7604. }
  7605. // GoString returns the string representation
  7606. func (s DecryptInput) GoString() string {
  7607. return s.String()
  7608. }
  7609. // Validate inspects the fields of the type to determine if they are valid.
  7610. func (s *DecryptInput) Validate() error {
  7611. invalidParams := request.ErrInvalidParams{Context: "DecryptInput"}
  7612. if s.CiphertextBlob == nil {
  7613. invalidParams.Add(request.NewErrParamRequired("CiphertextBlob"))
  7614. }
  7615. if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
  7616. invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1))
  7617. }
  7618. if s.KeyId != nil && len(*s.KeyId) < 1 {
  7619. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  7620. }
  7621. if invalidParams.Len() > 0 {
  7622. return invalidParams
  7623. }
  7624. return nil
  7625. }
  7626. // SetCiphertextBlob sets the CiphertextBlob field's value.
  7627. func (s *DecryptInput) SetCiphertextBlob(v []byte) *DecryptInput {
  7628. s.CiphertextBlob = v
  7629. return s
  7630. }
  7631. // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value.
  7632. func (s *DecryptInput) SetEncryptionAlgorithm(v string) *DecryptInput {
  7633. s.EncryptionAlgorithm = &v
  7634. return s
  7635. }
  7636. // SetEncryptionContext sets the EncryptionContext field's value.
  7637. func (s *DecryptInput) SetEncryptionContext(v map[string]*string) *DecryptInput {
  7638. s.EncryptionContext = v
  7639. return s
  7640. }
  7641. // SetGrantTokens sets the GrantTokens field's value.
  7642. func (s *DecryptInput) SetGrantTokens(v []*string) *DecryptInput {
  7643. s.GrantTokens = v
  7644. return s
  7645. }
  7646. // SetKeyId sets the KeyId field's value.
  7647. func (s *DecryptInput) SetKeyId(v string) *DecryptInput {
  7648. s.KeyId = &v
  7649. return s
  7650. }
  7651. type DecryptOutput struct {
  7652. _ struct{} `type:"structure"`
  7653. // The encryption algorithm that was used to decrypt the ciphertext.
  7654. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  7655. // The ARN of the customer master key that was used to perform the decryption.
  7656. KeyId *string `min:"1" type:"string"`
  7657. // Decrypted plaintext data. When you use the HTTP API or the AWS CLI, the value
  7658. // is Base64-encoded. Otherwise, it is not Base64-encoded.
  7659. //
  7660. // Plaintext is automatically base64 encoded/decoded by the SDK.
  7661. Plaintext []byte `min:"1" type:"blob" sensitive:"true"`
  7662. }
  7663. // String returns the string representation
  7664. func (s DecryptOutput) String() string {
  7665. return awsutil.Prettify(s)
  7666. }
  7667. // GoString returns the string representation
  7668. func (s DecryptOutput) GoString() string {
  7669. return s.String()
  7670. }
  7671. // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value.
  7672. func (s *DecryptOutput) SetEncryptionAlgorithm(v string) *DecryptOutput {
  7673. s.EncryptionAlgorithm = &v
  7674. return s
  7675. }
  7676. // SetKeyId sets the KeyId field's value.
  7677. func (s *DecryptOutput) SetKeyId(v string) *DecryptOutput {
  7678. s.KeyId = &v
  7679. return s
  7680. }
  7681. // SetPlaintext sets the Plaintext field's value.
  7682. func (s *DecryptOutput) SetPlaintext(v []byte) *DecryptOutput {
  7683. s.Plaintext = v
  7684. return s
  7685. }
  7686. type DeleteAliasInput struct {
  7687. _ struct{} `type:"structure"`
  7688. // The alias to be deleted. The alias name must begin with alias/ followed by
  7689. // the alias name, such as alias/ExampleAlias.
  7690. //
  7691. // AliasName is a required field
  7692. AliasName *string `min:"1" type:"string" required:"true"`
  7693. }
  7694. // String returns the string representation
  7695. func (s DeleteAliasInput) String() string {
  7696. return awsutil.Prettify(s)
  7697. }
  7698. // GoString returns the string representation
  7699. func (s DeleteAliasInput) GoString() string {
  7700. return s.String()
  7701. }
  7702. // Validate inspects the fields of the type to determine if they are valid.
  7703. func (s *DeleteAliasInput) Validate() error {
  7704. invalidParams := request.ErrInvalidParams{Context: "DeleteAliasInput"}
  7705. if s.AliasName == nil {
  7706. invalidParams.Add(request.NewErrParamRequired("AliasName"))
  7707. }
  7708. if s.AliasName != nil && len(*s.AliasName) < 1 {
  7709. invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
  7710. }
  7711. if invalidParams.Len() > 0 {
  7712. return invalidParams
  7713. }
  7714. return nil
  7715. }
  7716. // SetAliasName sets the AliasName field's value.
  7717. func (s *DeleteAliasInput) SetAliasName(v string) *DeleteAliasInput {
  7718. s.AliasName = &v
  7719. return s
  7720. }
  7721. type DeleteAliasOutput struct {
  7722. _ struct{} `type:"structure"`
  7723. }
  7724. // String returns the string representation
  7725. func (s DeleteAliasOutput) String() string {
  7726. return awsutil.Prettify(s)
  7727. }
  7728. // GoString returns the string representation
  7729. func (s DeleteAliasOutput) GoString() string {
  7730. return s.String()
  7731. }
  7732. type DeleteCustomKeyStoreInput struct {
  7733. _ struct{} `type:"structure"`
  7734. // Enter the ID of the custom key store you want to delete. To find the ID of
  7735. // a custom key store, use the DescribeCustomKeyStores operation.
  7736. //
  7737. // CustomKeyStoreId is a required field
  7738. CustomKeyStoreId *string `min:"1" type:"string" required:"true"`
  7739. }
  7740. // String returns the string representation
  7741. func (s DeleteCustomKeyStoreInput) String() string {
  7742. return awsutil.Prettify(s)
  7743. }
  7744. // GoString returns the string representation
  7745. func (s DeleteCustomKeyStoreInput) GoString() string {
  7746. return s.String()
  7747. }
  7748. // Validate inspects the fields of the type to determine if they are valid.
  7749. func (s *DeleteCustomKeyStoreInput) Validate() error {
  7750. invalidParams := request.ErrInvalidParams{Context: "DeleteCustomKeyStoreInput"}
  7751. if s.CustomKeyStoreId == nil {
  7752. invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId"))
  7753. }
  7754. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  7755. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  7756. }
  7757. if invalidParams.Len() > 0 {
  7758. return invalidParams
  7759. }
  7760. return nil
  7761. }
  7762. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  7763. func (s *DeleteCustomKeyStoreInput) SetCustomKeyStoreId(v string) *DeleteCustomKeyStoreInput {
  7764. s.CustomKeyStoreId = &v
  7765. return s
  7766. }
  7767. type DeleteCustomKeyStoreOutput struct {
  7768. _ struct{} `type:"structure"`
  7769. }
  7770. // String returns the string representation
  7771. func (s DeleteCustomKeyStoreOutput) String() string {
  7772. return awsutil.Prettify(s)
  7773. }
  7774. // GoString returns the string representation
  7775. func (s DeleteCustomKeyStoreOutput) GoString() string {
  7776. return s.String()
  7777. }
  7778. type DeleteImportedKeyMaterialInput struct {
  7779. _ struct{} `type:"structure"`
  7780. // Identifies the CMK from which you are deleting imported key material. The
  7781. // Origin of the CMK must be EXTERNAL.
  7782. //
  7783. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  7784. //
  7785. // For example:
  7786. //
  7787. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  7788. //
  7789. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  7790. //
  7791. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  7792. //
  7793. // KeyId is a required field
  7794. KeyId *string `min:"1" type:"string" required:"true"`
  7795. }
  7796. // String returns the string representation
  7797. func (s DeleteImportedKeyMaterialInput) String() string {
  7798. return awsutil.Prettify(s)
  7799. }
  7800. // GoString returns the string representation
  7801. func (s DeleteImportedKeyMaterialInput) GoString() string {
  7802. return s.String()
  7803. }
  7804. // Validate inspects the fields of the type to determine if they are valid.
  7805. func (s *DeleteImportedKeyMaterialInput) Validate() error {
  7806. invalidParams := request.ErrInvalidParams{Context: "DeleteImportedKeyMaterialInput"}
  7807. if s.KeyId == nil {
  7808. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  7809. }
  7810. if s.KeyId != nil && len(*s.KeyId) < 1 {
  7811. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  7812. }
  7813. if invalidParams.Len() > 0 {
  7814. return invalidParams
  7815. }
  7816. return nil
  7817. }
  7818. // SetKeyId sets the KeyId field's value.
  7819. func (s *DeleteImportedKeyMaterialInput) SetKeyId(v string) *DeleteImportedKeyMaterialInput {
  7820. s.KeyId = &v
  7821. return s
  7822. }
  7823. type DeleteImportedKeyMaterialOutput struct {
  7824. _ struct{} `type:"structure"`
  7825. }
  7826. // String returns the string representation
  7827. func (s DeleteImportedKeyMaterialOutput) String() string {
  7828. return awsutil.Prettify(s)
  7829. }
  7830. // GoString returns the string representation
  7831. func (s DeleteImportedKeyMaterialOutput) GoString() string {
  7832. return s.String()
  7833. }
  7834. // The system timed out while trying to fulfill the request. The request can
  7835. // be retried.
  7836. type DependencyTimeoutException struct {
  7837. _ struct{} `type:"structure"`
  7838. respMetadata protocol.ResponseMetadata
  7839. Message_ *string `locationName:"message" type:"string"`
  7840. }
  7841. // String returns the string representation
  7842. func (s DependencyTimeoutException) String() string {
  7843. return awsutil.Prettify(s)
  7844. }
  7845. // GoString returns the string representation
  7846. func (s DependencyTimeoutException) GoString() string {
  7847. return s.String()
  7848. }
  7849. func newErrorDependencyTimeoutException(v protocol.ResponseMetadata) error {
  7850. return &DependencyTimeoutException{
  7851. respMetadata: v,
  7852. }
  7853. }
  7854. // Code returns the exception type name.
  7855. func (s DependencyTimeoutException) Code() string {
  7856. return "DependencyTimeoutException"
  7857. }
  7858. // Message returns the exception's message.
  7859. func (s DependencyTimeoutException) Message() string {
  7860. if s.Message_ != nil {
  7861. return *s.Message_
  7862. }
  7863. return ""
  7864. }
  7865. // OrigErr always returns nil, satisfies awserr.Error interface.
  7866. func (s DependencyTimeoutException) OrigErr() error {
  7867. return nil
  7868. }
  7869. func (s DependencyTimeoutException) Error() string {
  7870. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  7871. }
  7872. // Status code returns the HTTP status code for the request's response error.
  7873. func (s DependencyTimeoutException) StatusCode() int {
  7874. return s.respMetadata.StatusCode
  7875. }
  7876. // RequestID returns the service's response RequestID for request.
  7877. func (s DependencyTimeoutException) RequestID() string {
  7878. return s.respMetadata.RequestID
  7879. }
  7880. type DescribeCustomKeyStoresInput struct {
  7881. _ struct{} `type:"structure"`
  7882. // Gets only information about the specified custom key store. Enter the key
  7883. // store ID.
  7884. //
  7885. // By default, this operation gets information about all custom key stores in
  7886. // the account and region. To limit the output to a particular custom key store,
  7887. // you can use either the CustomKeyStoreId or CustomKeyStoreName parameter,
  7888. // but not both.
  7889. CustomKeyStoreId *string `min:"1" type:"string"`
  7890. // Gets only information about the specified custom key store. Enter the friendly
  7891. // name of the custom key store.
  7892. //
  7893. // By default, this operation gets information about all custom key stores in
  7894. // the account and region. To limit the output to a particular custom key store,
  7895. // you can use either the CustomKeyStoreId or CustomKeyStoreName parameter,
  7896. // but not both.
  7897. CustomKeyStoreName *string `min:"1" type:"string"`
  7898. // Use this parameter to specify the maximum number of items to return. When
  7899. // this value is present, AWS KMS does not return more than the specified number
  7900. // of items, but it might return fewer.
  7901. Limit *int64 `min:"1" type:"integer"`
  7902. // Use this parameter in a subsequent request after you receive a response with
  7903. // truncated results. Set it to the value of NextMarker from the truncated response
  7904. // you just received.
  7905. Marker *string `min:"1" type:"string"`
  7906. }
  7907. // String returns the string representation
  7908. func (s DescribeCustomKeyStoresInput) String() string {
  7909. return awsutil.Prettify(s)
  7910. }
  7911. // GoString returns the string representation
  7912. func (s DescribeCustomKeyStoresInput) GoString() string {
  7913. return s.String()
  7914. }
  7915. // Validate inspects the fields of the type to determine if they are valid.
  7916. func (s *DescribeCustomKeyStoresInput) Validate() error {
  7917. invalidParams := request.ErrInvalidParams{Context: "DescribeCustomKeyStoresInput"}
  7918. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  7919. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  7920. }
  7921. if s.CustomKeyStoreName != nil && len(*s.CustomKeyStoreName) < 1 {
  7922. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreName", 1))
  7923. }
  7924. if s.Limit != nil && *s.Limit < 1 {
  7925. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  7926. }
  7927. if s.Marker != nil && len(*s.Marker) < 1 {
  7928. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  7929. }
  7930. if invalidParams.Len() > 0 {
  7931. return invalidParams
  7932. }
  7933. return nil
  7934. }
  7935. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  7936. func (s *DescribeCustomKeyStoresInput) SetCustomKeyStoreId(v string) *DescribeCustomKeyStoresInput {
  7937. s.CustomKeyStoreId = &v
  7938. return s
  7939. }
  7940. // SetCustomKeyStoreName sets the CustomKeyStoreName field's value.
  7941. func (s *DescribeCustomKeyStoresInput) SetCustomKeyStoreName(v string) *DescribeCustomKeyStoresInput {
  7942. s.CustomKeyStoreName = &v
  7943. return s
  7944. }
  7945. // SetLimit sets the Limit field's value.
  7946. func (s *DescribeCustomKeyStoresInput) SetLimit(v int64) *DescribeCustomKeyStoresInput {
  7947. s.Limit = &v
  7948. return s
  7949. }
  7950. // SetMarker sets the Marker field's value.
  7951. func (s *DescribeCustomKeyStoresInput) SetMarker(v string) *DescribeCustomKeyStoresInput {
  7952. s.Marker = &v
  7953. return s
  7954. }
  7955. type DescribeCustomKeyStoresOutput struct {
  7956. _ struct{} `type:"structure"`
  7957. // Contains metadata about each custom key store.
  7958. CustomKeyStores []*CustomKeyStoresListEntry `type:"list"`
  7959. // When Truncated is true, this element is present and contains the value to
  7960. // use for the Marker parameter in a subsequent request.
  7961. NextMarker *string `min:"1" type:"string"`
  7962. // A flag that indicates whether there are more items in the list. When this
  7963. // value is true, the list in this response is truncated. To get more items,
  7964. // pass the value of the NextMarker element in thisresponse to the Marker parameter
  7965. // in a subsequent request.
  7966. Truncated *bool `type:"boolean"`
  7967. }
  7968. // String returns the string representation
  7969. func (s DescribeCustomKeyStoresOutput) String() string {
  7970. return awsutil.Prettify(s)
  7971. }
  7972. // GoString returns the string representation
  7973. func (s DescribeCustomKeyStoresOutput) GoString() string {
  7974. return s.String()
  7975. }
  7976. // SetCustomKeyStores sets the CustomKeyStores field's value.
  7977. func (s *DescribeCustomKeyStoresOutput) SetCustomKeyStores(v []*CustomKeyStoresListEntry) *DescribeCustomKeyStoresOutput {
  7978. s.CustomKeyStores = v
  7979. return s
  7980. }
  7981. // SetNextMarker sets the NextMarker field's value.
  7982. func (s *DescribeCustomKeyStoresOutput) SetNextMarker(v string) *DescribeCustomKeyStoresOutput {
  7983. s.NextMarker = &v
  7984. return s
  7985. }
  7986. // SetTruncated sets the Truncated field's value.
  7987. func (s *DescribeCustomKeyStoresOutput) SetTruncated(v bool) *DescribeCustomKeyStoresOutput {
  7988. s.Truncated = &v
  7989. return s
  7990. }
  7991. type DescribeKeyInput struct {
  7992. _ struct{} `type:"structure"`
  7993. // A list of grant tokens.
  7994. //
  7995. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  7996. // in the AWS Key Management Service Developer Guide.
  7997. GrantTokens []*string `type:"list"`
  7998. // Describes the specified customer master key (CMK).
  7999. //
  8000. // If you specify a predefined AWS alias (an AWS alias with no key ID), KMS
  8001. // associates the alias with an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys)
  8002. // and returns its KeyId and Arn in the response.
  8003. //
  8004. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  8005. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  8006. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  8007. //
  8008. // For example:
  8009. //
  8010. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8011. //
  8012. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8013. //
  8014. // * Alias name: alias/ExampleAlias
  8015. //
  8016. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  8017. //
  8018. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  8019. // get the alias name and alias ARN, use ListAliases.
  8020. //
  8021. // KeyId is a required field
  8022. KeyId *string `min:"1" type:"string" required:"true"`
  8023. }
  8024. // String returns the string representation
  8025. func (s DescribeKeyInput) String() string {
  8026. return awsutil.Prettify(s)
  8027. }
  8028. // GoString returns the string representation
  8029. func (s DescribeKeyInput) GoString() string {
  8030. return s.String()
  8031. }
  8032. // Validate inspects the fields of the type to determine if they are valid.
  8033. func (s *DescribeKeyInput) Validate() error {
  8034. invalidParams := request.ErrInvalidParams{Context: "DescribeKeyInput"}
  8035. if s.KeyId == nil {
  8036. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8037. }
  8038. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8039. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8040. }
  8041. if invalidParams.Len() > 0 {
  8042. return invalidParams
  8043. }
  8044. return nil
  8045. }
  8046. // SetGrantTokens sets the GrantTokens field's value.
  8047. func (s *DescribeKeyInput) SetGrantTokens(v []*string) *DescribeKeyInput {
  8048. s.GrantTokens = v
  8049. return s
  8050. }
  8051. // SetKeyId sets the KeyId field's value.
  8052. func (s *DescribeKeyInput) SetKeyId(v string) *DescribeKeyInput {
  8053. s.KeyId = &v
  8054. return s
  8055. }
  8056. type DescribeKeyOutput struct {
  8057. _ struct{} `type:"structure"`
  8058. // Metadata associated with the key.
  8059. KeyMetadata *KeyMetadata `type:"structure"`
  8060. }
  8061. // String returns the string representation
  8062. func (s DescribeKeyOutput) String() string {
  8063. return awsutil.Prettify(s)
  8064. }
  8065. // GoString returns the string representation
  8066. func (s DescribeKeyOutput) GoString() string {
  8067. return s.String()
  8068. }
  8069. // SetKeyMetadata sets the KeyMetadata field's value.
  8070. func (s *DescribeKeyOutput) SetKeyMetadata(v *KeyMetadata) *DescribeKeyOutput {
  8071. s.KeyMetadata = v
  8072. return s
  8073. }
  8074. type DisableKeyInput struct {
  8075. _ struct{} `type:"structure"`
  8076. // A unique identifier for the customer master key (CMK).
  8077. //
  8078. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  8079. //
  8080. // For example:
  8081. //
  8082. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8083. //
  8084. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8085. //
  8086. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  8087. //
  8088. // KeyId is a required field
  8089. KeyId *string `min:"1" type:"string" required:"true"`
  8090. }
  8091. // String returns the string representation
  8092. func (s DisableKeyInput) String() string {
  8093. return awsutil.Prettify(s)
  8094. }
  8095. // GoString returns the string representation
  8096. func (s DisableKeyInput) GoString() string {
  8097. return s.String()
  8098. }
  8099. // Validate inspects the fields of the type to determine if they are valid.
  8100. func (s *DisableKeyInput) Validate() error {
  8101. invalidParams := request.ErrInvalidParams{Context: "DisableKeyInput"}
  8102. if s.KeyId == nil {
  8103. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8104. }
  8105. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8106. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8107. }
  8108. if invalidParams.Len() > 0 {
  8109. return invalidParams
  8110. }
  8111. return nil
  8112. }
  8113. // SetKeyId sets the KeyId field's value.
  8114. func (s *DisableKeyInput) SetKeyId(v string) *DisableKeyInput {
  8115. s.KeyId = &v
  8116. return s
  8117. }
  8118. type DisableKeyOutput struct {
  8119. _ struct{} `type:"structure"`
  8120. }
  8121. // String returns the string representation
  8122. func (s DisableKeyOutput) String() string {
  8123. return awsutil.Prettify(s)
  8124. }
  8125. // GoString returns the string representation
  8126. func (s DisableKeyOutput) GoString() string {
  8127. return s.String()
  8128. }
  8129. type DisableKeyRotationInput struct {
  8130. _ struct{} `type:"structure"`
  8131. // Identifies a symmetric customer master key (CMK). You cannot enable automatic
  8132. // rotation of asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks),
  8133. // CMKs with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html),
  8134. // or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  8135. //
  8136. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  8137. //
  8138. // For example:
  8139. //
  8140. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8141. //
  8142. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8143. //
  8144. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  8145. //
  8146. // KeyId is a required field
  8147. KeyId *string `min:"1" type:"string" required:"true"`
  8148. }
  8149. // String returns the string representation
  8150. func (s DisableKeyRotationInput) String() string {
  8151. return awsutil.Prettify(s)
  8152. }
  8153. // GoString returns the string representation
  8154. func (s DisableKeyRotationInput) GoString() string {
  8155. return s.String()
  8156. }
  8157. // Validate inspects the fields of the type to determine if they are valid.
  8158. func (s *DisableKeyRotationInput) Validate() error {
  8159. invalidParams := request.ErrInvalidParams{Context: "DisableKeyRotationInput"}
  8160. if s.KeyId == nil {
  8161. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8162. }
  8163. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8164. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8165. }
  8166. if invalidParams.Len() > 0 {
  8167. return invalidParams
  8168. }
  8169. return nil
  8170. }
  8171. // SetKeyId sets the KeyId field's value.
  8172. func (s *DisableKeyRotationInput) SetKeyId(v string) *DisableKeyRotationInput {
  8173. s.KeyId = &v
  8174. return s
  8175. }
  8176. type DisableKeyRotationOutput struct {
  8177. _ struct{} `type:"structure"`
  8178. }
  8179. // String returns the string representation
  8180. func (s DisableKeyRotationOutput) String() string {
  8181. return awsutil.Prettify(s)
  8182. }
  8183. // GoString returns the string representation
  8184. func (s DisableKeyRotationOutput) GoString() string {
  8185. return s.String()
  8186. }
  8187. // The request was rejected because the specified CMK is not enabled.
  8188. type DisabledException struct {
  8189. _ struct{} `type:"structure"`
  8190. respMetadata protocol.ResponseMetadata
  8191. Message_ *string `locationName:"message" type:"string"`
  8192. }
  8193. // String returns the string representation
  8194. func (s DisabledException) String() string {
  8195. return awsutil.Prettify(s)
  8196. }
  8197. // GoString returns the string representation
  8198. func (s DisabledException) GoString() string {
  8199. return s.String()
  8200. }
  8201. func newErrorDisabledException(v protocol.ResponseMetadata) error {
  8202. return &DisabledException{
  8203. respMetadata: v,
  8204. }
  8205. }
  8206. // Code returns the exception type name.
  8207. func (s DisabledException) Code() string {
  8208. return "DisabledException"
  8209. }
  8210. // Message returns the exception's message.
  8211. func (s DisabledException) Message() string {
  8212. if s.Message_ != nil {
  8213. return *s.Message_
  8214. }
  8215. return ""
  8216. }
  8217. // OrigErr always returns nil, satisfies awserr.Error interface.
  8218. func (s DisabledException) OrigErr() error {
  8219. return nil
  8220. }
  8221. func (s DisabledException) Error() string {
  8222. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  8223. }
  8224. // Status code returns the HTTP status code for the request's response error.
  8225. func (s DisabledException) StatusCode() int {
  8226. return s.respMetadata.StatusCode
  8227. }
  8228. // RequestID returns the service's response RequestID for request.
  8229. func (s DisabledException) RequestID() string {
  8230. return s.respMetadata.RequestID
  8231. }
  8232. type DisconnectCustomKeyStoreInput struct {
  8233. _ struct{} `type:"structure"`
  8234. // Enter the ID of the custom key store you want to disconnect. To find the
  8235. // ID of a custom key store, use the DescribeCustomKeyStores operation.
  8236. //
  8237. // CustomKeyStoreId is a required field
  8238. CustomKeyStoreId *string `min:"1" type:"string" required:"true"`
  8239. }
  8240. // String returns the string representation
  8241. func (s DisconnectCustomKeyStoreInput) String() string {
  8242. return awsutil.Prettify(s)
  8243. }
  8244. // GoString returns the string representation
  8245. func (s DisconnectCustomKeyStoreInput) GoString() string {
  8246. return s.String()
  8247. }
  8248. // Validate inspects the fields of the type to determine if they are valid.
  8249. func (s *DisconnectCustomKeyStoreInput) Validate() error {
  8250. invalidParams := request.ErrInvalidParams{Context: "DisconnectCustomKeyStoreInput"}
  8251. if s.CustomKeyStoreId == nil {
  8252. invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId"))
  8253. }
  8254. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  8255. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  8256. }
  8257. if invalidParams.Len() > 0 {
  8258. return invalidParams
  8259. }
  8260. return nil
  8261. }
  8262. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  8263. func (s *DisconnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *DisconnectCustomKeyStoreInput {
  8264. s.CustomKeyStoreId = &v
  8265. return s
  8266. }
  8267. type DisconnectCustomKeyStoreOutput struct {
  8268. _ struct{} `type:"structure"`
  8269. }
  8270. // String returns the string representation
  8271. func (s DisconnectCustomKeyStoreOutput) String() string {
  8272. return awsutil.Prettify(s)
  8273. }
  8274. // GoString returns the string representation
  8275. func (s DisconnectCustomKeyStoreOutput) GoString() string {
  8276. return s.String()
  8277. }
  8278. type EnableKeyInput struct {
  8279. _ struct{} `type:"structure"`
  8280. // A unique identifier for the customer master key (CMK).
  8281. //
  8282. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  8283. //
  8284. // For example:
  8285. //
  8286. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8287. //
  8288. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8289. //
  8290. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  8291. //
  8292. // KeyId is a required field
  8293. KeyId *string `min:"1" type:"string" required:"true"`
  8294. }
  8295. // String returns the string representation
  8296. func (s EnableKeyInput) String() string {
  8297. return awsutil.Prettify(s)
  8298. }
  8299. // GoString returns the string representation
  8300. func (s EnableKeyInput) GoString() string {
  8301. return s.String()
  8302. }
  8303. // Validate inspects the fields of the type to determine if they are valid.
  8304. func (s *EnableKeyInput) Validate() error {
  8305. invalidParams := request.ErrInvalidParams{Context: "EnableKeyInput"}
  8306. if s.KeyId == nil {
  8307. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8308. }
  8309. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8310. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8311. }
  8312. if invalidParams.Len() > 0 {
  8313. return invalidParams
  8314. }
  8315. return nil
  8316. }
  8317. // SetKeyId sets the KeyId field's value.
  8318. func (s *EnableKeyInput) SetKeyId(v string) *EnableKeyInput {
  8319. s.KeyId = &v
  8320. return s
  8321. }
  8322. type EnableKeyOutput struct {
  8323. _ struct{} `type:"structure"`
  8324. }
  8325. // String returns the string representation
  8326. func (s EnableKeyOutput) String() string {
  8327. return awsutil.Prettify(s)
  8328. }
  8329. // GoString returns the string representation
  8330. func (s EnableKeyOutput) GoString() string {
  8331. return s.String()
  8332. }
  8333. type EnableKeyRotationInput struct {
  8334. _ struct{} `type:"structure"`
  8335. // Identifies a symmetric customer master key (CMK). You cannot enable automatic
  8336. // rotation of asymmetric CMKs, CMKs with imported key material, or CMKs in
  8337. // a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  8338. //
  8339. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  8340. //
  8341. // For example:
  8342. //
  8343. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8344. //
  8345. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8346. //
  8347. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  8348. //
  8349. // KeyId is a required field
  8350. KeyId *string `min:"1" type:"string" required:"true"`
  8351. }
  8352. // String returns the string representation
  8353. func (s EnableKeyRotationInput) String() string {
  8354. return awsutil.Prettify(s)
  8355. }
  8356. // GoString returns the string representation
  8357. func (s EnableKeyRotationInput) GoString() string {
  8358. return s.String()
  8359. }
  8360. // Validate inspects the fields of the type to determine if they are valid.
  8361. func (s *EnableKeyRotationInput) Validate() error {
  8362. invalidParams := request.ErrInvalidParams{Context: "EnableKeyRotationInput"}
  8363. if s.KeyId == nil {
  8364. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8365. }
  8366. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8367. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8368. }
  8369. if invalidParams.Len() > 0 {
  8370. return invalidParams
  8371. }
  8372. return nil
  8373. }
  8374. // SetKeyId sets the KeyId field's value.
  8375. func (s *EnableKeyRotationInput) SetKeyId(v string) *EnableKeyRotationInput {
  8376. s.KeyId = &v
  8377. return s
  8378. }
  8379. type EnableKeyRotationOutput struct {
  8380. _ struct{} `type:"structure"`
  8381. }
  8382. // String returns the string representation
  8383. func (s EnableKeyRotationOutput) String() string {
  8384. return awsutil.Prettify(s)
  8385. }
  8386. // GoString returns the string representation
  8387. func (s EnableKeyRotationOutput) GoString() string {
  8388. return s.String()
  8389. }
  8390. type EncryptInput struct {
  8391. _ struct{} `type:"structure"`
  8392. // Specifies the encryption algorithm that AWS KMS will use to encrypt the plaintext
  8393. // message. The algorithm must be compatible with the CMK that you specify.
  8394. //
  8395. // This parameter is required only for asymmetric CMKs. The default value, SYMMETRIC_DEFAULT,
  8396. // is the algorithm used for symmetric CMKs. If you are using an asymmetric
  8397. // CMK, we recommend RSAES_OAEP_SHA_256.
  8398. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  8399. // Specifies the encryption context that will be used to encrypt the data. An
  8400. // encryption context is valid only for cryptographic operations with a symmetric
  8401. // CMK. The standard asymmetric encryption algorithms that AWS KMS uses do not
  8402. // support an encryption context.
  8403. //
  8404. // An encryption context is a collection of non-secret key-value pairs that
  8405. // represents additional authenticated data. When you use an encryption context
  8406. // to encrypt data, you must specify the same (an exact case-sensitive match)
  8407. // encryption context to decrypt the data. An encryption context is optional
  8408. // when encrypting with a symmetric CMK, but it is highly recommended.
  8409. //
  8410. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  8411. // in the AWS Key Management Service Developer Guide.
  8412. EncryptionContext map[string]*string `type:"map"`
  8413. // A list of grant tokens.
  8414. //
  8415. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  8416. // in the AWS Key Management Service Developer Guide.
  8417. GrantTokens []*string `type:"list"`
  8418. // A unique identifier for the customer master key (CMK).
  8419. //
  8420. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  8421. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  8422. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  8423. //
  8424. // For example:
  8425. //
  8426. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8427. //
  8428. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8429. //
  8430. // * Alias name: alias/ExampleAlias
  8431. //
  8432. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  8433. //
  8434. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  8435. // get the alias name and alias ARN, use ListAliases.
  8436. //
  8437. // KeyId is a required field
  8438. KeyId *string `min:"1" type:"string" required:"true"`
  8439. // Data to be encrypted.
  8440. //
  8441. // Plaintext is automatically base64 encoded/decoded by the SDK.
  8442. //
  8443. // Plaintext is a required field
  8444. Plaintext []byte `min:"1" type:"blob" required:"true" sensitive:"true"`
  8445. }
  8446. // String returns the string representation
  8447. func (s EncryptInput) String() string {
  8448. return awsutil.Prettify(s)
  8449. }
  8450. // GoString returns the string representation
  8451. func (s EncryptInput) GoString() string {
  8452. return s.String()
  8453. }
  8454. // Validate inspects the fields of the type to determine if they are valid.
  8455. func (s *EncryptInput) Validate() error {
  8456. invalidParams := request.ErrInvalidParams{Context: "EncryptInput"}
  8457. if s.KeyId == nil {
  8458. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8459. }
  8460. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8461. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8462. }
  8463. if s.Plaintext == nil {
  8464. invalidParams.Add(request.NewErrParamRequired("Plaintext"))
  8465. }
  8466. if s.Plaintext != nil && len(s.Plaintext) < 1 {
  8467. invalidParams.Add(request.NewErrParamMinLen("Plaintext", 1))
  8468. }
  8469. if invalidParams.Len() > 0 {
  8470. return invalidParams
  8471. }
  8472. return nil
  8473. }
  8474. // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value.
  8475. func (s *EncryptInput) SetEncryptionAlgorithm(v string) *EncryptInput {
  8476. s.EncryptionAlgorithm = &v
  8477. return s
  8478. }
  8479. // SetEncryptionContext sets the EncryptionContext field's value.
  8480. func (s *EncryptInput) SetEncryptionContext(v map[string]*string) *EncryptInput {
  8481. s.EncryptionContext = v
  8482. return s
  8483. }
  8484. // SetGrantTokens sets the GrantTokens field's value.
  8485. func (s *EncryptInput) SetGrantTokens(v []*string) *EncryptInput {
  8486. s.GrantTokens = v
  8487. return s
  8488. }
  8489. // SetKeyId sets the KeyId field's value.
  8490. func (s *EncryptInput) SetKeyId(v string) *EncryptInput {
  8491. s.KeyId = &v
  8492. return s
  8493. }
  8494. // SetPlaintext sets the Plaintext field's value.
  8495. func (s *EncryptInput) SetPlaintext(v []byte) *EncryptInput {
  8496. s.Plaintext = v
  8497. return s
  8498. }
  8499. type EncryptOutput struct {
  8500. _ struct{} `type:"structure"`
  8501. // The encrypted plaintext. When you use the HTTP API or the AWS CLI, the value
  8502. // is Base64-encoded. Otherwise, it is not Base64-encoded.
  8503. //
  8504. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  8505. CiphertextBlob []byte `min:"1" type:"blob"`
  8506. // The encryption algorithm that was used to encrypt the plaintext.
  8507. EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  8508. // The ID of the key used during encryption.
  8509. KeyId *string `min:"1" type:"string"`
  8510. }
  8511. // String returns the string representation
  8512. func (s EncryptOutput) String() string {
  8513. return awsutil.Prettify(s)
  8514. }
  8515. // GoString returns the string representation
  8516. func (s EncryptOutput) GoString() string {
  8517. return s.String()
  8518. }
  8519. // SetCiphertextBlob sets the CiphertextBlob field's value.
  8520. func (s *EncryptOutput) SetCiphertextBlob(v []byte) *EncryptOutput {
  8521. s.CiphertextBlob = v
  8522. return s
  8523. }
  8524. // SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value.
  8525. func (s *EncryptOutput) SetEncryptionAlgorithm(v string) *EncryptOutput {
  8526. s.EncryptionAlgorithm = &v
  8527. return s
  8528. }
  8529. // SetKeyId sets the KeyId field's value.
  8530. func (s *EncryptOutput) SetKeyId(v string) *EncryptOutput {
  8531. s.KeyId = &v
  8532. return s
  8533. }
  8534. // The request was rejected because the specified import token is expired. Use
  8535. // GetParametersForImport to get a new import token and public key, use the
  8536. // new public key to encrypt the key material, and then try the request again.
  8537. type ExpiredImportTokenException struct {
  8538. _ struct{} `type:"structure"`
  8539. respMetadata protocol.ResponseMetadata
  8540. Message_ *string `locationName:"message" type:"string"`
  8541. }
  8542. // String returns the string representation
  8543. func (s ExpiredImportTokenException) String() string {
  8544. return awsutil.Prettify(s)
  8545. }
  8546. // GoString returns the string representation
  8547. func (s ExpiredImportTokenException) GoString() string {
  8548. return s.String()
  8549. }
  8550. func newErrorExpiredImportTokenException(v protocol.ResponseMetadata) error {
  8551. return &ExpiredImportTokenException{
  8552. respMetadata: v,
  8553. }
  8554. }
  8555. // Code returns the exception type name.
  8556. func (s ExpiredImportTokenException) Code() string {
  8557. return "ExpiredImportTokenException"
  8558. }
  8559. // Message returns the exception's message.
  8560. func (s ExpiredImportTokenException) Message() string {
  8561. if s.Message_ != nil {
  8562. return *s.Message_
  8563. }
  8564. return ""
  8565. }
  8566. // OrigErr always returns nil, satisfies awserr.Error interface.
  8567. func (s ExpiredImportTokenException) OrigErr() error {
  8568. return nil
  8569. }
  8570. func (s ExpiredImportTokenException) Error() string {
  8571. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  8572. }
  8573. // Status code returns the HTTP status code for the request's response error.
  8574. func (s ExpiredImportTokenException) StatusCode() int {
  8575. return s.respMetadata.StatusCode
  8576. }
  8577. // RequestID returns the service's response RequestID for request.
  8578. func (s ExpiredImportTokenException) RequestID() string {
  8579. return s.respMetadata.RequestID
  8580. }
  8581. type GenerateDataKeyInput struct {
  8582. _ struct{} `type:"structure"`
  8583. // Specifies the encryption context that will be used when encrypting the data
  8584. // key.
  8585. //
  8586. // An encryption context is a collection of non-secret key-value pairs that
  8587. // represents additional authenticated data. When you use an encryption context
  8588. // to encrypt data, you must specify the same (an exact case-sensitive match)
  8589. // encryption context to decrypt the data. An encryption context is optional
  8590. // when encrypting with a symmetric CMK, but it is highly recommended.
  8591. //
  8592. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  8593. // in the AWS Key Management Service Developer Guide.
  8594. EncryptionContext map[string]*string `type:"map"`
  8595. // A list of grant tokens.
  8596. //
  8597. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  8598. // in the AWS Key Management Service Developer Guide.
  8599. GrantTokens []*string `type:"list"`
  8600. // Identifies the symmetric CMK that encrypts the data key.
  8601. //
  8602. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  8603. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  8604. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  8605. //
  8606. // For example:
  8607. //
  8608. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8609. //
  8610. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8611. //
  8612. // * Alias name: alias/ExampleAlias
  8613. //
  8614. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  8615. //
  8616. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  8617. // get the alias name and alias ARN, use ListAliases.
  8618. //
  8619. // KeyId is a required field
  8620. KeyId *string `min:"1" type:"string" required:"true"`
  8621. // Specifies the length of the data key. Use AES_128 to generate a 128-bit symmetric
  8622. // key, or AES_256 to generate a 256-bit symmetric key.
  8623. //
  8624. // You must specify either the KeySpec or the NumberOfBytes parameter (but not
  8625. // both) in every GenerateDataKey request.
  8626. KeySpec *string `type:"string" enum:"DataKeySpec"`
  8627. // Specifies the length of the data key in bytes. For example, use the value
  8628. // 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte)
  8629. // and 256-bit (32-byte) data keys, use the KeySpec parameter.
  8630. //
  8631. // You must specify either the KeySpec or the NumberOfBytes parameter (but not
  8632. // both) in every GenerateDataKey request.
  8633. NumberOfBytes *int64 `min:"1" type:"integer"`
  8634. }
  8635. // String returns the string representation
  8636. func (s GenerateDataKeyInput) String() string {
  8637. return awsutil.Prettify(s)
  8638. }
  8639. // GoString returns the string representation
  8640. func (s GenerateDataKeyInput) GoString() string {
  8641. return s.String()
  8642. }
  8643. // Validate inspects the fields of the type to determine if they are valid.
  8644. func (s *GenerateDataKeyInput) Validate() error {
  8645. invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyInput"}
  8646. if s.KeyId == nil {
  8647. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8648. }
  8649. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8650. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8651. }
  8652. if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
  8653. invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
  8654. }
  8655. if invalidParams.Len() > 0 {
  8656. return invalidParams
  8657. }
  8658. return nil
  8659. }
  8660. // SetEncryptionContext sets the EncryptionContext field's value.
  8661. func (s *GenerateDataKeyInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyInput {
  8662. s.EncryptionContext = v
  8663. return s
  8664. }
  8665. // SetGrantTokens sets the GrantTokens field's value.
  8666. func (s *GenerateDataKeyInput) SetGrantTokens(v []*string) *GenerateDataKeyInput {
  8667. s.GrantTokens = v
  8668. return s
  8669. }
  8670. // SetKeyId sets the KeyId field's value.
  8671. func (s *GenerateDataKeyInput) SetKeyId(v string) *GenerateDataKeyInput {
  8672. s.KeyId = &v
  8673. return s
  8674. }
  8675. // SetKeySpec sets the KeySpec field's value.
  8676. func (s *GenerateDataKeyInput) SetKeySpec(v string) *GenerateDataKeyInput {
  8677. s.KeySpec = &v
  8678. return s
  8679. }
  8680. // SetNumberOfBytes sets the NumberOfBytes field's value.
  8681. func (s *GenerateDataKeyInput) SetNumberOfBytes(v int64) *GenerateDataKeyInput {
  8682. s.NumberOfBytes = &v
  8683. return s
  8684. }
  8685. type GenerateDataKeyOutput struct {
  8686. _ struct{} `type:"structure"`
  8687. // The encrypted copy of the data key. When you use the HTTP API or the AWS
  8688. // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.
  8689. //
  8690. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  8691. CiphertextBlob []byte `min:"1" type:"blob"`
  8692. // The identifier of the CMK that encrypted the data key.
  8693. KeyId *string `min:"1" type:"string"`
  8694. // The plaintext data key. When you use the HTTP API or the AWS CLI, the value
  8695. // is Base64-encoded. Otherwise, it is not Base64-encoded. Use this data key
  8696. // to encrypt your data outside of KMS. Then, remove it from memory as soon
  8697. // as possible.
  8698. //
  8699. // Plaintext is automatically base64 encoded/decoded by the SDK.
  8700. Plaintext []byte `min:"1" type:"blob" sensitive:"true"`
  8701. }
  8702. // String returns the string representation
  8703. func (s GenerateDataKeyOutput) String() string {
  8704. return awsutil.Prettify(s)
  8705. }
  8706. // GoString returns the string representation
  8707. func (s GenerateDataKeyOutput) GoString() string {
  8708. return s.String()
  8709. }
  8710. // SetCiphertextBlob sets the CiphertextBlob field's value.
  8711. func (s *GenerateDataKeyOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyOutput {
  8712. s.CiphertextBlob = v
  8713. return s
  8714. }
  8715. // SetKeyId sets the KeyId field's value.
  8716. func (s *GenerateDataKeyOutput) SetKeyId(v string) *GenerateDataKeyOutput {
  8717. s.KeyId = &v
  8718. return s
  8719. }
  8720. // SetPlaintext sets the Plaintext field's value.
  8721. func (s *GenerateDataKeyOutput) SetPlaintext(v []byte) *GenerateDataKeyOutput {
  8722. s.Plaintext = v
  8723. return s
  8724. }
  8725. type GenerateDataKeyPairInput struct {
  8726. _ struct{} `type:"structure"`
  8727. // Specifies the encryption context that will be used when encrypting the private
  8728. // key in the data key pair.
  8729. //
  8730. // An encryption context is a collection of non-secret key-value pairs that
  8731. // represents additional authenticated data. When you use an encryption context
  8732. // to encrypt data, you must specify the same (an exact case-sensitive match)
  8733. // encryption context to decrypt the data. An encryption context is optional
  8734. // when encrypting with a symmetric CMK, but it is highly recommended.
  8735. //
  8736. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  8737. // in the AWS Key Management Service Developer Guide.
  8738. EncryptionContext map[string]*string `type:"map"`
  8739. // A list of grant tokens.
  8740. //
  8741. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  8742. // in the AWS Key Management Service Developer Guide.
  8743. GrantTokens []*string `type:"list"`
  8744. // Specifies the symmetric CMK that encrypts the private key in the data key
  8745. // pair. You cannot specify an asymmetric CMKs.
  8746. //
  8747. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  8748. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  8749. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  8750. //
  8751. // For example:
  8752. //
  8753. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8754. //
  8755. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8756. //
  8757. // * Alias name: alias/ExampleAlias
  8758. //
  8759. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  8760. //
  8761. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  8762. // get the alias name and alias ARN, use ListAliases.
  8763. //
  8764. // KeyId is a required field
  8765. KeyId *string `min:"1" type:"string" required:"true"`
  8766. // Determines the type of data key pair that is generated.
  8767. //
  8768. // The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt
  8769. // and decrypt or to sign and verify (but not both), and the rule that permits
  8770. // you to use ECC CMKs only to sign and verify, are not effective outside of
  8771. // AWS KMS.
  8772. //
  8773. // KeyPairSpec is a required field
  8774. KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"`
  8775. }
  8776. // String returns the string representation
  8777. func (s GenerateDataKeyPairInput) String() string {
  8778. return awsutil.Prettify(s)
  8779. }
  8780. // GoString returns the string representation
  8781. func (s GenerateDataKeyPairInput) GoString() string {
  8782. return s.String()
  8783. }
  8784. // Validate inspects the fields of the type to determine if they are valid.
  8785. func (s *GenerateDataKeyPairInput) Validate() error {
  8786. invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairInput"}
  8787. if s.KeyId == nil {
  8788. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8789. }
  8790. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8791. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8792. }
  8793. if s.KeyPairSpec == nil {
  8794. invalidParams.Add(request.NewErrParamRequired("KeyPairSpec"))
  8795. }
  8796. if invalidParams.Len() > 0 {
  8797. return invalidParams
  8798. }
  8799. return nil
  8800. }
  8801. // SetEncryptionContext sets the EncryptionContext field's value.
  8802. func (s *GenerateDataKeyPairInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairInput {
  8803. s.EncryptionContext = v
  8804. return s
  8805. }
  8806. // SetGrantTokens sets the GrantTokens field's value.
  8807. func (s *GenerateDataKeyPairInput) SetGrantTokens(v []*string) *GenerateDataKeyPairInput {
  8808. s.GrantTokens = v
  8809. return s
  8810. }
  8811. // SetKeyId sets the KeyId field's value.
  8812. func (s *GenerateDataKeyPairInput) SetKeyId(v string) *GenerateDataKeyPairInput {
  8813. s.KeyId = &v
  8814. return s
  8815. }
  8816. // SetKeyPairSpec sets the KeyPairSpec field's value.
  8817. func (s *GenerateDataKeyPairInput) SetKeyPairSpec(v string) *GenerateDataKeyPairInput {
  8818. s.KeyPairSpec = &v
  8819. return s
  8820. }
  8821. type GenerateDataKeyPairOutput struct {
  8822. _ struct{} `type:"structure"`
  8823. // The identifier of the CMK that encrypted the private key.
  8824. KeyId *string `min:"1" type:"string"`
  8825. // The type of data key pair that was generated.
  8826. KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"`
  8827. // The encrypted copy of the private key. When you use the HTTP API or the AWS
  8828. // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.
  8829. //
  8830. // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK.
  8831. PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"`
  8832. // The plaintext copy of the private key. When you use the HTTP API or the AWS
  8833. // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.
  8834. //
  8835. // PrivateKeyPlaintext is automatically base64 encoded/decoded by the SDK.
  8836. PrivateKeyPlaintext []byte `min:"1" type:"blob" sensitive:"true"`
  8837. // The public key (in plaintext).
  8838. //
  8839. // PublicKey is automatically base64 encoded/decoded by the SDK.
  8840. PublicKey []byte `min:"1" type:"blob"`
  8841. }
  8842. // String returns the string representation
  8843. func (s GenerateDataKeyPairOutput) String() string {
  8844. return awsutil.Prettify(s)
  8845. }
  8846. // GoString returns the string representation
  8847. func (s GenerateDataKeyPairOutput) GoString() string {
  8848. return s.String()
  8849. }
  8850. // SetKeyId sets the KeyId field's value.
  8851. func (s *GenerateDataKeyPairOutput) SetKeyId(v string) *GenerateDataKeyPairOutput {
  8852. s.KeyId = &v
  8853. return s
  8854. }
  8855. // SetKeyPairSpec sets the KeyPairSpec field's value.
  8856. func (s *GenerateDataKeyPairOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairOutput {
  8857. s.KeyPairSpec = &v
  8858. return s
  8859. }
  8860. // SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value.
  8861. func (s *GenerateDataKeyPairOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairOutput {
  8862. s.PrivateKeyCiphertextBlob = v
  8863. return s
  8864. }
  8865. // SetPrivateKeyPlaintext sets the PrivateKeyPlaintext field's value.
  8866. func (s *GenerateDataKeyPairOutput) SetPrivateKeyPlaintext(v []byte) *GenerateDataKeyPairOutput {
  8867. s.PrivateKeyPlaintext = v
  8868. return s
  8869. }
  8870. // SetPublicKey sets the PublicKey field's value.
  8871. func (s *GenerateDataKeyPairOutput) SetPublicKey(v []byte) *GenerateDataKeyPairOutput {
  8872. s.PublicKey = v
  8873. return s
  8874. }
  8875. type GenerateDataKeyPairWithoutPlaintextInput struct {
  8876. _ struct{} `type:"structure"`
  8877. // Specifies the encryption context that will be used when encrypting the private
  8878. // key in the data key pair.
  8879. //
  8880. // An encryption context is a collection of non-secret key-value pairs that
  8881. // represents additional authenticated data. When you use an encryption context
  8882. // to encrypt data, you must specify the same (an exact case-sensitive match)
  8883. // encryption context to decrypt the data. An encryption context is optional
  8884. // when encrypting with a symmetric CMK, but it is highly recommended.
  8885. //
  8886. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  8887. // in the AWS Key Management Service Developer Guide.
  8888. EncryptionContext map[string]*string `type:"map"`
  8889. // A list of grant tokens.
  8890. //
  8891. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  8892. // in the AWS Key Management Service Developer Guide.
  8893. GrantTokens []*string `type:"list"`
  8894. // Specifies the CMK that encrypts the private key in the data key pair. You
  8895. // must specify a symmetric CMK. You cannot use an asymmetric CMK.
  8896. //
  8897. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  8898. // or alias ARN. When using an alias name, prefix it with "alias/".
  8899. //
  8900. // For example:
  8901. //
  8902. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8903. //
  8904. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8905. //
  8906. // * Alias name: alias/ExampleAlias
  8907. //
  8908. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  8909. //
  8910. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  8911. // get the alias name and alias ARN, use ListAliases.
  8912. //
  8913. // KeyId is a required field
  8914. KeyId *string `min:"1" type:"string" required:"true"`
  8915. // Determines the type of data key pair that is generated.
  8916. //
  8917. // The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt
  8918. // and decrypt or to sign and verify (but not both), and the rule that permits
  8919. // you to use ECC CMKs only to sign and verify, are not effective outside of
  8920. // AWS KMS.
  8921. //
  8922. // KeyPairSpec is a required field
  8923. KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"`
  8924. }
  8925. // String returns the string representation
  8926. func (s GenerateDataKeyPairWithoutPlaintextInput) String() string {
  8927. return awsutil.Prettify(s)
  8928. }
  8929. // GoString returns the string representation
  8930. func (s GenerateDataKeyPairWithoutPlaintextInput) GoString() string {
  8931. return s.String()
  8932. }
  8933. // Validate inspects the fields of the type to determine if they are valid.
  8934. func (s *GenerateDataKeyPairWithoutPlaintextInput) Validate() error {
  8935. invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairWithoutPlaintextInput"}
  8936. if s.KeyId == nil {
  8937. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  8938. }
  8939. if s.KeyId != nil && len(*s.KeyId) < 1 {
  8940. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  8941. }
  8942. if s.KeyPairSpec == nil {
  8943. invalidParams.Add(request.NewErrParamRequired("KeyPairSpec"))
  8944. }
  8945. if invalidParams.Len() > 0 {
  8946. return invalidParams
  8947. }
  8948. return nil
  8949. }
  8950. // SetEncryptionContext sets the EncryptionContext field's value.
  8951. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairWithoutPlaintextInput {
  8952. s.EncryptionContext = v
  8953. return s
  8954. }
  8955. // SetGrantTokens sets the GrantTokens field's value.
  8956. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyPairWithoutPlaintextInput {
  8957. s.GrantTokens = v
  8958. return s
  8959. }
  8960. // SetKeyId sets the KeyId field's value.
  8961. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextInput {
  8962. s.KeyId = &v
  8963. return s
  8964. }
  8965. // SetKeyPairSpec sets the KeyPairSpec field's value.
  8966. func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextInput {
  8967. s.KeyPairSpec = &v
  8968. return s
  8969. }
  8970. type GenerateDataKeyPairWithoutPlaintextOutput struct {
  8971. _ struct{} `type:"structure"`
  8972. // Specifies the CMK that encrypted the private key in the data key pair. You
  8973. // must specify a symmetric CMK. You cannot use an asymmetric CMK.
  8974. //
  8975. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  8976. // or alias ARN. When using an alias name, prefix it with "alias/".
  8977. //
  8978. // For example:
  8979. //
  8980. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  8981. //
  8982. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  8983. //
  8984. // * Alias name: alias/ExampleAlias
  8985. //
  8986. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  8987. //
  8988. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  8989. // get the alias name and alias ARN, use ListAliases.
  8990. KeyId *string `min:"1" type:"string"`
  8991. // The type of data key pair that was generated.
  8992. KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"`
  8993. // The encrypted copy of the private key. When you use the HTTP API or the AWS
  8994. // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded.
  8995. //
  8996. // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK.
  8997. PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"`
  8998. // The public key (in plaintext).
  8999. //
  9000. // PublicKey is automatically base64 encoded/decoded by the SDK.
  9001. PublicKey []byte `min:"1" type:"blob"`
  9002. }
  9003. // String returns the string representation
  9004. func (s GenerateDataKeyPairWithoutPlaintextOutput) String() string {
  9005. return awsutil.Prettify(s)
  9006. }
  9007. // GoString returns the string representation
  9008. func (s GenerateDataKeyPairWithoutPlaintextOutput) GoString() string {
  9009. return s.String()
  9010. }
  9011. // SetKeyId sets the KeyId field's value.
  9012. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextOutput {
  9013. s.KeyId = &v
  9014. return s
  9015. }
  9016. // SetKeyPairSpec sets the KeyPairSpec field's value.
  9017. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextOutput {
  9018. s.KeyPairSpec = &v
  9019. return s
  9020. }
  9021. // SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value.
  9022. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput {
  9023. s.PrivateKeyCiphertextBlob = v
  9024. return s
  9025. }
  9026. // SetPublicKey sets the PublicKey field's value.
  9027. func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPublicKey(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput {
  9028. s.PublicKey = v
  9029. return s
  9030. }
  9031. type GenerateDataKeyWithoutPlaintextInput struct {
  9032. _ struct{} `type:"structure"`
  9033. // Specifies the encryption context that will be used when encrypting the data
  9034. // key.
  9035. //
  9036. // An encryption context is a collection of non-secret key-value pairs that
  9037. // represents additional authenticated data. When you use an encryption context
  9038. // to encrypt data, you must specify the same (an exact case-sensitive match)
  9039. // encryption context to decrypt the data. An encryption context is optional
  9040. // when encrypting with a symmetric CMK, but it is highly recommended.
  9041. //
  9042. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  9043. // in the AWS Key Management Service Developer Guide.
  9044. EncryptionContext map[string]*string `type:"map"`
  9045. // A list of grant tokens.
  9046. //
  9047. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  9048. // in the AWS Key Management Service Developer Guide.
  9049. GrantTokens []*string `type:"list"`
  9050. // The identifier of the symmetric customer master key (CMK) that encrypts the
  9051. // data key.
  9052. //
  9053. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  9054. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  9055. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  9056. //
  9057. // For example:
  9058. //
  9059. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  9060. //
  9061. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  9062. //
  9063. // * Alias name: alias/ExampleAlias
  9064. //
  9065. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  9066. //
  9067. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  9068. // get the alias name and alias ARN, use ListAliases.
  9069. //
  9070. // KeyId is a required field
  9071. KeyId *string `min:"1" type:"string" required:"true"`
  9072. // The length of the data key. Use AES_128 to generate a 128-bit symmetric key,
  9073. // or AES_256 to generate a 256-bit symmetric key.
  9074. KeySpec *string `type:"string" enum:"DataKeySpec"`
  9075. // The length of the data key in bytes. For example, use the value 64 to generate
  9076. // a 512-bit data key (64 bytes is 512 bits). For common key lengths (128-bit
  9077. // and 256-bit symmetric keys), we recommend that you use the KeySpec field
  9078. // instead of this one.
  9079. NumberOfBytes *int64 `min:"1" type:"integer"`
  9080. }
  9081. // String returns the string representation
  9082. func (s GenerateDataKeyWithoutPlaintextInput) String() string {
  9083. return awsutil.Prettify(s)
  9084. }
  9085. // GoString returns the string representation
  9086. func (s GenerateDataKeyWithoutPlaintextInput) GoString() string {
  9087. return s.String()
  9088. }
  9089. // Validate inspects the fields of the type to determine if they are valid.
  9090. func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error {
  9091. invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyWithoutPlaintextInput"}
  9092. if s.KeyId == nil {
  9093. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  9094. }
  9095. if s.KeyId != nil && len(*s.KeyId) < 1 {
  9096. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  9097. }
  9098. if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
  9099. invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
  9100. }
  9101. if invalidParams.Len() > 0 {
  9102. return invalidParams
  9103. }
  9104. return nil
  9105. }
  9106. // SetEncryptionContext sets the EncryptionContext field's value.
  9107. func (s *GenerateDataKeyWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyWithoutPlaintextInput {
  9108. s.EncryptionContext = v
  9109. return s
  9110. }
  9111. // SetGrantTokens sets the GrantTokens field's value.
  9112. func (s *GenerateDataKeyWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyWithoutPlaintextInput {
  9113. s.GrantTokens = v
  9114. return s
  9115. }
  9116. // SetKeyId sets the KeyId field's value.
  9117. func (s *GenerateDataKeyWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextInput {
  9118. s.KeyId = &v
  9119. return s
  9120. }
  9121. // SetKeySpec sets the KeySpec field's value.
  9122. func (s *GenerateDataKeyWithoutPlaintextInput) SetKeySpec(v string) *GenerateDataKeyWithoutPlaintextInput {
  9123. s.KeySpec = &v
  9124. return s
  9125. }
  9126. // SetNumberOfBytes sets the NumberOfBytes field's value.
  9127. func (s *GenerateDataKeyWithoutPlaintextInput) SetNumberOfBytes(v int64) *GenerateDataKeyWithoutPlaintextInput {
  9128. s.NumberOfBytes = &v
  9129. return s
  9130. }
  9131. type GenerateDataKeyWithoutPlaintextOutput struct {
  9132. _ struct{} `type:"structure"`
  9133. // The encrypted data key. When you use the HTTP API or the AWS CLI, the value
  9134. // is Base64-encoded. Otherwise, it is not Base64-encoded.
  9135. //
  9136. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  9137. CiphertextBlob []byte `min:"1" type:"blob"`
  9138. // The identifier of the CMK that encrypted the data key.
  9139. KeyId *string `min:"1" type:"string"`
  9140. }
  9141. // String returns the string representation
  9142. func (s GenerateDataKeyWithoutPlaintextOutput) String() string {
  9143. return awsutil.Prettify(s)
  9144. }
  9145. // GoString returns the string representation
  9146. func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string {
  9147. return s.String()
  9148. }
  9149. // SetCiphertextBlob sets the CiphertextBlob field's value.
  9150. func (s *GenerateDataKeyWithoutPlaintextOutput) SetCiphertextBlob(v []byte) *GenerateDataKeyWithoutPlaintextOutput {
  9151. s.CiphertextBlob = v
  9152. return s
  9153. }
  9154. // SetKeyId sets the KeyId field's value.
  9155. func (s *GenerateDataKeyWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextOutput {
  9156. s.KeyId = &v
  9157. return s
  9158. }
  9159. type GenerateRandomInput struct {
  9160. _ struct{} `type:"structure"`
  9161. // Generates the random byte string in the AWS CloudHSM cluster that is associated
  9162. // with the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).
  9163. // To find the ID of a custom key store, use the DescribeCustomKeyStores operation.
  9164. CustomKeyStoreId *string `min:"1" type:"string"`
  9165. // The length of the byte string.
  9166. NumberOfBytes *int64 `min:"1" type:"integer"`
  9167. }
  9168. // String returns the string representation
  9169. func (s GenerateRandomInput) String() string {
  9170. return awsutil.Prettify(s)
  9171. }
  9172. // GoString returns the string representation
  9173. func (s GenerateRandomInput) GoString() string {
  9174. return s.String()
  9175. }
  9176. // Validate inspects the fields of the type to determine if they are valid.
  9177. func (s *GenerateRandomInput) Validate() error {
  9178. invalidParams := request.ErrInvalidParams{Context: "GenerateRandomInput"}
  9179. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  9180. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  9181. }
  9182. if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 {
  9183. invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1))
  9184. }
  9185. if invalidParams.Len() > 0 {
  9186. return invalidParams
  9187. }
  9188. return nil
  9189. }
  9190. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  9191. func (s *GenerateRandomInput) SetCustomKeyStoreId(v string) *GenerateRandomInput {
  9192. s.CustomKeyStoreId = &v
  9193. return s
  9194. }
  9195. // SetNumberOfBytes sets the NumberOfBytes field's value.
  9196. func (s *GenerateRandomInput) SetNumberOfBytes(v int64) *GenerateRandomInput {
  9197. s.NumberOfBytes = &v
  9198. return s
  9199. }
  9200. type GenerateRandomOutput struct {
  9201. _ struct{} `type:"structure"`
  9202. // The random byte string. When you use the HTTP API or the AWS CLI, the value
  9203. // is Base64-encoded. Otherwise, it is not Base64-encoded.
  9204. //
  9205. // Plaintext is automatically base64 encoded/decoded by the SDK.
  9206. Plaintext []byte `min:"1" type:"blob" sensitive:"true"`
  9207. }
  9208. // String returns the string representation
  9209. func (s GenerateRandomOutput) String() string {
  9210. return awsutil.Prettify(s)
  9211. }
  9212. // GoString returns the string representation
  9213. func (s GenerateRandomOutput) GoString() string {
  9214. return s.String()
  9215. }
  9216. // SetPlaintext sets the Plaintext field's value.
  9217. func (s *GenerateRandomOutput) SetPlaintext(v []byte) *GenerateRandomOutput {
  9218. s.Plaintext = v
  9219. return s
  9220. }
  9221. type GetKeyPolicyInput struct {
  9222. _ struct{} `type:"structure"`
  9223. // A unique identifier for the customer master key (CMK).
  9224. //
  9225. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  9226. //
  9227. // For example:
  9228. //
  9229. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  9230. //
  9231. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  9232. //
  9233. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  9234. //
  9235. // KeyId is a required field
  9236. KeyId *string `min:"1" type:"string" required:"true"`
  9237. // Specifies the name of the key policy. The only valid name is default. To
  9238. // get the names of key policies, use ListKeyPolicies.
  9239. //
  9240. // PolicyName is a required field
  9241. PolicyName *string `min:"1" type:"string" required:"true"`
  9242. }
  9243. // String returns the string representation
  9244. func (s GetKeyPolicyInput) String() string {
  9245. return awsutil.Prettify(s)
  9246. }
  9247. // GoString returns the string representation
  9248. func (s GetKeyPolicyInput) GoString() string {
  9249. return s.String()
  9250. }
  9251. // Validate inspects the fields of the type to determine if they are valid.
  9252. func (s *GetKeyPolicyInput) Validate() error {
  9253. invalidParams := request.ErrInvalidParams{Context: "GetKeyPolicyInput"}
  9254. if s.KeyId == nil {
  9255. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  9256. }
  9257. if s.KeyId != nil && len(*s.KeyId) < 1 {
  9258. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  9259. }
  9260. if s.PolicyName == nil {
  9261. invalidParams.Add(request.NewErrParamRequired("PolicyName"))
  9262. }
  9263. if s.PolicyName != nil && len(*s.PolicyName) < 1 {
  9264. invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
  9265. }
  9266. if invalidParams.Len() > 0 {
  9267. return invalidParams
  9268. }
  9269. return nil
  9270. }
  9271. // SetKeyId sets the KeyId field's value.
  9272. func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput {
  9273. s.KeyId = &v
  9274. return s
  9275. }
  9276. // SetPolicyName sets the PolicyName field's value.
  9277. func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput {
  9278. s.PolicyName = &v
  9279. return s
  9280. }
  9281. type GetKeyPolicyOutput struct {
  9282. _ struct{} `type:"structure"`
  9283. // A key policy document in JSON format.
  9284. Policy *string `min:"1" type:"string"`
  9285. }
  9286. // String returns the string representation
  9287. func (s GetKeyPolicyOutput) String() string {
  9288. return awsutil.Prettify(s)
  9289. }
  9290. // GoString returns the string representation
  9291. func (s GetKeyPolicyOutput) GoString() string {
  9292. return s.String()
  9293. }
  9294. // SetPolicy sets the Policy field's value.
  9295. func (s *GetKeyPolicyOutput) SetPolicy(v string) *GetKeyPolicyOutput {
  9296. s.Policy = &v
  9297. return s
  9298. }
  9299. type GetKeyRotationStatusInput struct {
  9300. _ struct{} `type:"structure"`
  9301. // A unique identifier for the customer master key (CMK).
  9302. //
  9303. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify
  9304. // a CMK in a different AWS account, you must use the key ARN.
  9305. //
  9306. // For example:
  9307. //
  9308. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  9309. //
  9310. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  9311. //
  9312. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  9313. //
  9314. // KeyId is a required field
  9315. KeyId *string `min:"1" type:"string" required:"true"`
  9316. }
  9317. // String returns the string representation
  9318. func (s GetKeyRotationStatusInput) String() string {
  9319. return awsutil.Prettify(s)
  9320. }
  9321. // GoString returns the string representation
  9322. func (s GetKeyRotationStatusInput) GoString() string {
  9323. return s.String()
  9324. }
  9325. // Validate inspects the fields of the type to determine if they are valid.
  9326. func (s *GetKeyRotationStatusInput) Validate() error {
  9327. invalidParams := request.ErrInvalidParams{Context: "GetKeyRotationStatusInput"}
  9328. if s.KeyId == nil {
  9329. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  9330. }
  9331. if s.KeyId != nil && len(*s.KeyId) < 1 {
  9332. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  9333. }
  9334. if invalidParams.Len() > 0 {
  9335. return invalidParams
  9336. }
  9337. return nil
  9338. }
  9339. // SetKeyId sets the KeyId field's value.
  9340. func (s *GetKeyRotationStatusInput) SetKeyId(v string) *GetKeyRotationStatusInput {
  9341. s.KeyId = &v
  9342. return s
  9343. }
  9344. type GetKeyRotationStatusOutput struct {
  9345. _ struct{} `type:"structure"`
  9346. // A Boolean value that specifies whether key rotation is enabled.
  9347. KeyRotationEnabled *bool `type:"boolean"`
  9348. }
  9349. // String returns the string representation
  9350. func (s GetKeyRotationStatusOutput) String() string {
  9351. return awsutil.Prettify(s)
  9352. }
  9353. // GoString returns the string representation
  9354. func (s GetKeyRotationStatusOutput) GoString() string {
  9355. return s.String()
  9356. }
  9357. // SetKeyRotationEnabled sets the KeyRotationEnabled field's value.
  9358. func (s *GetKeyRotationStatusOutput) SetKeyRotationEnabled(v bool) *GetKeyRotationStatusOutput {
  9359. s.KeyRotationEnabled = &v
  9360. return s
  9361. }
  9362. type GetParametersForImportInput struct {
  9363. _ struct{} `type:"structure"`
  9364. // The identifier of the symmetric CMK into which you will import key material.
  9365. // The Origin of the CMK must be EXTERNAL.
  9366. //
  9367. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  9368. //
  9369. // For example:
  9370. //
  9371. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  9372. //
  9373. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  9374. //
  9375. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  9376. //
  9377. // KeyId is a required field
  9378. KeyId *string `min:"1" type:"string" required:"true"`
  9379. // The algorithm you will use to encrypt the key material before importing it
  9380. // with ImportKeyMaterial. For more information, see Encrypt the Key Material
  9381. // (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-encrypt-key-material.html)
  9382. // in the AWS Key Management Service Developer Guide.
  9383. //
  9384. // WrappingAlgorithm is a required field
  9385. WrappingAlgorithm *string `type:"string" required:"true" enum:"AlgorithmSpec"`
  9386. // The type of wrapping key (public key) to return in the response. Only 2048-bit
  9387. // RSA public keys are supported.
  9388. //
  9389. // WrappingKeySpec is a required field
  9390. WrappingKeySpec *string `type:"string" required:"true" enum:"WrappingKeySpec"`
  9391. }
  9392. // String returns the string representation
  9393. func (s GetParametersForImportInput) String() string {
  9394. return awsutil.Prettify(s)
  9395. }
  9396. // GoString returns the string representation
  9397. func (s GetParametersForImportInput) GoString() string {
  9398. return s.String()
  9399. }
  9400. // Validate inspects the fields of the type to determine if they are valid.
  9401. func (s *GetParametersForImportInput) Validate() error {
  9402. invalidParams := request.ErrInvalidParams{Context: "GetParametersForImportInput"}
  9403. if s.KeyId == nil {
  9404. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  9405. }
  9406. if s.KeyId != nil && len(*s.KeyId) < 1 {
  9407. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  9408. }
  9409. if s.WrappingAlgorithm == nil {
  9410. invalidParams.Add(request.NewErrParamRequired("WrappingAlgorithm"))
  9411. }
  9412. if s.WrappingKeySpec == nil {
  9413. invalidParams.Add(request.NewErrParamRequired("WrappingKeySpec"))
  9414. }
  9415. if invalidParams.Len() > 0 {
  9416. return invalidParams
  9417. }
  9418. return nil
  9419. }
  9420. // SetKeyId sets the KeyId field's value.
  9421. func (s *GetParametersForImportInput) SetKeyId(v string) *GetParametersForImportInput {
  9422. s.KeyId = &v
  9423. return s
  9424. }
  9425. // SetWrappingAlgorithm sets the WrappingAlgorithm field's value.
  9426. func (s *GetParametersForImportInput) SetWrappingAlgorithm(v string) *GetParametersForImportInput {
  9427. s.WrappingAlgorithm = &v
  9428. return s
  9429. }
  9430. // SetWrappingKeySpec sets the WrappingKeySpec field's value.
  9431. func (s *GetParametersForImportInput) SetWrappingKeySpec(v string) *GetParametersForImportInput {
  9432. s.WrappingKeySpec = &v
  9433. return s
  9434. }
  9435. type GetParametersForImportOutput struct {
  9436. _ struct{} `type:"structure"`
  9437. // The import token to send in a subsequent ImportKeyMaterial request.
  9438. //
  9439. // ImportToken is automatically base64 encoded/decoded by the SDK.
  9440. ImportToken []byte `min:"1" type:"blob"`
  9441. // The identifier of the CMK to use in a subsequent ImportKeyMaterial request.
  9442. // This is the same CMK specified in the GetParametersForImport request.
  9443. KeyId *string `min:"1" type:"string"`
  9444. // The time at which the import token and public key are no longer valid. After
  9445. // this time, you cannot use them to make an ImportKeyMaterial request and you
  9446. // must send another GetParametersForImport request to get new ones.
  9447. ParametersValidTo *time.Time `type:"timestamp"`
  9448. // The public key to use to encrypt the key material before importing it with
  9449. // ImportKeyMaterial.
  9450. //
  9451. // PublicKey is automatically base64 encoded/decoded by the SDK.
  9452. PublicKey []byte `min:"1" type:"blob" sensitive:"true"`
  9453. }
  9454. // String returns the string representation
  9455. func (s GetParametersForImportOutput) String() string {
  9456. return awsutil.Prettify(s)
  9457. }
  9458. // GoString returns the string representation
  9459. func (s GetParametersForImportOutput) GoString() string {
  9460. return s.String()
  9461. }
  9462. // SetImportToken sets the ImportToken field's value.
  9463. func (s *GetParametersForImportOutput) SetImportToken(v []byte) *GetParametersForImportOutput {
  9464. s.ImportToken = v
  9465. return s
  9466. }
  9467. // SetKeyId sets the KeyId field's value.
  9468. func (s *GetParametersForImportOutput) SetKeyId(v string) *GetParametersForImportOutput {
  9469. s.KeyId = &v
  9470. return s
  9471. }
  9472. // SetParametersValidTo sets the ParametersValidTo field's value.
  9473. func (s *GetParametersForImportOutput) SetParametersValidTo(v time.Time) *GetParametersForImportOutput {
  9474. s.ParametersValidTo = &v
  9475. return s
  9476. }
  9477. // SetPublicKey sets the PublicKey field's value.
  9478. func (s *GetParametersForImportOutput) SetPublicKey(v []byte) *GetParametersForImportOutput {
  9479. s.PublicKey = v
  9480. return s
  9481. }
  9482. type GetPublicKeyInput struct {
  9483. _ struct{} `type:"structure"`
  9484. // A list of grant tokens.
  9485. //
  9486. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  9487. // in the AWS Key Management Service Developer Guide.
  9488. GrantTokens []*string `type:"list"`
  9489. // Identifies the asymmetric CMK that includes the public key.
  9490. //
  9491. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  9492. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  9493. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  9494. //
  9495. // For example:
  9496. //
  9497. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  9498. //
  9499. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  9500. //
  9501. // * Alias name: alias/ExampleAlias
  9502. //
  9503. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  9504. //
  9505. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  9506. // get the alias name and alias ARN, use ListAliases.
  9507. //
  9508. // KeyId is a required field
  9509. KeyId *string `min:"1" type:"string" required:"true"`
  9510. }
  9511. // String returns the string representation
  9512. func (s GetPublicKeyInput) String() string {
  9513. return awsutil.Prettify(s)
  9514. }
  9515. // GoString returns the string representation
  9516. func (s GetPublicKeyInput) GoString() string {
  9517. return s.String()
  9518. }
  9519. // Validate inspects the fields of the type to determine if they are valid.
  9520. func (s *GetPublicKeyInput) Validate() error {
  9521. invalidParams := request.ErrInvalidParams{Context: "GetPublicKeyInput"}
  9522. if s.KeyId == nil {
  9523. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  9524. }
  9525. if s.KeyId != nil && len(*s.KeyId) < 1 {
  9526. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  9527. }
  9528. if invalidParams.Len() > 0 {
  9529. return invalidParams
  9530. }
  9531. return nil
  9532. }
  9533. // SetGrantTokens sets the GrantTokens field's value.
  9534. func (s *GetPublicKeyInput) SetGrantTokens(v []*string) *GetPublicKeyInput {
  9535. s.GrantTokens = v
  9536. return s
  9537. }
  9538. // SetKeyId sets the KeyId field's value.
  9539. func (s *GetPublicKeyInput) SetKeyId(v string) *GetPublicKeyInput {
  9540. s.KeyId = &v
  9541. return s
  9542. }
  9543. type GetPublicKeyOutput struct {
  9544. _ struct{} `type:"structure"`
  9545. // The type of the of the public key that was downloaded.
  9546. CustomerMasterKeySpec *string `type:"string" enum:"CustomerMasterKeySpec"`
  9547. // The encryption algorithms that AWS KMS supports for this key.
  9548. //
  9549. // This information is critical. If a public key encrypts data outside of AWS
  9550. // KMS by using an unsupported encryption algorithm, the ciphertext cannot be
  9551. // decrypted.
  9552. //
  9553. // This field appears in the response only when the KeyUsage of the public key
  9554. // is ENCRYPT_DECRYPT.
  9555. EncryptionAlgorithms []*string `type:"list"`
  9556. // The identifier of the asymmetric CMK from which the public key was downloaded.
  9557. KeyId *string `min:"1" type:"string"`
  9558. // The permitted use of the public key. Valid values are ENCRYPT_DECRYPT or
  9559. // SIGN_VERIFY.
  9560. //
  9561. // This information is critical. If a public key with SIGN_VERIFY key usage
  9562. // encrypts data outside of AWS KMS, the ciphertext cannot be decrypted.
  9563. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  9564. // The exported public key.
  9565. //
  9566. // This value is returned as a binary Distinguished Encoding Rules (https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf)
  9567. // (DER)-encoded object. To decode it, use an ASN.1 parsing tool, such as OpenSSL
  9568. // asn1parse (https://www.openssl.org/docs/man1.0.2/man1/asn1parse.html).
  9569. //
  9570. // PublicKey is automatically base64 encoded/decoded by the SDK.
  9571. PublicKey []byte `min:"1" type:"blob"`
  9572. // The signing algorithms that AWS KMS supports for this key.
  9573. //
  9574. // This field appears in the response only when the KeyUsage of the public key
  9575. // is SIGN_VERIFY.
  9576. SigningAlgorithms []*string `type:"list"`
  9577. }
  9578. // String returns the string representation
  9579. func (s GetPublicKeyOutput) String() string {
  9580. return awsutil.Prettify(s)
  9581. }
  9582. // GoString returns the string representation
  9583. func (s GetPublicKeyOutput) GoString() string {
  9584. return s.String()
  9585. }
  9586. // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value.
  9587. func (s *GetPublicKeyOutput) SetCustomerMasterKeySpec(v string) *GetPublicKeyOutput {
  9588. s.CustomerMasterKeySpec = &v
  9589. return s
  9590. }
  9591. // SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value.
  9592. func (s *GetPublicKeyOutput) SetEncryptionAlgorithms(v []*string) *GetPublicKeyOutput {
  9593. s.EncryptionAlgorithms = v
  9594. return s
  9595. }
  9596. // SetKeyId sets the KeyId field's value.
  9597. func (s *GetPublicKeyOutput) SetKeyId(v string) *GetPublicKeyOutput {
  9598. s.KeyId = &v
  9599. return s
  9600. }
  9601. // SetKeyUsage sets the KeyUsage field's value.
  9602. func (s *GetPublicKeyOutput) SetKeyUsage(v string) *GetPublicKeyOutput {
  9603. s.KeyUsage = &v
  9604. return s
  9605. }
  9606. // SetPublicKey sets the PublicKey field's value.
  9607. func (s *GetPublicKeyOutput) SetPublicKey(v []byte) *GetPublicKeyOutput {
  9608. s.PublicKey = v
  9609. return s
  9610. }
  9611. // SetSigningAlgorithms sets the SigningAlgorithms field's value.
  9612. func (s *GetPublicKeyOutput) SetSigningAlgorithms(v []*string) *GetPublicKeyOutput {
  9613. s.SigningAlgorithms = v
  9614. return s
  9615. }
  9616. // Use this structure to allow cryptographic operations in the grant only when
  9617. // the operation request includes the specified encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context).
  9618. //
  9619. // AWS KMS applies the grant constraints only when the grant allows a cryptographic
  9620. // operation that accepts an encryption context as input, such as the following.
  9621. //
  9622. // * Encrypt
  9623. //
  9624. // * Decrypt
  9625. //
  9626. // * GenerateDataKey
  9627. //
  9628. // * GenerateDataKeyWithoutPlaintext
  9629. //
  9630. // * ReEncrypt
  9631. //
  9632. // AWS KMS does not apply the grant constraints to other operations, such as
  9633. // DescribeKey or ScheduleKeyDeletion.
  9634. //
  9635. // In a cryptographic operation, the encryption context in the decryption operation
  9636. // must be an exact, case-sensitive match for the keys and values in the encryption
  9637. // context of the encryption operation. Only the order of the pairs can vary.
  9638. //
  9639. // However, in a grant constraint, the key in each key-value pair is not case
  9640. // sensitive, but the value is case sensitive.
  9641. //
  9642. // To avoid confusion, do not use multiple encryption context pairs that differ
  9643. // only by case. To require a fully case-sensitive encryption context, use the
  9644. // kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM
  9645. // or key policy. For details, see kms:EncryptionContext: (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context)
  9646. // in the AWS Key Management Service Developer Guide .
  9647. type GrantConstraints struct {
  9648. _ struct{} `type:"structure"`
  9649. // A list of key-value pairs that must match the encryption context in the cryptographic
  9650. // operation request. The grant allows the operation only when the encryption
  9651. // context in the request is the same as the encryption context specified in
  9652. // this constraint.
  9653. EncryptionContextEquals map[string]*string `type:"map"`
  9654. // A list of key-value pairs that must be included in the encryption context
  9655. // of the cryptographic operation request. The grant allows the cryptographic
  9656. // operation only when the encryption context in the request includes the key-value
  9657. // pairs specified in this constraint, although it can include additional key-value
  9658. // pairs.
  9659. EncryptionContextSubset map[string]*string `type:"map"`
  9660. }
  9661. // String returns the string representation
  9662. func (s GrantConstraints) String() string {
  9663. return awsutil.Prettify(s)
  9664. }
  9665. // GoString returns the string representation
  9666. func (s GrantConstraints) GoString() string {
  9667. return s.String()
  9668. }
  9669. // SetEncryptionContextEquals sets the EncryptionContextEquals field's value.
  9670. func (s *GrantConstraints) SetEncryptionContextEquals(v map[string]*string) *GrantConstraints {
  9671. s.EncryptionContextEquals = v
  9672. return s
  9673. }
  9674. // SetEncryptionContextSubset sets the EncryptionContextSubset field's value.
  9675. func (s *GrantConstraints) SetEncryptionContextSubset(v map[string]*string) *GrantConstraints {
  9676. s.EncryptionContextSubset = v
  9677. return s
  9678. }
  9679. // Contains information about an entry in a list of grants.
  9680. type GrantListEntry struct {
  9681. _ struct{} `type:"structure"`
  9682. // A list of key-value pairs that must be present in the encryption context
  9683. // of certain subsequent operations that the grant allows.
  9684. Constraints *GrantConstraints `type:"structure"`
  9685. // The date and time when the grant was created.
  9686. CreationDate *time.Time `type:"timestamp"`
  9687. // The unique identifier for the grant.
  9688. GrantId *string `min:"1" type:"string"`
  9689. // The principal that receives the grant's permissions.
  9690. GranteePrincipal *string `min:"1" type:"string"`
  9691. // The AWS account under which the grant was issued.
  9692. IssuingAccount *string `min:"1" type:"string"`
  9693. // The unique identifier for the customer master key (CMK) to which the grant
  9694. // applies.
  9695. KeyId *string `min:"1" type:"string"`
  9696. // The friendly name that identifies the grant. If a name was provided in the
  9697. // CreateGrant request, that name is returned. Otherwise this value is null.
  9698. Name *string `min:"1" type:"string"`
  9699. // The list of operations permitted by the grant.
  9700. Operations []*string `type:"list"`
  9701. // The principal that can retire the grant.
  9702. RetiringPrincipal *string `min:"1" type:"string"`
  9703. }
  9704. // String returns the string representation
  9705. func (s GrantListEntry) String() string {
  9706. return awsutil.Prettify(s)
  9707. }
  9708. // GoString returns the string representation
  9709. func (s GrantListEntry) GoString() string {
  9710. return s.String()
  9711. }
  9712. // SetConstraints sets the Constraints field's value.
  9713. func (s *GrantListEntry) SetConstraints(v *GrantConstraints) *GrantListEntry {
  9714. s.Constraints = v
  9715. return s
  9716. }
  9717. // SetCreationDate sets the CreationDate field's value.
  9718. func (s *GrantListEntry) SetCreationDate(v time.Time) *GrantListEntry {
  9719. s.CreationDate = &v
  9720. return s
  9721. }
  9722. // SetGrantId sets the GrantId field's value.
  9723. func (s *GrantListEntry) SetGrantId(v string) *GrantListEntry {
  9724. s.GrantId = &v
  9725. return s
  9726. }
  9727. // SetGranteePrincipal sets the GranteePrincipal field's value.
  9728. func (s *GrantListEntry) SetGranteePrincipal(v string) *GrantListEntry {
  9729. s.GranteePrincipal = &v
  9730. return s
  9731. }
  9732. // SetIssuingAccount sets the IssuingAccount field's value.
  9733. func (s *GrantListEntry) SetIssuingAccount(v string) *GrantListEntry {
  9734. s.IssuingAccount = &v
  9735. return s
  9736. }
  9737. // SetKeyId sets the KeyId field's value.
  9738. func (s *GrantListEntry) SetKeyId(v string) *GrantListEntry {
  9739. s.KeyId = &v
  9740. return s
  9741. }
  9742. // SetName sets the Name field's value.
  9743. func (s *GrantListEntry) SetName(v string) *GrantListEntry {
  9744. s.Name = &v
  9745. return s
  9746. }
  9747. // SetOperations sets the Operations field's value.
  9748. func (s *GrantListEntry) SetOperations(v []*string) *GrantListEntry {
  9749. s.Operations = v
  9750. return s
  9751. }
  9752. // SetRetiringPrincipal sets the RetiringPrincipal field's value.
  9753. func (s *GrantListEntry) SetRetiringPrincipal(v string) *GrantListEntry {
  9754. s.RetiringPrincipal = &v
  9755. return s
  9756. }
  9757. type ImportKeyMaterialInput struct {
  9758. _ struct{} `type:"structure"`
  9759. // The encrypted key material to import. The key material must be encrypted
  9760. // with the public wrapping key that GetParametersForImport returned, using
  9761. // the wrapping algorithm that you specified in the same GetParametersForImport
  9762. // request.
  9763. //
  9764. // EncryptedKeyMaterial is automatically base64 encoded/decoded by the SDK.
  9765. //
  9766. // EncryptedKeyMaterial is a required field
  9767. EncryptedKeyMaterial []byte `min:"1" type:"blob" required:"true"`
  9768. // Specifies whether the key material expires. The default is KEY_MATERIAL_EXPIRES,
  9769. // in which case you must include the ValidTo parameter. When this parameter
  9770. // is set to KEY_MATERIAL_DOES_NOT_EXPIRE, you must omit the ValidTo parameter.
  9771. ExpirationModel *string `type:"string" enum:"ExpirationModelType"`
  9772. // The import token that you received in the response to a previous GetParametersForImport
  9773. // request. It must be from the same response that contained the public key
  9774. // that you used to encrypt the key material.
  9775. //
  9776. // ImportToken is automatically base64 encoded/decoded by the SDK.
  9777. //
  9778. // ImportToken is a required field
  9779. ImportToken []byte `min:"1" type:"blob" required:"true"`
  9780. // The identifier of the symmetric CMK that receives the imported key material.
  9781. // The CMK's Origin must be EXTERNAL. This must be the same CMK specified in
  9782. // the KeyID parameter of the corresponding GetParametersForImport request.
  9783. //
  9784. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  9785. //
  9786. // For example:
  9787. //
  9788. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  9789. //
  9790. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  9791. //
  9792. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  9793. //
  9794. // KeyId is a required field
  9795. KeyId *string `min:"1" type:"string" required:"true"`
  9796. // The time at which the imported key material expires. When the key material
  9797. // expires, AWS KMS deletes the key material and the CMK becomes unusable. You
  9798. // must omit this parameter when the ExpirationModel parameter is set to KEY_MATERIAL_DOES_NOT_EXPIRE.
  9799. // Otherwise it is required.
  9800. ValidTo *time.Time `type:"timestamp"`
  9801. }
  9802. // String returns the string representation
  9803. func (s ImportKeyMaterialInput) String() string {
  9804. return awsutil.Prettify(s)
  9805. }
  9806. // GoString returns the string representation
  9807. func (s ImportKeyMaterialInput) GoString() string {
  9808. return s.String()
  9809. }
  9810. // Validate inspects the fields of the type to determine if they are valid.
  9811. func (s *ImportKeyMaterialInput) Validate() error {
  9812. invalidParams := request.ErrInvalidParams{Context: "ImportKeyMaterialInput"}
  9813. if s.EncryptedKeyMaterial == nil {
  9814. invalidParams.Add(request.NewErrParamRequired("EncryptedKeyMaterial"))
  9815. }
  9816. if s.EncryptedKeyMaterial != nil && len(s.EncryptedKeyMaterial) < 1 {
  9817. invalidParams.Add(request.NewErrParamMinLen("EncryptedKeyMaterial", 1))
  9818. }
  9819. if s.ImportToken == nil {
  9820. invalidParams.Add(request.NewErrParamRequired("ImportToken"))
  9821. }
  9822. if s.ImportToken != nil && len(s.ImportToken) < 1 {
  9823. invalidParams.Add(request.NewErrParamMinLen("ImportToken", 1))
  9824. }
  9825. if s.KeyId == nil {
  9826. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  9827. }
  9828. if s.KeyId != nil && len(*s.KeyId) < 1 {
  9829. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  9830. }
  9831. if invalidParams.Len() > 0 {
  9832. return invalidParams
  9833. }
  9834. return nil
  9835. }
  9836. // SetEncryptedKeyMaterial sets the EncryptedKeyMaterial field's value.
  9837. func (s *ImportKeyMaterialInput) SetEncryptedKeyMaterial(v []byte) *ImportKeyMaterialInput {
  9838. s.EncryptedKeyMaterial = v
  9839. return s
  9840. }
  9841. // SetExpirationModel sets the ExpirationModel field's value.
  9842. func (s *ImportKeyMaterialInput) SetExpirationModel(v string) *ImportKeyMaterialInput {
  9843. s.ExpirationModel = &v
  9844. return s
  9845. }
  9846. // SetImportToken sets the ImportToken field's value.
  9847. func (s *ImportKeyMaterialInput) SetImportToken(v []byte) *ImportKeyMaterialInput {
  9848. s.ImportToken = v
  9849. return s
  9850. }
  9851. // SetKeyId sets the KeyId field's value.
  9852. func (s *ImportKeyMaterialInput) SetKeyId(v string) *ImportKeyMaterialInput {
  9853. s.KeyId = &v
  9854. return s
  9855. }
  9856. // SetValidTo sets the ValidTo field's value.
  9857. func (s *ImportKeyMaterialInput) SetValidTo(v time.Time) *ImportKeyMaterialInput {
  9858. s.ValidTo = &v
  9859. return s
  9860. }
  9861. type ImportKeyMaterialOutput struct {
  9862. _ struct{} `type:"structure"`
  9863. }
  9864. // String returns the string representation
  9865. func (s ImportKeyMaterialOutput) String() string {
  9866. return awsutil.Prettify(s)
  9867. }
  9868. // GoString returns the string representation
  9869. func (s ImportKeyMaterialOutput) GoString() string {
  9870. return s.String()
  9871. }
  9872. // The request was rejected because the specified CMK cannot decrypt the data.
  9873. // The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request
  9874. // must identify the same CMK that was used to encrypt the ciphertext.
  9875. type IncorrectKeyException struct {
  9876. _ struct{} `type:"structure"`
  9877. respMetadata protocol.ResponseMetadata
  9878. Message_ *string `locationName:"message" type:"string"`
  9879. }
  9880. // String returns the string representation
  9881. func (s IncorrectKeyException) String() string {
  9882. return awsutil.Prettify(s)
  9883. }
  9884. // GoString returns the string representation
  9885. func (s IncorrectKeyException) GoString() string {
  9886. return s.String()
  9887. }
  9888. func newErrorIncorrectKeyException(v protocol.ResponseMetadata) error {
  9889. return &IncorrectKeyException{
  9890. respMetadata: v,
  9891. }
  9892. }
  9893. // Code returns the exception type name.
  9894. func (s IncorrectKeyException) Code() string {
  9895. return "IncorrectKeyException"
  9896. }
  9897. // Message returns the exception's message.
  9898. func (s IncorrectKeyException) Message() string {
  9899. if s.Message_ != nil {
  9900. return *s.Message_
  9901. }
  9902. return ""
  9903. }
  9904. // OrigErr always returns nil, satisfies awserr.Error interface.
  9905. func (s IncorrectKeyException) OrigErr() error {
  9906. return nil
  9907. }
  9908. func (s IncorrectKeyException) Error() string {
  9909. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  9910. }
  9911. // Status code returns the HTTP status code for the request's response error.
  9912. func (s IncorrectKeyException) StatusCode() int {
  9913. return s.respMetadata.StatusCode
  9914. }
  9915. // RequestID returns the service's response RequestID for request.
  9916. func (s IncorrectKeyException) RequestID() string {
  9917. return s.respMetadata.RequestID
  9918. }
  9919. // The request was rejected because the key material in the request is, expired,
  9920. // invalid, or is not the same key material that was previously imported into
  9921. // this customer master key (CMK).
  9922. type IncorrectKeyMaterialException struct {
  9923. _ struct{} `type:"structure"`
  9924. respMetadata protocol.ResponseMetadata
  9925. Message_ *string `locationName:"message" type:"string"`
  9926. }
  9927. // String returns the string representation
  9928. func (s IncorrectKeyMaterialException) String() string {
  9929. return awsutil.Prettify(s)
  9930. }
  9931. // GoString returns the string representation
  9932. func (s IncorrectKeyMaterialException) GoString() string {
  9933. return s.String()
  9934. }
  9935. func newErrorIncorrectKeyMaterialException(v protocol.ResponseMetadata) error {
  9936. return &IncorrectKeyMaterialException{
  9937. respMetadata: v,
  9938. }
  9939. }
  9940. // Code returns the exception type name.
  9941. func (s IncorrectKeyMaterialException) Code() string {
  9942. return "IncorrectKeyMaterialException"
  9943. }
  9944. // Message returns the exception's message.
  9945. func (s IncorrectKeyMaterialException) Message() string {
  9946. if s.Message_ != nil {
  9947. return *s.Message_
  9948. }
  9949. return ""
  9950. }
  9951. // OrigErr always returns nil, satisfies awserr.Error interface.
  9952. func (s IncorrectKeyMaterialException) OrigErr() error {
  9953. return nil
  9954. }
  9955. func (s IncorrectKeyMaterialException) Error() string {
  9956. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  9957. }
  9958. // Status code returns the HTTP status code for the request's response error.
  9959. func (s IncorrectKeyMaterialException) StatusCode() int {
  9960. return s.respMetadata.StatusCode
  9961. }
  9962. // RequestID returns the service's response RequestID for request.
  9963. func (s IncorrectKeyMaterialException) RequestID() string {
  9964. return s.respMetadata.RequestID
  9965. }
  9966. // The request was rejected because the trust anchor certificate in the request
  9967. // is not the trust anchor certificate for the specified AWS CloudHSM cluster.
  9968. //
  9969. // When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr),
  9970. // you create the trust anchor certificate and save it in the customerCA.crt
  9971. // file.
  9972. type IncorrectTrustAnchorException struct {
  9973. _ struct{} `type:"structure"`
  9974. respMetadata protocol.ResponseMetadata
  9975. Message_ *string `locationName:"message" type:"string"`
  9976. }
  9977. // String returns the string representation
  9978. func (s IncorrectTrustAnchorException) String() string {
  9979. return awsutil.Prettify(s)
  9980. }
  9981. // GoString returns the string representation
  9982. func (s IncorrectTrustAnchorException) GoString() string {
  9983. return s.String()
  9984. }
  9985. func newErrorIncorrectTrustAnchorException(v protocol.ResponseMetadata) error {
  9986. return &IncorrectTrustAnchorException{
  9987. respMetadata: v,
  9988. }
  9989. }
  9990. // Code returns the exception type name.
  9991. func (s IncorrectTrustAnchorException) Code() string {
  9992. return "IncorrectTrustAnchorException"
  9993. }
  9994. // Message returns the exception's message.
  9995. func (s IncorrectTrustAnchorException) Message() string {
  9996. if s.Message_ != nil {
  9997. return *s.Message_
  9998. }
  9999. return ""
  10000. }
  10001. // OrigErr always returns nil, satisfies awserr.Error interface.
  10002. func (s IncorrectTrustAnchorException) OrigErr() error {
  10003. return nil
  10004. }
  10005. func (s IncorrectTrustAnchorException) Error() string {
  10006. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10007. }
  10008. // Status code returns the HTTP status code for the request's response error.
  10009. func (s IncorrectTrustAnchorException) StatusCode() int {
  10010. return s.respMetadata.StatusCode
  10011. }
  10012. // RequestID returns the service's response RequestID for request.
  10013. func (s IncorrectTrustAnchorException) RequestID() string {
  10014. return s.respMetadata.RequestID
  10015. }
  10016. // The request was rejected because an internal exception occurred. The request
  10017. // can be retried.
  10018. type InternalException struct {
  10019. _ struct{} `type:"structure"`
  10020. respMetadata protocol.ResponseMetadata
  10021. Message_ *string `locationName:"message" type:"string"`
  10022. }
  10023. // String returns the string representation
  10024. func (s InternalException) String() string {
  10025. return awsutil.Prettify(s)
  10026. }
  10027. // GoString returns the string representation
  10028. func (s InternalException) GoString() string {
  10029. return s.String()
  10030. }
  10031. func newErrorInternalException(v protocol.ResponseMetadata) error {
  10032. return &InternalException{
  10033. respMetadata: v,
  10034. }
  10035. }
  10036. // Code returns the exception type name.
  10037. func (s InternalException) Code() string {
  10038. return "KMSInternalException"
  10039. }
  10040. // Message returns the exception's message.
  10041. func (s InternalException) Message() string {
  10042. if s.Message_ != nil {
  10043. return *s.Message_
  10044. }
  10045. return ""
  10046. }
  10047. // OrigErr always returns nil, satisfies awserr.Error interface.
  10048. func (s InternalException) OrigErr() error {
  10049. return nil
  10050. }
  10051. func (s InternalException) Error() string {
  10052. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10053. }
  10054. // Status code returns the HTTP status code for the request's response error.
  10055. func (s InternalException) StatusCode() int {
  10056. return s.respMetadata.StatusCode
  10057. }
  10058. // RequestID returns the service's response RequestID for request.
  10059. func (s InternalException) RequestID() string {
  10060. return s.respMetadata.RequestID
  10061. }
  10062. // The request was rejected because the specified alias name is not valid.
  10063. type InvalidAliasNameException struct {
  10064. _ struct{} `type:"structure"`
  10065. respMetadata protocol.ResponseMetadata
  10066. Message_ *string `locationName:"message" type:"string"`
  10067. }
  10068. // String returns the string representation
  10069. func (s InvalidAliasNameException) String() string {
  10070. return awsutil.Prettify(s)
  10071. }
  10072. // GoString returns the string representation
  10073. func (s InvalidAliasNameException) GoString() string {
  10074. return s.String()
  10075. }
  10076. func newErrorInvalidAliasNameException(v protocol.ResponseMetadata) error {
  10077. return &InvalidAliasNameException{
  10078. respMetadata: v,
  10079. }
  10080. }
  10081. // Code returns the exception type name.
  10082. func (s InvalidAliasNameException) Code() string {
  10083. return "InvalidAliasNameException"
  10084. }
  10085. // Message returns the exception's message.
  10086. func (s InvalidAliasNameException) Message() string {
  10087. if s.Message_ != nil {
  10088. return *s.Message_
  10089. }
  10090. return ""
  10091. }
  10092. // OrigErr always returns nil, satisfies awserr.Error interface.
  10093. func (s InvalidAliasNameException) OrigErr() error {
  10094. return nil
  10095. }
  10096. func (s InvalidAliasNameException) Error() string {
  10097. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10098. }
  10099. // Status code returns the HTTP status code for the request's response error.
  10100. func (s InvalidAliasNameException) StatusCode() int {
  10101. return s.respMetadata.StatusCode
  10102. }
  10103. // RequestID returns the service's response RequestID for request.
  10104. func (s InvalidAliasNameException) RequestID() string {
  10105. return s.respMetadata.RequestID
  10106. }
  10107. // The request was rejected because a specified ARN, or an ARN in a key policy,
  10108. // is not valid.
  10109. type InvalidArnException struct {
  10110. _ struct{} `type:"structure"`
  10111. respMetadata protocol.ResponseMetadata
  10112. Message_ *string `locationName:"message" type:"string"`
  10113. }
  10114. // String returns the string representation
  10115. func (s InvalidArnException) String() string {
  10116. return awsutil.Prettify(s)
  10117. }
  10118. // GoString returns the string representation
  10119. func (s InvalidArnException) GoString() string {
  10120. return s.String()
  10121. }
  10122. func newErrorInvalidArnException(v protocol.ResponseMetadata) error {
  10123. return &InvalidArnException{
  10124. respMetadata: v,
  10125. }
  10126. }
  10127. // Code returns the exception type name.
  10128. func (s InvalidArnException) Code() string {
  10129. return "InvalidArnException"
  10130. }
  10131. // Message returns the exception's message.
  10132. func (s InvalidArnException) Message() string {
  10133. if s.Message_ != nil {
  10134. return *s.Message_
  10135. }
  10136. return ""
  10137. }
  10138. // OrigErr always returns nil, satisfies awserr.Error interface.
  10139. func (s InvalidArnException) OrigErr() error {
  10140. return nil
  10141. }
  10142. func (s InvalidArnException) Error() string {
  10143. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10144. }
  10145. // Status code returns the HTTP status code for the request's response error.
  10146. func (s InvalidArnException) StatusCode() int {
  10147. return s.respMetadata.StatusCode
  10148. }
  10149. // RequestID returns the service's response RequestID for request.
  10150. func (s InvalidArnException) RequestID() string {
  10151. return s.respMetadata.RequestID
  10152. }
  10153. // From the Decrypt or ReEncrypt operation, the request was rejected because
  10154. // the specified ciphertext, or additional authenticated data incorporated into
  10155. // the ciphertext, such as the encryption context, is corrupted, missing, or
  10156. // otherwise invalid.
  10157. //
  10158. // From the ImportKeyMaterial operation, the request was rejected because AWS
  10159. // KMS could not decrypt the encrypted (wrapped) key material.
  10160. type InvalidCiphertextException struct {
  10161. _ struct{} `type:"structure"`
  10162. respMetadata protocol.ResponseMetadata
  10163. Message_ *string `locationName:"message" type:"string"`
  10164. }
  10165. // String returns the string representation
  10166. func (s InvalidCiphertextException) String() string {
  10167. return awsutil.Prettify(s)
  10168. }
  10169. // GoString returns the string representation
  10170. func (s InvalidCiphertextException) GoString() string {
  10171. return s.String()
  10172. }
  10173. func newErrorInvalidCiphertextException(v protocol.ResponseMetadata) error {
  10174. return &InvalidCiphertextException{
  10175. respMetadata: v,
  10176. }
  10177. }
  10178. // Code returns the exception type name.
  10179. func (s InvalidCiphertextException) Code() string {
  10180. return "InvalidCiphertextException"
  10181. }
  10182. // Message returns the exception's message.
  10183. func (s InvalidCiphertextException) Message() string {
  10184. if s.Message_ != nil {
  10185. return *s.Message_
  10186. }
  10187. return ""
  10188. }
  10189. // OrigErr always returns nil, satisfies awserr.Error interface.
  10190. func (s InvalidCiphertextException) OrigErr() error {
  10191. return nil
  10192. }
  10193. func (s InvalidCiphertextException) Error() string {
  10194. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10195. }
  10196. // Status code returns the HTTP status code for the request's response error.
  10197. func (s InvalidCiphertextException) StatusCode() int {
  10198. return s.respMetadata.StatusCode
  10199. }
  10200. // RequestID returns the service's response RequestID for request.
  10201. func (s InvalidCiphertextException) RequestID() string {
  10202. return s.respMetadata.RequestID
  10203. }
  10204. // The request was rejected because the specified GrantId is not valid.
  10205. type InvalidGrantIdException struct {
  10206. _ struct{} `type:"structure"`
  10207. respMetadata protocol.ResponseMetadata
  10208. Message_ *string `locationName:"message" type:"string"`
  10209. }
  10210. // String returns the string representation
  10211. func (s InvalidGrantIdException) String() string {
  10212. return awsutil.Prettify(s)
  10213. }
  10214. // GoString returns the string representation
  10215. func (s InvalidGrantIdException) GoString() string {
  10216. return s.String()
  10217. }
  10218. func newErrorInvalidGrantIdException(v protocol.ResponseMetadata) error {
  10219. return &InvalidGrantIdException{
  10220. respMetadata: v,
  10221. }
  10222. }
  10223. // Code returns the exception type name.
  10224. func (s InvalidGrantIdException) Code() string {
  10225. return "InvalidGrantIdException"
  10226. }
  10227. // Message returns the exception's message.
  10228. func (s InvalidGrantIdException) Message() string {
  10229. if s.Message_ != nil {
  10230. return *s.Message_
  10231. }
  10232. return ""
  10233. }
  10234. // OrigErr always returns nil, satisfies awserr.Error interface.
  10235. func (s InvalidGrantIdException) OrigErr() error {
  10236. return nil
  10237. }
  10238. func (s InvalidGrantIdException) Error() string {
  10239. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10240. }
  10241. // Status code returns the HTTP status code for the request's response error.
  10242. func (s InvalidGrantIdException) StatusCode() int {
  10243. return s.respMetadata.StatusCode
  10244. }
  10245. // RequestID returns the service's response RequestID for request.
  10246. func (s InvalidGrantIdException) RequestID() string {
  10247. return s.respMetadata.RequestID
  10248. }
  10249. // The request was rejected because the specified grant token is not valid.
  10250. type InvalidGrantTokenException struct {
  10251. _ struct{} `type:"structure"`
  10252. respMetadata protocol.ResponseMetadata
  10253. Message_ *string `locationName:"message" type:"string"`
  10254. }
  10255. // String returns the string representation
  10256. func (s InvalidGrantTokenException) String() string {
  10257. return awsutil.Prettify(s)
  10258. }
  10259. // GoString returns the string representation
  10260. func (s InvalidGrantTokenException) GoString() string {
  10261. return s.String()
  10262. }
  10263. func newErrorInvalidGrantTokenException(v protocol.ResponseMetadata) error {
  10264. return &InvalidGrantTokenException{
  10265. respMetadata: v,
  10266. }
  10267. }
  10268. // Code returns the exception type name.
  10269. func (s InvalidGrantTokenException) Code() string {
  10270. return "InvalidGrantTokenException"
  10271. }
  10272. // Message returns the exception's message.
  10273. func (s InvalidGrantTokenException) Message() string {
  10274. if s.Message_ != nil {
  10275. return *s.Message_
  10276. }
  10277. return ""
  10278. }
  10279. // OrigErr always returns nil, satisfies awserr.Error interface.
  10280. func (s InvalidGrantTokenException) OrigErr() error {
  10281. return nil
  10282. }
  10283. func (s InvalidGrantTokenException) Error() string {
  10284. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10285. }
  10286. // Status code returns the HTTP status code for the request's response error.
  10287. func (s InvalidGrantTokenException) StatusCode() int {
  10288. return s.respMetadata.StatusCode
  10289. }
  10290. // RequestID returns the service's response RequestID for request.
  10291. func (s InvalidGrantTokenException) RequestID() string {
  10292. return s.respMetadata.RequestID
  10293. }
  10294. // The request was rejected because the provided import token is invalid or
  10295. // is associated with a different customer master key (CMK).
  10296. type InvalidImportTokenException struct {
  10297. _ struct{} `type:"structure"`
  10298. respMetadata protocol.ResponseMetadata
  10299. Message_ *string `locationName:"message" type:"string"`
  10300. }
  10301. // String returns the string representation
  10302. func (s InvalidImportTokenException) String() string {
  10303. return awsutil.Prettify(s)
  10304. }
  10305. // GoString returns the string representation
  10306. func (s InvalidImportTokenException) GoString() string {
  10307. return s.String()
  10308. }
  10309. func newErrorInvalidImportTokenException(v protocol.ResponseMetadata) error {
  10310. return &InvalidImportTokenException{
  10311. respMetadata: v,
  10312. }
  10313. }
  10314. // Code returns the exception type name.
  10315. func (s InvalidImportTokenException) Code() string {
  10316. return "InvalidImportTokenException"
  10317. }
  10318. // Message returns the exception's message.
  10319. func (s InvalidImportTokenException) Message() string {
  10320. if s.Message_ != nil {
  10321. return *s.Message_
  10322. }
  10323. return ""
  10324. }
  10325. // OrigErr always returns nil, satisfies awserr.Error interface.
  10326. func (s InvalidImportTokenException) OrigErr() error {
  10327. return nil
  10328. }
  10329. func (s InvalidImportTokenException) Error() string {
  10330. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10331. }
  10332. // Status code returns the HTTP status code for the request's response error.
  10333. func (s InvalidImportTokenException) StatusCode() int {
  10334. return s.respMetadata.StatusCode
  10335. }
  10336. // RequestID returns the service's response RequestID for request.
  10337. func (s InvalidImportTokenException) RequestID() string {
  10338. return s.respMetadata.RequestID
  10339. }
  10340. // The request was rejected for one of the following reasons:
  10341. //
  10342. // * The KeyUsage value of the CMK is incompatible with the API operation.
  10343. //
  10344. // * The encryption algorithm or signing algorithm specified for the operation
  10345. // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec).
  10346. //
  10347. // For encrypting, decrypting, re-encrypting, and generating data keys, the
  10348. // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage
  10349. // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation.
  10350. //
  10351. // To find the encryption or signing algorithms supported for a particular CMK,
  10352. // use the DescribeKey operation.
  10353. type InvalidKeyUsageException struct {
  10354. _ struct{} `type:"structure"`
  10355. respMetadata protocol.ResponseMetadata
  10356. Message_ *string `locationName:"message" type:"string"`
  10357. }
  10358. // String returns the string representation
  10359. func (s InvalidKeyUsageException) String() string {
  10360. return awsutil.Prettify(s)
  10361. }
  10362. // GoString returns the string representation
  10363. func (s InvalidKeyUsageException) GoString() string {
  10364. return s.String()
  10365. }
  10366. func newErrorInvalidKeyUsageException(v protocol.ResponseMetadata) error {
  10367. return &InvalidKeyUsageException{
  10368. respMetadata: v,
  10369. }
  10370. }
  10371. // Code returns the exception type name.
  10372. func (s InvalidKeyUsageException) Code() string {
  10373. return "InvalidKeyUsageException"
  10374. }
  10375. // Message returns the exception's message.
  10376. func (s InvalidKeyUsageException) Message() string {
  10377. if s.Message_ != nil {
  10378. return *s.Message_
  10379. }
  10380. return ""
  10381. }
  10382. // OrigErr always returns nil, satisfies awserr.Error interface.
  10383. func (s InvalidKeyUsageException) OrigErr() error {
  10384. return nil
  10385. }
  10386. func (s InvalidKeyUsageException) Error() string {
  10387. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10388. }
  10389. // Status code returns the HTTP status code for the request's response error.
  10390. func (s InvalidKeyUsageException) StatusCode() int {
  10391. return s.respMetadata.StatusCode
  10392. }
  10393. // RequestID returns the service's response RequestID for request.
  10394. func (s InvalidKeyUsageException) RequestID() string {
  10395. return s.respMetadata.RequestID
  10396. }
  10397. // The request was rejected because the marker that specifies where pagination
  10398. // should next begin is not valid.
  10399. type InvalidMarkerException struct {
  10400. _ struct{} `type:"structure"`
  10401. respMetadata protocol.ResponseMetadata
  10402. Message_ *string `locationName:"message" type:"string"`
  10403. }
  10404. // String returns the string representation
  10405. func (s InvalidMarkerException) String() string {
  10406. return awsutil.Prettify(s)
  10407. }
  10408. // GoString returns the string representation
  10409. func (s InvalidMarkerException) GoString() string {
  10410. return s.String()
  10411. }
  10412. func newErrorInvalidMarkerException(v protocol.ResponseMetadata) error {
  10413. return &InvalidMarkerException{
  10414. respMetadata: v,
  10415. }
  10416. }
  10417. // Code returns the exception type name.
  10418. func (s InvalidMarkerException) Code() string {
  10419. return "InvalidMarkerException"
  10420. }
  10421. // Message returns the exception's message.
  10422. func (s InvalidMarkerException) Message() string {
  10423. if s.Message_ != nil {
  10424. return *s.Message_
  10425. }
  10426. return ""
  10427. }
  10428. // OrigErr always returns nil, satisfies awserr.Error interface.
  10429. func (s InvalidMarkerException) OrigErr() error {
  10430. return nil
  10431. }
  10432. func (s InvalidMarkerException) Error() string {
  10433. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10434. }
  10435. // Status code returns the HTTP status code for the request's response error.
  10436. func (s InvalidMarkerException) StatusCode() int {
  10437. return s.respMetadata.StatusCode
  10438. }
  10439. // RequestID returns the service's response RequestID for request.
  10440. func (s InvalidMarkerException) RequestID() string {
  10441. return s.respMetadata.RequestID
  10442. }
  10443. // The request was rejected because the state of the specified resource is not
  10444. // valid for this request.
  10445. //
  10446. // For more information about how key state affects the use of a CMK, see How
  10447. // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  10448. // in the AWS Key Management Service Developer Guide .
  10449. type InvalidStateException struct {
  10450. _ struct{} `type:"structure"`
  10451. respMetadata protocol.ResponseMetadata
  10452. Message_ *string `locationName:"message" type:"string"`
  10453. }
  10454. // String returns the string representation
  10455. func (s InvalidStateException) String() string {
  10456. return awsutil.Prettify(s)
  10457. }
  10458. // GoString returns the string representation
  10459. func (s InvalidStateException) GoString() string {
  10460. return s.String()
  10461. }
  10462. func newErrorInvalidStateException(v protocol.ResponseMetadata) error {
  10463. return &InvalidStateException{
  10464. respMetadata: v,
  10465. }
  10466. }
  10467. // Code returns the exception type name.
  10468. func (s InvalidStateException) Code() string {
  10469. return "KMSInvalidStateException"
  10470. }
  10471. // Message returns the exception's message.
  10472. func (s InvalidStateException) Message() string {
  10473. if s.Message_ != nil {
  10474. return *s.Message_
  10475. }
  10476. return ""
  10477. }
  10478. // OrigErr always returns nil, satisfies awserr.Error interface.
  10479. func (s InvalidStateException) OrigErr() error {
  10480. return nil
  10481. }
  10482. func (s InvalidStateException) Error() string {
  10483. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10484. }
  10485. // Status code returns the HTTP status code for the request's response error.
  10486. func (s InvalidStateException) StatusCode() int {
  10487. return s.respMetadata.StatusCode
  10488. }
  10489. // RequestID returns the service's response RequestID for request.
  10490. func (s InvalidStateException) RequestID() string {
  10491. return s.respMetadata.RequestID
  10492. }
  10493. // The request was rejected because the signature verification failed. Signature
  10494. // verification fails when it cannot confirm that signature was produced by
  10495. // signing the specified message with the specified CMK and signing algorithm.
  10496. type KMSInvalidSignatureException struct {
  10497. _ struct{} `type:"structure"`
  10498. respMetadata protocol.ResponseMetadata
  10499. Message_ *string `locationName:"message" type:"string"`
  10500. }
  10501. // String returns the string representation
  10502. func (s KMSInvalidSignatureException) String() string {
  10503. return awsutil.Prettify(s)
  10504. }
  10505. // GoString returns the string representation
  10506. func (s KMSInvalidSignatureException) GoString() string {
  10507. return s.String()
  10508. }
  10509. func newErrorKMSInvalidSignatureException(v protocol.ResponseMetadata) error {
  10510. return &KMSInvalidSignatureException{
  10511. respMetadata: v,
  10512. }
  10513. }
  10514. // Code returns the exception type name.
  10515. func (s KMSInvalidSignatureException) Code() string {
  10516. return "KMSInvalidSignatureException"
  10517. }
  10518. // Message returns the exception's message.
  10519. func (s KMSInvalidSignatureException) Message() string {
  10520. if s.Message_ != nil {
  10521. return *s.Message_
  10522. }
  10523. return ""
  10524. }
  10525. // OrigErr always returns nil, satisfies awserr.Error interface.
  10526. func (s KMSInvalidSignatureException) OrigErr() error {
  10527. return nil
  10528. }
  10529. func (s KMSInvalidSignatureException) Error() string {
  10530. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10531. }
  10532. // Status code returns the HTTP status code for the request's response error.
  10533. func (s KMSInvalidSignatureException) StatusCode() int {
  10534. return s.respMetadata.StatusCode
  10535. }
  10536. // RequestID returns the service's response RequestID for request.
  10537. func (s KMSInvalidSignatureException) RequestID() string {
  10538. return s.respMetadata.RequestID
  10539. }
  10540. // Contains information about each entry in the key list.
  10541. type KeyListEntry struct {
  10542. _ struct{} `type:"structure"`
  10543. // ARN of the key.
  10544. KeyArn *string `min:"20" type:"string"`
  10545. // Unique identifier of the key.
  10546. KeyId *string `min:"1" type:"string"`
  10547. }
  10548. // String returns the string representation
  10549. func (s KeyListEntry) String() string {
  10550. return awsutil.Prettify(s)
  10551. }
  10552. // GoString returns the string representation
  10553. func (s KeyListEntry) GoString() string {
  10554. return s.String()
  10555. }
  10556. // SetKeyArn sets the KeyArn field's value.
  10557. func (s *KeyListEntry) SetKeyArn(v string) *KeyListEntry {
  10558. s.KeyArn = &v
  10559. return s
  10560. }
  10561. // SetKeyId sets the KeyId field's value.
  10562. func (s *KeyListEntry) SetKeyId(v string) *KeyListEntry {
  10563. s.KeyId = &v
  10564. return s
  10565. }
  10566. // Contains metadata about a customer master key (CMK).
  10567. //
  10568. // This data type is used as a response element for the CreateKey and DescribeKey
  10569. // operations.
  10570. type KeyMetadata struct {
  10571. _ struct{} `type:"structure"`
  10572. // The twelve-digit account ID of the AWS account that owns the CMK.
  10573. AWSAccountId *string `type:"string"`
  10574. // The Amazon Resource Name (ARN) of the CMK. For examples, see AWS Key Management
  10575. // Service (AWS KMS) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms)
  10576. // in the Example ARNs section of the AWS General Reference.
  10577. Arn *string `min:"20" type:"string"`
  10578. // The cluster ID of the AWS CloudHSM cluster that contains the key material
  10579. // for the CMK. When you create a CMK in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html),
  10580. // AWS KMS creates the key material for the CMK in the associated AWS CloudHSM
  10581. // cluster. This value is present only when the CMK is created in a custom key
  10582. // store.
  10583. CloudHsmClusterId *string `min:"19" type:"string"`
  10584. // The date and time when the CMK was created.
  10585. CreationDate *time.Time `type:"timestamp"`
  10586. // A unique identifier for the custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html)
  10587. // that contains the CMK. This value is present only when the CMK is created
  10588. // in a custom key store.
  10589. CustomKeyStoreId *string `min:"1" type:"string"`
  10590. // Describes the type of key material in the CMK.
  10591. CustomerMasterKeySpec *string `type:"string" enum:"CustomerMasterKeySpec"`
  10592. // The date and time after which AWS KMS deletes the CMK. This value is present
  10593. // only when KeyState is PendingDeletion.
  10594. DeletionDate *time.Time `type:"timestamp"`
  10595. // The description of the CMK.
  10596. Description *string `type:"string"`
  10597. // Specifies whether the CMK is enabled. When KeyState is Enabled this value
  10598. // is true, otherwise it is false.
  10599. Enabled *bool `type:"boolean"`
  10600. // A list of encryption algorithms that the CMK supports. You cannot use the
  10601. // CMK with other encryption algorithms within AWS KMS.
  10602. //
  10603. // This field appears only when the KeyUsage of the CMK is ENCRYPT_DECRYPT.
  10604. EncryptionAlgorithms []*string `type:"list"`
  10605. // Specifies whether the CMK's key material expires. This value is present only
  10606. // when Origin is EXTERNAL, otherwise this value is omitted.
  10607. ExpirationModel *string `type:"string" enum:"ExpirationModelType"`
  10608. // The globally unique identifier for the CMK.
  10609. //
  10610. // KeyId is a required field
  10611. KeyId *string `min:"1" type:"string" required:"true"`
  10612. // The manager of the CMK. CMKs in your AWS account are either customer managed
  10613. // or AWS managed. For more information about the difference, see Customer Master
  10614. // Keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys)
  10615. // in the AWS Key Management Service Developer Guide.
  10616. KeyManager *string `type:"string" enum:"KeyManagerType"`
  10617. // The state of the CMK.
  10618. //
  10619. // For more information about how key state affects the use of a CMK, see How
  10620. // Key State Affects the Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
  10621. // in the AWS Key Management Service Developer Guide.
  10622. KeyState *string `type:"string" enum:"KeyState"`
  10623. // The cryptographic operations for which you can use the CMK.
  10624. KeyUsage *string `type:"string" enum:"KeyUsageType"`
  10625. // The source of the CMK's key material. When this value is AWS_KMS, AWS KMS
  10626. // created the key material. When this value is EXTERNAL, the key material was
  10627. // imported from your existing key management infrastructure or the CMK lacks
  10628. // key material. When this value is AWS_CLOUDHSM, the key material was created
  10629. // in the AWS CloudHSM cluster associated with a custom key store.
  10630. Origin *string `type:"string" enum:"OriginType"`
  10631. // A list of signing algorithms that the CMK supports. You cannot use the CMK
  10632. // with other signing algorithms within AWS KMS.
  10633. //
  10634. // This field appears only when the KeyUsage of the CMK is SIGN_VERIFY.
  10635. SigningAlgorithms []*string `type:"list"`
  10636. // The time at which the imported key material expires. When the key material
  10637. // expires, AWS KMS deletes the key material and the CMK becomes unusable. This
  10638. // value is present only for CMKs whose Origin is EXTERNAL and whose ExpirationModel
  10639. // is KEY_MATERIAL_EXPIRES, otherwise this value is omitted.
  10640. ValidTo *time.Time `type:"timestamp"`
  10641. }
  10642. // String returns the string representation
  10643. func (s KeyMetadata) String() string {
  10644. return awsutil.Prettify(s)
  10645. }
  10646. // GoString returns the string representation
  10647. func (s KeyMetadata) GoString() string {
  10648. return s.String()
  10649. }
  10650. // SetAWSAccountId sets the AWSAccountId field's value.
  10651. func (s *KeyMetadata) SetAWSAccountId(v string) *KeyMetadata {
  10652. s.AWSAccountId = &v
  10653. return s
  10654. }
  10655. // SetArn sets the Arn field's value.
  10656. func (s *KeyMetadata) SetArn(v string) *KeyMetadata {
  10657. s.Arn = &v
  10658. return s
  10659. }
  10660. // SetCloudHsmClusterId sets the CloudHsmClusterId field's value.
  10661. func (s *KeyMetadata) SetCloudHsmClusterId(v string) *KeyMetadata {
  10662. s.CloudHsmClusterId = &v
  10663. return s
  10664. }
  10665. // SetCreationDate sets the CreationDate field's value.
  10666. func (s *KeyMetadata) SetCreationDate(v time.Time) *KeyMetadata {
  10667. s.CreationDate = &v
  10668. return s
  10669. }
  10670. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  10671. func (s *KeyMetadata) SetCustomKeyStoreId(v string) *KeyMetadata {
  10672. s.CustomKeyStoreId = &v
  10673. return s
  10674. }
  10675. // SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value.
  10676. func (s *KeyMetadata) SetCustomerMasterKeySpec(v string) *KeyMetadata {
  10677. s.CustomerMasterKeySpec = &v
  10678. return s
  10679. }
  10680. // SetDeletionDate sets the DeletionDate field's value.
  10681. func (s *KeyMetadata) SetDeletionDate(v time.Time) *KeyMetadata {
  10682. s.DeletionDate = &v
  10683. return s
  10684. }
  10685. // SetDescription sets the Description field's value.
  10686. func (s *KeyMetadata) SetDescription(v string) *KeyMetadata {
  10687. s.Description = &v
  10688. return s
  10689. }
  10690. // SetEnabled sets the Enabled field's value.
  10691. func (s *KeyMetadata) SetEnabled(v bool) *KeyMetadata {
  10692. s.Enabled = &v
  10693. return s
  10694. }
  10695. // SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value.
  10696. func (s *KeyMetadata) SetEncryptionAlgorithms(v []*string) *KeyMetadata {
  10697. s.EncryptionAlgorithms = v
  10698. return s
  10699. }
  10700. // SetExpirationModel sets the ExpirationModel field's value.
  10701. func (s *KeyMetadata) SetExpirationModel(v string) *KeyMetadata {
  10702. s.ExpirationModel = &v
  10703. return s
  10704. }
  10705. // SetKeyId sets the KeyId field's value.
  10706. func (s *KeyMetadata) SetKeyId(v string) *KeyMetadata {
  10707. s.KeyId = &v
  10708. return s
  10709. }
  10710. // SetKeyManager sets the KeyManager field's value.
  10711. func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata {
  10712. s.KeyManager = &v
  10713. return s
  10714. }
  10715. // SetKeyState sets the KeyState field's value.
  10716. func (s *KeyMetadata) SetKeyState(v string) *KeyMetadata {
  10717. s.KeyState = &v
  10718. return s
  10719. }
  10720. // SetKeyUsage sets the KeyUsage field's value.
  10721. func (s *KeyMetadata) SetKeyUsage(v string) *KeyMetadata {
  10722. s.KeyUsage = &v
  10723. return s
  10724. }
  10725. // SetOrigin sets the Origin field's value.
  10726. func (s *KeyMetadata) SetOrigin(v string) *KeyMetadata {
  10727. s.Origin = &v
  10728. return s
  10729. }
  10730. // SetSigningAlgorithms sets the SigningAlgorithms field's value.
  10731. func (s *KeyMetadata) SetSigningAlgorithms(v []*string) *KeyMetadata {
  10732. s.SigningAlgorithms = v
  10733. return s
  10734. }
  10735. // SetValidTo sets the ValidTo field's value.
  10736. func (s *KeyMetadata) SetValidTo(v time.Time) *KeyMetadata {
  10737. s.ValidTo = &v
  10738. return s
  10739. }
  10740. // The request was rejected because the specified CMK was not available. You
  10741. // can retry the request.
  10742. type KeyUnavailableException struct {
  10743. _ struct{} `type:"structure"`
  10744. respMetadata protocol.ResponseMetadata
  10745. Message_ *string `locationName:"message" type:"string"`
  10746. }
  10747. // String returns the string representation
  10748. func (s KeyUnavailableException) String() string {
  10749. return awsutil.Prettify(s)
  10750. }
  10751. // GoString returns the string representation
  10752. func (s KeyUnavailableException) GoString() string {
  10753. return s.String()
  10754. }
  10755. func newErrorKeyUnavailableException(v protocol.ResponseMetadata) error {
  10756. return &KeyUnavailableException{
  10757. respMetadata: v,
  10758. }
  10759. }
  10760. // Code returns the exception type name.
  10761. func (s KeyUnavailableException) Code() string {
  10762. return "KeyUnavailableException"
  10763. }
  10764. // Message returns the exception's message.
  10765. func (s KeyUnavailableException) Message() string {
  10766. if s.Message_ != nil {
  10767. return *s.Message_
  10768. }
  10769. return ""
  10770. }
  10771. // OrigErr always returns nil, satisfies awserr.Error interface.
  10772. func (s KeyUnavailableException) OrigErr() error {
  10773. return nil
  10774. }
  10775. func (s KeyUnavailableException) Error() string {
  10776. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10777. }
  10778. // Status code returns the HTTP status code for the request's response error.
  10779. func (s KeyUnavailableException) StatusCode() int {
  10780. return s.respMetadata.StatusCode
  10781. }
  10782. // RequestID returns the service's response RequestID for request.
  10783. func (s KeyUnavailableException) RequestID() string {
  10784. return s.respMetadata.RequestID
  10785. }
  10786. // The request was rejected because a limit was exceeded. For more information,
  10787. // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
  10788. // in the AWS Key Management Service Developer Guide.
  10789. type LimitExceededException struct {
  10790. _ struct{} `type:"structure"`
  10791. respMetadata protocol.ResponseMetadata
  10792. Message_ *string `locationName:"message" type:"string"`
  10793. }
  10794. // String returns the string representation
  10795. func (s LimitExceededException) String() string {
  10796. return awsutil.Prettify(s)
  10797. }
  10798. // GoString returns the string representation
  10799. func (s LimitExceededException) GoString() string {
  10800. return s.String()
  10801. }
  10802. func newErrorLimitExceededException(v protocol.ResponseMetadata) error {
  10803. return &LimitExceededException{
  10804. respMetadata: v,
  10805. }
  10806. }
  10807. // Code returns the exception type name.
  10808. func (s LimitExceededException) Code() string {
  10809. return "LimitExceededException"
  10810. }
  10811. // Message returns the exception's message.
  10812. func (s LimitExceededException) Message() string {
  10813. if s.Message_ != nil {
  10814. return *s.Message_
  10815. }
  10816. return ""
  10817. }
  10818. // OrigErr always returns nil, satisfies awserr.Error interface.
  10819. func (s LimitExceededException) OrigErr() error {
  10820. return nil
  10821. }
  10822. func (s LimitExceededException) Error() string {
  10823. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  10824. }
  10825. // Status code returns the HTTP status code for the request's response error.
  10826. func (s LimitExceededException) StatusCode() int {
  10827. return s.respMetadata.StatusCode
  10828. }
  10829. // RequestID returns the service's response RequestID for request.
  10830. func (s LimitExceededException) RequestID() string {
  10831. return s.respMetadata.RequestID
  10832. }
  10833. type ListAliasesInput struct {
  10834. _ struct{} `type:"structure"`
  10835. // Lists only aliases that refer to the specified CMK. The value of this parameter
  10836. // can be the ID or Amazon Resource Name (ARN) of a CMK in the caller's account
  10837. // and region. You cannot use an alias name or alias ARN in this value.
  10838. //
  10839. // This parameter is optional. If you omit it, ListAliases returns all aliases
  10840. // in the account and region.
  10841. KeyId *string `min:"1" type:"string"`
  10842. // Use this parameter to specify the maximum number of items to return. When
  10843. // this value is present, AWS KMS does not return more than the specified number
  10844. // of items, but it might return fewer.
  10845. //
  10846. // This value is optional. If you include a value, it must be between 1 and
  10847. // 100, inclusive. If you do not include a value, it defaults to 50.
  10848. Limit *int64 `min:"1" type:"integer"`
  10849. // Use this parameter in a subsequent request after you receive a response with
  10850. // truncated results. Set it to the value of NextMarker from the truncated response
  10851. // you just received.
  10852. Marker *string `min:"1" type:"string"`
  10853. }
  10854. // String returns the string representation
  10855. func (s ListAliasesInput) String() string {
  10856. return awsutil.Prettify(s)
  10857. }
  10858. // GoString returns the string representation
  10859. func (s ListAliasesInput) GoString() string {
  10860. return s.String()
  10861. }
  10862. // Validate inspects the fields of the type to determine if they are valid.
  10863. func (s *ListAliasesInput) Validate() error {
  10864. invalidParams := request.ErrInvalidParams{Context: "ListAliasesInput"}
  10865. if s.KeyId != nil && len(*s.KeyId) < 1 {
  10866. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  10867. }
  10868. if s.Limit != nil && *s.Limit < 1 {
  10869. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  10870. }
  10871. if s.Marker != nil && len(*s.Marker) < 1 {
  10872. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  10873. }
  10874. if invalidParams.Len() > 0 {
  10875. return invalidParams
  10876. }
  10877. return nil
  10878. }
  10879. // SetKeyId sets the KeyId field's value.
  10880. func (s *ListAliasesInput) SetKeyId(v string) *ListAliasesInput {
  10881. s.KeyId = &v
  10882. return s
  10883. }
  10884. // SetLimit sets the Limit field's value.
  10885. func (s *ListAliasesInput) SetLimit(v int64) *ListAliasesInput {
  10886. s.Limit = &v
  10887. return s
  10888. }
  10889. // SetMarker sets the Marker field's value.
  10890. func (s *ListAliasesInput) SetMarker(v string) *ListAliasesInput {
  10891. s.Marker = &v
  10892. return s
  10893. }
  10894. type ListAliasesOutput struct {
  10895. _ struct{} `type:"structure"`
  10896. // A list of aliases.
  10897. Aliases []*AliasListEntry `type:"list"`
  10898. // When Truncated is true, this element is present and contains the value to
  10899. // use for the Marker parameter in a subsequent request.
  10900. NextMarker *string `min:"1" type:"string"`
  10901. // A flag that indicates whether there are more items in the list. When this
  10902. // value is true, the list in this response is truncated. To get more items,
  10903. // pass the value of the NextMarker element in thisresponse to the Marker parameter
  10904. // in a subsequent request.
  10905. Truncated *bool `type:"boolean"`
  10906. }
  10907. // String returns the string representation
  10908. func (s ListAliasesOutput) String() string {
  10909. return awsutil.Prettify(s)
  10910. }
  10911. // GoString returns the string representation
  10912. func (s ListAliasesOutput) GoString() string {
  10913. return s.String()
  10914. }
  10915. // SetAliases sets the Aliases field's value.
  10916. func (s *ListAliasesOutput) SetAliases(v []*AliasListEntry) *ListAliasesOutput {
  10917. s.Aliases = v
  10918. return s
  10919. }
  10920. // SetNextMarker sets the NextMarker field's value.
  10921. func (s *ListAliasesOutput) SetNextMarker(v string) *ListAliasesOutput {
  10922. s.NextMarker = &v
  10923. return s
  10924. }
  10925. // SetTruncated sets the Truncated field's value.
  10926. func (s *ListAliasesOutput) SetTruncated(v bool) *ListAliasesOutput {
  10927. s.Truncated = &v
  10928. return s
  10929. }
  10930. type ListGrantsInput struct {
  10931. _ struct{} `type:"structure"`
  10932. // A unique identifier for the customer master key (CMK).
  10933. //
  10934. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify
  10935. // a CMK in a different AWS account, you must use the key ARN.
  10936. //
  10937. // For example:
  10938. //
  10939. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  10940. //
  10941. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  10942. //
  10943. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  10944. //
  10945. // KeyId is a required field
  10946. KeyId *string `min:"1" type:"string" required:"true"`
  10947. // Use this parameter to specify the maximum number of items to return. When
  10948. // this value is present, AWS KMS does not return more than the specified number
  10949. // of items, but it might return fewer.
  10950. //
  10951. // This value is optional. If you include a value, it must be between 1 and
  10952. // 100, inclusive. If you do not include a value, it defaults to 50.
  10953. Limit *int64 `min:"1" type:"integer"`
  10954. // Use this parameter in a subsequent request after you receive a response with
  10955. // truncated results. Set it to the value of NextMarker from the truncated response
  10956. // you just received.
  10957. Marker *string `min:"1" type:"string"`
  10958. }
  10959. // String returns the string representation
  10960. func (s ListGrantsInput) String() string {
  10961. return awsutil.Prettify(s)
  10962. }
  10963. // GoString returns the string representation
  10964. func (s ListGrantsInput) GoString() string {
  10965. return s.String()
  10966. }
  10967. // Validate inspects the fields of the type to determine if they are valid.
  10968. func (s *ListGrantsInput) Validate() error {
  10969. invalidParams := request.ErrInvalidParams{Context: "ListGrantsInput"}
  10970. if s.KeyId == nil {
  10971. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  10972. }
  10973. if s.KeyId != nil && len(*s.KeyId) < 1 {
  10974. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  10975. }
  10976. if s.Limit != nil && *s.Limit < 1 {
  10977. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  10978. }
  10979. if s.Marker != nil && len(*s.Marker) < 1 {
  10980. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  10981. }
  10982. if invalidParams.Len() > 0 {
  10983. return invalidParams
  10984. }
  10985. return nil
  10986. }
  10987. // SetKeyId sets the KeyId field's value.
  10988. func (s *ListGrantsInput) SetKeyId(v string) *ListGrantsInput {
  10989. s.KeyId = &v
  10990. return s
  10991. }
  10992. // SetLimit sets the Limit field's value.
  10993. func (s *ListGrantsInput) SetLimit(v int64) *ListGrantsInput {
  10994. s.Limit = &v
  10995. return s
  10996. }
  10997. // SetMarker sets the Marker field's value.
  10998. func (s *ListGrantsInput) SetMarker(v string) *ListGrantsInput {
  10999. s.Marker = &v
  11000. return s
  11001. }
  11002. type ListGrantsResponse struct {
  11003. _ struct{} `type:"structure"`
  11004. // A list of grants.
  11005. Grants []*GrantListEntry `type:"list"`
  11006. // When Truncated is true, this element is present and contains the value to
  11007. // use for the Marker parameter in a subsequent request.
  11008. NextMarker *string `min:"1" type:"string"`
  11009. // A flag that indicates whether there are more items in the list. When this
  11010. // value is true, the list in this response is truncated. To get more items,
  11011. // pass the value of the NextMarker element in thisresponse to the Marker parameter
  11012. // in a subsequent request.
  11013. Truncated *bool `type:"boolean"`
  11014. }
  11015. // String returns the string representation
  11016. func (s ListGrantsResponse) String() string {
  11017. return awsutil.Prettify(s)
  11018. }
  11019. // GoString returns the string representation
  11020. func (s ListGrantsResponse) GoString() string {
  11021. return s.String()
  11022. }
  11023. // SetGrants sets the Grants field's value.
  11024. func (s *ListGrantsResponse) SetGrants(v []*GrantListEntry) *ListGrantsResponse {
  11025. s.Grants = v
  11026. return s
  11027. }
  11028. // SetNextMarker sets the NextMarker field's value.
  11029. func (s *ListGrantsResponse) SetNextMarker(v string) *ListGrantsResponse {
  11030. s.NextMarker = &v
  11031. return s
  11032. }
  11033. // SetTruncated sets the Truncated field's value.
  11034. func (s *ListGrantsResponse) SetTruncated(v bool) *ListGrantsResponse {
  11035. s.Truncated = &v
  11036. return s
  11037. }
  11038. type ListKeyPoliciesInput struct {
  11039. _ struct{} `type:"structure"`
  11040. // A unique identifier for the customer master key (CMK).
  11041. //
  11042. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  11043. //
  11044. // For example:
  11045. //
  11046. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11047. //
  11048. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11049. //
  11050. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  11051. //
  11052. // KeyId is a required field
  11053. KeyId *string `min:"1" type:"string" required:"true"`
  11054. // Use this parameter to specify the maximum number of items to return. When
  11055. // this value is present, AWS KMS does not return more than the specified number
  11056. // of items, but it might return fewer.
  11057. //
  11058. // This value is optional. If you include a value, it must be between 1 and
  11059. // 1000, inclusive. If you do not include a value, it defaults to 100.
  11060. //
  11061. // Only one policy can be attached to a key.
  11062. Limit *int64 `min:"1" type:"integer"`
  11063. // Use this parameter in a subsequent request after you receive a response with
  11064. // truncated results. Set it to the value of NextMarker from the truncated response
  11065. // you just received.
  11066. Marker *string `min:"1" type:"string"`
  11067. }
  11068. // String returns the string representation
  11069. func (s ListKeyPoliciesInput) String() string {
  11070. return awsutil.Prettify(s)
  11071. }
  11072. // GoString returns the string representation
  11073. func (s ListKeyPoliciesInput) GoString() string {
  11074. return s.String()
  11075. }
  11076. // Validate inspects the fields of the type to determine if they are valid.
  11077. func (s *ListKeyPoliciesInput) Validate() error {
  11078. invalidParams := request.ErrInvalidParams{Context: "ListKeyPoliciesInput"}
  11079. if s.KeyId == nil {
  11080. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  11081. }
  11082. if s.KeyId != nil && len(*s.KeyId) < 1 {
  11083. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  11084. }
  11085. if s.Limit != nil && *s.Limit < 1 {
  11086. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  11087. }
  11088. if s.Marker != nil && len(*s.Marker) < 1 {
  11089. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  11090. }
  11091. if invalidParams.Len() > 0 {
  11092. return invalidParams
  11093. }
  11094. return nil
  11095. }
  11096. // SetKeyId sets the KeyId field's value.
  11097. func (s *ListKeyPoliciesInput) SetKeyId(v string) *ListKeyPoliciesInput {
  11098. s.KeyId = &v
  11099. return s
  11100. }
  11101. // SetLimit sets the Limit field's value.
  11102. func (s *ListKeyPoliciesInput) SetLimit(v int64) *ListKeyPoliciesInput {
  11103. s.Limit = &v
  11104. return s
  11105. }
  11106. // SetMarker sets the Marker field's value.
  11107. func (s *ListKeyPoliciesInput) SetMarker(v string) *ListKeyPoliciesInput {
  11108. s.Marker = &v
  11109. return s
  11110. }
  11111. type ListKeyPoliciesOutput struct {
  11112. _ struct{} `type:"structure"`
  11113. // When Truncated is true, this element is present and contains the value to
  11114. // use for the Marker parameter in a subsequent request.
  11115. NextMarker *string `min:"1" type:"string"`
  11116. // A list of key policy names. The only valid value is default.
  11117. PolicyNames []*string `type:"list"`
  11118. // A flag that indicates whether there are more items in the list. When this
  11119. // value is true, the list in this response is truncated. To get more items,
  11120. // pass the value of the NextMarker element in thisresponse to the Marker parameter
  11121. // in a subsequent request.
  11122. Truncated *bool `type:"boolean"`
  11123. }
  11124. // String returns the string representation
  11125. func (s ListKeyPoliciesOutput) String() string {
  11126. return awsutil.Prettify(s)
  11127. }
  11128. // GoString returns the string representation
  11129. func (s ListKeyPoliciesOutput) GoString() string {
  11130. return s.String()
  11131. }
  11132. // SetNextMarker sets the NextMarker field's value.
  11133. func (s *ListKeyPoliciesOutput) SetNextMarker(v string) *ListKeyPoliciesOutput {
  11134. s.NextMarker = &v
  11135. return s
  11136. }
  11137. // SetPolicyNames sets the PolicyNames field's value.
  11138. func (s *ListKeyPoliciesOutput) SetPolicyNames(v []*string) *ListKeyPoliciesOutput {
  11139. s.PolicyNames = v
  11140. return s
  11141. }
  11142. // SetTruncated sets the Truncated field's value.
  11143. func (s *ListKeyPoliciesOutput) SetTruncated(v bool) *ListKeyPoliciesOutput {
  11144. s.Truncated = &v
  11145. return s
  11146. }
  11147. type ListKeysInput struct {
  11148. _ struct{} `type:"structure"`
  11149. // Use this parameter to specify the maximum number of items to return. When
  11150. // this value is present, AWS KMS does not return more than the specified number
  11151. // of items, but it might return fewer.
  11152. //
  11153. // This value is optional. If you include a value, it must be between 1 and
  11154. // 1000, inclusive. If you do not include a value, it defaults to 100.
  11155. Limit *int64 `min:"1" type:"integer"`
  11156. // Use this parameter in a subsequent request after you receive a response with
  11157. // truncated results. Set it to the value of NextMarker from the truncated response
  11158. // you just received.
  11159. Marker *string `min:"1" type:"string"`
  11160. }
  11161. // String returns the string representation
  11162. func (s ListKeysInput) String() string {
  11163. return awsutil.Prettify(s)
  11164. }
  11165. // GoString returns the string representation
  11166. func (s ListKeysInput) GoString() string {
  11167. return s.String()
  11168. }
  11169. // Validate inspects the fields of the type to determine if they are valid.
  11170. func (s *ListKeysInput) Validate() error {
  11171. invalidParams := request.ErrInvalidParams{Context: "ListKeysInput"}
  11172. if s.Limit != nil && *s.Limit < 1 {
  11173. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  11174. }
  11175. if s.Marker != nil && len(*s.Marker) < 1 {
  11176. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  11177. }
  11178. if invalidParams.Len() > 0 {
  11179. return invalidParams
  11180. }
  11181. return nil
  11182. }
  11183. // SetLimit sets the Limit field's value.
  11184. func (s *ListKeysInput) SetLimit(v int64) *ListKeysInput {
  11185. s.Limit = &v
  11186. return s
  11187. }
  11188. // SetMarker sets the Marker field's value.
  11189. func (s *ListKeysInput) SetMarker(v string) *ListKeysInput {
  11190. s.Marker = &v
  11191. return s
  11192. }
  11193. type ListKeysOutput struct {
  11194. _ struct{} `type:"structure"`
  11195. // A list of customer master keys (CMKs).
  11196. Keys []*KeyListEntry `type:"list"`
  11197. // When Truncated is true, this element is present and contains the value to
  11198. // use for the Marker parameter in a subsequent request.
  11199. NextMarker *string `min:"1" type:"string"`
  11200. // A flag that indicates whether there are more items in the list. When this
  11201. // value is true, the list in this response is truncated. To get more items,
  11202. // pass the value of the NextMarker element in thisresponse to the Marker parameter
  11203. // in a subsequent request.
  11204. Truncated *bool `type:"boolean"`
  11205. }
  11206. // String returns the string representation
  11207. func (s ListKeysOutput) String() string {
  11208. return awsutil.Prettify(s)
  11209. }
  11210. // GoString returns the string representation
  11211. func (s ListKeysOutput) GoString() string {
  11212. return s.String()
  11213. }
  11214. // SetKeys sets the Keys field's value.
  11215. func (s *ListKeysOutput) SetKeys(v []*KeyListEntry) *ListKeysOutput {
  11216. s.Keys = v
  11217. return s
  11218. }
  11219. // SetNextMarker sets the NextMarker field's value.
  11220. func (s *ListKeysOutput) SetNextMarker(v string) *ListKeysOutput {
  11221. s.NextMarker = &v
  11222. return s
  11223. }
  11224. // SetTruncated sets the Truncated field's value.
  11225. func (s *ListKeysOutput) SetTruncated(v bool) *ListKeysOutput {
  11226. s.Truncated = &v
  11227. return s
  11228. }
  11229. type ListResourceTagsInput struct {
  11230. _ struct{} `type:"structure"`
  11231. // A unique identifier for the customer master key (CMK).
  11232. //
  11233. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  11234. //
  11235. // For example:
  11236. //
  11237. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11238. //
  11239. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11240. //
  11241. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  11242. //
  11243. // KeyId is a required field
  11244. KeyId *string `min:"1" type:"string" required:"true"`
  11245. // Use this parameter to specify the maximum number of items to return. When
  11246. // this value is present, AWS KMS does not return more than the specified number
  11247. // of items, but it might return fewer.
  11248. //
  11249. // This value is optional. If you include a value, it must be between 1 and
  11250. // 50, inclusive. If you do not include a value, it defaults to 50.
  11251. Limit *int64 `min:"1" type:"integer"`
  11252. // Use this parameter in a subsequent request after you receive a response with
  11253. // truncated results. Set it to the value of NextMarker from the truncated response
  11254. // you just received.
  11255. //
  11256. // Do not attempt to construct this value. Use only the value of NextMarker
  11257. // from the truncated response you just received.
  11258. Marker *string `min:"1" type:"string"`
  11259. }
  11260. // String returns the string representation
  11261. func (s ListResourceTagsInput) String() string {
  11262. return awsutil.Prettify(s)
  11263. }
  11264. // GoString returns the string representation
  11265. func (s ListResourceTagsInput) GoString() string {
  11266. return s.String()
  11267. }
  11268. // Validate inspects the fields of the type to determine if they are valid.
  11269. func (s *ListResourceTagsInput) Validate() error {
  11270. invalidParams := request.ErrInvalidParams{Context: "ListResourceTagsInput"}
  11271. if s.KeyId == nil {
  11272. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  11273. }
  11274. if s.KeyId != nil && len(*s.KeyId) < 1 {
  11275. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  11276. }
  11277. if s.Limit != nil && *s.Limit < 1 {
  11278. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  11279. }
  11280. if s.Marker != nil && len(*s.Marker) < 1 {
  11281. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  11282. }
  11283. if invalidParams.Len() > 0 {
  11284. return invalidParams
  11285. }
  11286. return nil
  11287. }
  11288. // SetKeyId sets the KeyId field's value.
  11289. func (s *ListResourceTagsInput) SetKeyId(v string) *ListResourceTagsInput {
  11290. s.KeyId = &v
  11291. return s
  11292. }
  11293. // SetLimit sets the Limit field's value.
  11294. func (s *ListResourceTagsInput) SetLimit(v int64) *ListResourceTagsInput {
  11295. s.Limit = &v
  11296. return s
  11297. }
  11298. // SetMarker sets the Marker field's value.
  11299. func (s *ListResourceTagsInput) SetMarker(v string) *ListResourceTagsInput {
  11300. s.Marker = &v
  11301. return s
  11302. }
  11303. type ListResourceTagsOutput struct {
  11304. _ struct{} `type:"structure"`
  11305. // When Truncated is true, this element is present and contains the value to
  11306. // use for the Marker parameter in a subsequent request.
  11307. //
  11308. // Do not assume or infer any information from this value.
  11309. NextMarker *string `min:"1" type:"string"`
  11310. // A list of tags. Each tag consists of a tag key and a tag value.
  11311. Tags []*Tag `type:"list"`
  11312. // A flag that indicates whether there are more items in the list. When this
  11313. // value is true, the list in this response is truncated. To get more items,
  11314. // pass the value of the NextMarker element in thisresponse to the Marker parameter
  11315. // in a subsequent request.
  11316. Truncated *bool `type:"boolean"`
  11317. }
  11318. // String returns the string representation
  11319. func (s ListResourceTagsOutput) String() string {
  11320. return awsutil.Prettify(s)
  11321. }
  11322. // GoString returns the string representation
  11323. func (s ListResourceTagsOutput) GoString() string {
  11324. return s.String()
  11325. }
  11326. // SetNextMarker sets the NextMarker field's value.
  11327. func (s *ListResourceTagsOutput) SetNextMarker(v string) *ListResourceTagsOutput {
  11328. s.NextMarker = &v
  11329. return s
  11330. }
  11331. // SetTags sets the Tags field's value.
  11332. func (s *ListResourceTagsOutput) SetTags(v []*Tag) *ListResourceTagsOutput {
  11333. s.Tags = v
  11334. return s
  11335. }
  11336. // SetTruncated sets the Truncated field's value.
  11337. func (s *ListResourceTagsOutput) SetTruncated(v bool) *ListResourceTagsOutput {
  11338. s.Truncated = &v
  11339. return s
  11340. }
  11341. type ListRetirableGrantsInput struct {
  11342. _ struct{} `type:"structure"`
  11343. // Use this parameter to specify the maximum number of items to return. When
  11344. // this value is present, AWS KMS does not return more than the specified number
  11345. // of items, but it might return fewer.
  11346. //
  11347. // This value is optional. If you include a value, it must be between 1 and
  11348. // 100, inclusive. If you do not include a value, it defaults to 50.
  11349. Limit *int64 `min:"1" type:"integer"`
  11350. // Use this parameter in a subsequent request after you receive a response with
  11351. // truncated results. Set it to the value of NextMarker from the truncated response
  11352. // you just received.
  11353. Marker *string `min:"1" type:"string"`
  11354. // The retiring principal for which to list grants.
  11355. //
  11356. // To specify the retiring principal, use the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
  11357. // of an AWS principal. Valid AWS principals include AWS accounts (root), IAM
  11358. // users, federated users, and assumed role users. For examples of the ARN syntax
  11359. // for specifying a principal, see AWS Identity and Access Management (IAM)
  11360. // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-iam)
  11361. // in the Example ARNs section of the Amazon Web Services General Reference.
  11362. //
  11363. // RetiringPrincipal is a required field
  11364. RetiringPrincipal *string `min:"1" type:"string" required:"true"`
  11365. }
  11366. // String returns the string representation
  11367. func (s ListRetirableGrantsInput) String() string {
  11368. return awsutil.Prettify(s)
  11369. }
  11370. // GoString returns the string representation
  11371. func (s ListRetirableGrantsInput) GoString() string {
  11372. return s.String()
  11373. }
  11374. // Validate inspects the fields of the type to determine if they are valid.
  11375. func (s *ListRetirableGrantsInput) Validate() error {
  11376. invalidParams := request.ErrInvalidParams{Context: "ListRetirableGrantsInput"}
  11377. if s.Limit != nil && *s.Limit < 1 {
  11378. invalidParams.Add(request.NewErrParamMinValue("Limit", 1))
  11379. }
  11380. if s.Marker != nil && len(*s.Marker) < 1 {
  11381. invalidParams.Add(request.NewErrParamMinLen("Marker", 1))
  11382. }
  11383. if s.RetiringPrincipal == nil {
  11384. invalidParams.Add(request.NewErrParamRequired("RetiringPrincipal"))
  11385. }
  11386. if s.RetiringPrincipal != nil && len(*s.RetiringPrincipal) < 1 {
  11387. invalidParams.Add(request.NewErrParamMinLen("RetiringPrincipal", 1))
  11388. }
  11389. if invalidParams.Len() > 0 {
  11390. return invalidParams
  11391. }
  11392. return nil
  11393. }
  11394. // SetLimit sets the Limit field's value.
  11395. func (s *ListRetirableGrantsInput) SetLimit(v int64) *ListRetirableGrantsInput {
  11396. s.Limit = &v
  11397. return s
  11398. }
  11399. // SetMarker sets the Marker field's value.
  11400. func (s *ListRetirableGrantsInput) SetMarker(v string) *ListRetirableGrantsInput {
  11401. s.Marker = &v
  11402. return s
  11403. }
  11404. // SetRetiringPrincipal sets the RetiringPrincipal field's value.
  11405. func (s *ListRetirableGrantsInput) SetRetiringPrincipal(v string) *ListRetirableGrantsInput {
  11406. s.RetiringPrincipal = &v
  11407. return s
  11408. }
  11409. // The request was rejected because the specified policy is not syntactically
  11410. // or semantically correct.
  11411. type MalformedPolicyDocumentException struct {
  11412. _ struct{} `type:"structure"`
  11413. respMetadata protocol.ResponseMetadata
  11414. Message_ *string `locationName:"message" type:"string"`
  11415. }
  11416. // String returns the string representation
  11417. func (s MalformedPolicyDocumentException) String() string {
  11418. return awsutil.Prettify(s)
  11419. }
  11420. // GoString returns the string representation
  11421. func (s MalformedPolicyDocumentException) GoString() string {
  11422. return s.String()
  11423. }
  11424. func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error {
  11425. return &MalformedPolicyDocumentException{
  11426. respMetadata: v,
  11427. }
  11428. }
  11429. // Code returns the exception type name.
  11430. func (s MalformedPolicyDocumentException) Code() string {
  11431. return "MalformedPolicyDocumentException"
  11432. }
  11433. // Message returns the exception's message.
  11434. func (s MalformedPolicyDocumentException) Message() string {
  11435. if s.Message_ != nil {
  11436. return *s.Message_
  11437. }
  11438. return ""
  11439. }
  11440. // OrigErr always returns nil, satisfies awserr.Error interface.
  11441. func (s MalformedPolicyDocumentException) OrigErr() error {
  11442. return nil
  11443. }
  11444. func (s MalformedPolicyDocumentException) Error() string {
  11445. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  11446. }
  11447. // Status code returns the HTTP status code for the request's response error.
  11448. func (s MalformedPolicyDocumentException) StatusCode() int {
  11449. return s.respMetadata.StatusCode
  11450. }
  11451. // RequestID returns the service's response RequestID for request.
  11452. func (s MalformedPolicyDocumentException) RequestID() string {
  11453. return s.respMetadata.RequestID
  11454. }
  11455. // The request was rejected because the specified entity or resource could not
  11456. // be found.
  11457. type NotFoundException struct {
  11458. _ struct{} `type:"structure"`
  11459. respMetadata protocol.ResponseMetadata
  11460. Message_ *string `locationName:"message" type:"string"`
  11461. }
  11462. // String returns the string representation
  11463. func (s NotFoundException) String() string {
  11464. return awsutil.Prettify(s)
  11465. }
  11466. // GoString returns the string representation
  11467. func (s NotFoundException) GoString() string {
  11468. return s.String()
  11469. }
  11470. func newErrorNotFoundException(v protocol.ResponseMetadata) error {
  11471. return &NotFoundException{
  11472. respMetadata: v,
  11473. }
  11474. }
  11475. // Code returns the exception type name.
  11476. func (s NotFoundException) Code() string {
  11477. return "NotFoundException"
  11478. }
  11479. // Message returns the exception's message.
  11480. func (s NotFoundException) Message() string {
  11481. if s.Message_ != nil {
  11482. return *s.Message_
  11483. }
  11484. return ""
  11485. }
  11486. // OrigErr always returns nil, satisfies awserr.Error interface.
  11487. func (s NotFoundException) OrigErr() error {
  11488. return nil
  11489. }
  11490. func (s NotFoundException) Error() string {
  11491. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  11492. }
  11493. // Status code returns the HTTP status code for the request's response error.
  11494. func (s NotFoundException) StatusCode() int {
  11495. return s.respMetadata.StatusCode
  11496. }
  11497. // RequestID returns the service's response RequestID for request.
  11498. func (s NotFoundException) RequestID() string {
  11499. return s.respMetadata.RequestID
  11500. }
  11501. type PutKeyPolicyInput struct {
  11502. _ struct{} `type:"structure"`
  11503. // A flag to indicate whether to bypass the key policy lockout safety check.
  11504. //
  11505. // Setting this value to true increases the risk that the CMK becomes unmanageable.
  11506. // Do not set this value to true indiscriminately.
  11507. //
  11508. // For more information, refer to the scenario in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  11509. // section in the AWS Key Management Service Developer Guide.
  11510. //
  11511. // Use this parameter only when you intend to prevent the principal that is
  11512. // making the request from making a subsequent PutKeyPolicy request on the CMK.
  11513. //
  11514. // The default value is false.
  11515. BypassPolicyLockoutSafetyCheck *bool `type:"boolean"`
  11516. // A unique identifier for the customer master key (CMK).
  11517. //
  11518. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  11519. //
  11520. // For example:
  11521. //
  11522. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11523. //
  11524. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11525. //
  11526. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  11527. //
  11528. // KeyId is a required field
  11529. KeyId *string `min:"1" type:"string" required:"true"`
  11530. // The key policy to attach to the CMK.
  11531. //
  11532. // The key policy must meet the following criteria:
  11533. //
  11534. // * If you don't set BypassPolicyLockoutSafetyCheck to true, the key policy
  11535. // must allow the principal that is making the PutKeyPolicy request to make
  11536. // a subsequent PutKeyPolicy request on the CMK. This reduces the risk that
  11537. // the CMK becomes unmanageable. For more information, refer to the scenario
  11538. // in the Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam)
  11539. // section of the AWS Key Management Service Developer Guide.
  11540. //
  11541. // * Each statement in the key policy must contain one or more principals.
  11542. // The principals in the key policy must exist and be visible to AWS KMS.
  11543. // When you create a new AWS principal (for example, an IAM user or role),
  11544. // you might need to enforce a delay before including the new principal in
  11545. // a key policy because the new principal might not be immediately visible
  11546. // to AWS KMS. For more information, see Changes that I make are not always
  11547. // immediately visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency)
  11548. // in the AWS Identity and Access Management User Guide.
  11549. //
  11550. // The key policy size limit is 32 kilobytes (32768 bytes).
  11551. //
  11552. // Policy is a required field
  11553. Policy *string `min:"1" type:"string" required:"true"`
  11554. // The name of the key policy. The only valid value is default.
  11555. //
  11556. // PolicyName is a required field
  11557. PolicyName *string `min:"1" type:"string" required:"true"`
  11558. }
  11559. // String returns the string representation
  11560. func (s PutKeyPolicyInput) String() string {
  11561. return awsutil.Prettify(s)
  11562. }
  11563. // GoString returns the string representation
  11564. func (s PutKeyPolicyInput) GoString() string {
  11565. return s.String()
  11566. }
  11567. // Validate inspects the fields of the type to determine if they are valid.
  11568. func (s *PutKeyPolicyInput) Validate() error {
  11569. invalidParams := request.ErrInvalidParams{Context: "PutKeyPolicyInput"}
  11570. if s.KeyId == nil {
  11571. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  11572. }
  11573. if s.KeyId != nil && len(*s.KeyId) < 1 {
  11574. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  11575. }
  11576. if s.Policy == nil {
  11577. invalidParams.Add(request.NewErrParamRequired("Policy"))
  11578. }
  11579. if s.Policy != nil && len(*s.Policy) < 1 {
  11580. invalidParams.Add(request.NewErrParamMinLen("Policy", 1))
  11581. }
  11582. if s.PolicyName == nil {
  11583. invalidParams.Add(request.NewErrParamRequired("PolicyName"))
  11584. }
  11585. if s.PolicyName != nil && len(*s.PolicyName) < 1 {
  11586. invalidParams.Add(request.NewErrParamMinLen("PolicyName", 1))
  11587. }
  11588. if invalidParams.Len() > 0 {
  11589. return invalidParams
  11590. }
  11591. return nil
  11592. }
  11593. // SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value.
  11594. func (s *PutKeyPolicyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *PutKeyPolicyInput {
  11595. s.BypassPolicyLockoutSafetyCheck = &v
  11596. return s
  11597. }
  11598. // SetKeyId sets the KeyId field's value.
  11599. func (s *PutKeyPolicyInput) SetKeyId(v string) *PutKeyPolicyInput {
  11600. s.KeyId = &v
  11601. return s
  11602. }
  11603. // SetPolicy sets the Policy field's value.
  11604. func (s *PutKeyPolicyInput) SetPolicy(v string) *PutKeyPolicyInput {
  11605. s.Policy = &v
  11606. return s
  11607. }
  11608. // SetPolicyName sets the PolicyName field's value.
  11609. func (s *PutKeyPolicyInput) SetPolicyName(v string) *PutKeyPolicyInput {
  11610. s.PolicyName = &v
  11611. return s
  11612. }
  11613. type PutKeyPolicyOutput struct {
  11614. _ struct{} `type:"structure"`
  11615. }
  11616. // String returns the string representation
  11617. func (s PutKeyPolicyOutput) String() string {
  11618. return awsutil.Prettify(s)
  11619. }
  11620. // GoString returns the string representation
  11621. func (s PutKeyPolicyOutput) GoString() string {
  11622. return s.String()
  11623. }
  11624. type ReEncryptInput struct {
  11625. _ struct{} `type:"structure"`
  11626. // Ciphertext of the data to reencrypt.
  11627. //
  11628. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  11629. //
  11630. // CiphertextBlob is a required field
  11631. CiphertextBlob []byte `min:"1" type:"blob" required:"true"`
  11632. // Specifies the encryption algorithm that AWS KMS will use to reecrypt the
  11633. // data after it has decrypted it. The default value, SYMMETRIC_DEFAULT, represents
  11634. // the encryption algorithm used for symmetric CMKs.
  11635. //
  11636. // This parameter is required only when the destination CMK is an asymmetric
  11637. // CMK.
  11638. DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  11639. // Specifies that encryption context to use when the reencrypting the data.
  11640. //
  11641. // A destination encryption context is valid only when the destination CMK is
  11642. // a symmetric CMK. The standard ciphertext format for asymmetric CMKs does
  11643. // not include fields for metadata.
  11644. //
  11645. // An encryption context is a collection of non-secret key-value pairs that
  11646. // represents additional authenticated data. When you use an encryption context
  11647. // to encrypt data, you must specify the same (an exact case-sensitive match)
  11648. // encryption context to decrypt the data. An encryption context is optional
  11649. // when encrypting with a symmetric CMK, but it is highly recommended.
  11650. //
  11651. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  11652. // in the AWS Key Management Service Developer Guide.
  11653. DestinationEncryptionContext map[string]*string `type:"map"`
  11654. // A unique identifier for the CMK that is used to reencrypt the data. Specify
  11655. // a symmetric or asymmetric CMK with a KeyUsage value of ENCRYPT_DECRYPT. To
  11656. // find the KeyUsage value of a CMK, use the DescribeKey operation.
  11657. //
  11658. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  11659. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  11660. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  11661. //
  11662. // For example:
  11663. //
  11664. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11665. //
  11666. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11667. //
  11668. // * Alias name: alias/ExampleAlias
  11669. //
  11670. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  11671. //
  11672. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  11673. // get the alias name and alias ARN, use ListAliases.
  11674. //
  11675. // DestinationKeyId is a required field
  11676. DestinationKeyId *string `min:"1" type:"string" required:"true"`
  11677. // A list of grant tokens.
  11678. //
  11679. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  11680. // in the AWS Key Management Service Developer Guide.
  11681. GrantTokens []*string `type:"list"`
  11682. // Specifies the encryption algorithm that AWS KMS will use to decrypt the ciphertext
  11683. // before it is reencrypted. The default value, SYMMETRIC_DEFAULT, represents
  11684. // the algorithm used for symmetric CMKs.
  11685. //
  11686. // Specify the same algorithm that was used to encrypt the ciphertext. If you
  11687. // specify a different algorithm, the decrypt attempt fails.
  11688. //
  11689. // This parameter is required only when the ciphertext was encrypted under an
  11690. // asymmetric CMK.
  11691. SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  11692. // Specifies the encryption context to use to decrypt the ciphertext. Enter
  11693. // the same encryption context that was used to encrypt the ciphertext.
  11694. //
  11695. // An encryption context is a collection of non-secret key-value pairs that
  11696. // represents additional authenticated data. When you use an encryption context
  11697. // to encrypt data, you must specify the same (an exact case-sensitive match)
  11698. // encryption context to decrypt the data. An encryption context is optional
  11699. // when encrypting with a symmetric CMK, but it is highly recommended.
  11700. //
  11701. // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context)
  11702. // in the AWS Key Management Service Developer Guide.
  11703. SourceEncryptionContext map[string]*string `type:"map"`
  11704. // A unique identifier for the CMK that is used to decrypt the ciphertext before
  11705. // it reencrypts it using the destination CMK.
  11706. //
  11707. // This parameter is required only when the ciphertext was encrypted under an
  11708. // asymmetric CMK. Otherwise, AWS KMS uses the metadata that it adds to the
  11709. // ciphertext blob to determine which CMK was used to encrypt the ciphertext.
  11710. // However, you can use this parameter to ensure that a particular CMK (of any
  11711. // kind) is used to decrypt the ciphertext before it is reencrypted.
  11712. //
  11713. // If you specify a KeyId value, the decrypt part of the ReEncrypt operation
  11714. // succeeds only if the specified CMK was used to encrypt the ciphertext.
  11715. //
  11716. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  11717. // or alias ARN. When using an alias name, prefix it with "alias/".
  11718. //
  11719. // For example:
  11720. //
  11721. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11722. //
  11723. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11724. //
  11725. // * Alias name: alias/ExampleAlias
  11726. //
  11727. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  11728. //
  11729. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  11730. // get the alias name and alias ARN, use ListAliases.
  11731. SourceKeyId *string `min:"1" type:"string"`
  11732. }
  11733. // String returns the string representation
  11734. func (s ReEncryptInput) String() string {
  11735. return awsutil.Prettify(s)
  11736. }
  11737. // GoString returns the string representation
  11738. func (s ReEncryptInput) GoString() string {
  11739. return s.String()
  11740. }
  11741. // Validate inspects the fields of the type to determine if they are valid.
  11742. func (s *ReEncryptInput) Validate() error {
  11743. invalidParams := request.ErrInvalidParams{Context: "ReEncryptInput"}
  11744. if s.CiphertextBlob == nil {
  11745. invalidParams.Add(request.NewErrParamRequired("CiphertextBlob"))
  11746. }
  11747. if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 {
  11748. invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1))
  11749. }
  11750. if s.DestinationKeyId == nil {
  11751. invalidParams.Add(request.NewErrParamRequired("DestinationKeyId"))
  11752. }
  11753. if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 {
  11754. invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1))
  11755. }
  11756. if s.SourceKeyId != nil && len(*s.SourceKeyId) < 1 {
  11757. invalidParams.Add(request.NewErrParamMinLen("SourceKeyId", 1))
  11758. }
  11759. if invalidParams.Len() > 0 {
  11760. return invalidParams
  11761. }
  11762. return nil
  11763. }
  11764. // SetCiphertextBlob sets the CiphertextBlob field's value.
  11765. func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput {
  11766. s.CiphertextBlob = v
  11767. return s
  11768. }
  11769. // SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value.
  11770. func (s *ReEncryptInput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptInput {
  11771. s.DestinationEncryptionAlgorithm = &v
  11772. return s
  11773. }
  11774. // SetDestinationEncryptionContext sets the DestinationEncryptionContext field's value.
  11775. func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput {
  11776. s.DestinationEncryptionContext = v
  11777. return s
  11778. }
  11779. // SetDestinationKeyId sets the DestinationKeyId field's value.
  11780. func (s *ReEncryptInput) SetDestinationKeyId(v string) *ReEncryptInput {
  11781. s.DestinationKeyId = &v
  11782. return s
  11783. }
  11784. // SetGrantTokens sets the GrantTokens field's value.
  11785. func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput {
  11786. s.GrantTokens = v
  11787. return s
  11788. }
  11789. // SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value.
  11790. func (s *ReEncryptInput) SetSourceEncryptionAlgorithm(v string) *ReEncryptInput {
  11791. s.SourceEncryptionAlgorithm = &v
  11792. return s
  11793. }
  11794. // SetSourceEncryptionContext sets the SourceEncryptionContext field's value.
  11795. func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput {
  11796. s.SourceEncryptionContext = v
  11797. return s
  11798. }
  11799. // SetSourceKeyId sets the SourceKeyId field's value.
  11800. func (s *ReEncryptInput) SetSourceKeyId(v string) *ReEncryptInput {
  11801. s.SourceKeyId = &v
  11802. return s
  11803. }
  11804. type ReEncryptOutput struct {
  11805. _ struct{} `type:"structure"`
  11806. // The reencrypted data. When you use the HTTP API or the AWS CLI, the value
  11807. // is Base64-encoded. Otherwise, it is not Base64-encoded.
  11808. //
  11809. // CiphertextBlob is automatically base64 encoded/decoded by the SDK.
  11810. CiphertextBlob []byte `min:"1" type:"blob"`
  11811. // The encryption algorithm that was used to reencrypt the data.
  11812. DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  11813. // Unique identifier of the CMK used to reencrypt the data.
  11814. KeyId *string `min:"1" type:"string"`
  11815. // The encryption algorithm that was used to decrypt the ciphertext before it
  11816. // was reencrypted.
  11817. SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"`
  11818. // Unique identifier of the CMK used to originally encrypt the data.
  11819. SourceKeyId *string `min:"1" type:"string"`
  11820. }
  11821. // String returns the string representation
  11822. func (s ReEncryptOutput) String() string {
  11823. return awsutil.Prettify(s)
  11824. }
  11825. // GoString returns the string representation
  11826. func (s ReEncryptOutput) GoString() string {
  11827. return s.String()
  11828. }
  11829. // SetCiphertextBlob sets the CiphertextBlob field's value.
  11830. func (s *ReEncryptOutput) SetCiphertextBlob(v []byte) *ReEncryptOutput {
  11831. s.CiphertextBlob = v
  11832. return s
  11833. }
  11834. // SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value.
  11835. func (s *ReEncryptOutput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptOutput {
  11836. s.DestinationEncryptionAlgorithm = &v
  11837. return s
  11838. }
  11839. // SetKeyId sets the KeyId field's value.
  11840. func (s *ReEncryptOutput) SetKeyId(v string) *ReEncryptOutput {
  11841. s.KeyId = &v
  11842. return s
  11843. }
  11844. // SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value.
  11845. func (s *ReEncryptOutput) SetSourceEncryptionAlgorithm(v string) *ReEncryptOutput {
  11846. s.SourceEncryptionAlgorithm = &v
  11847. return s
  11848. }
  11849. // SetSourceKeyId sets the SourceKeyId field's value.
  11850. func (s *ReEncryptOutput) SetSourceKeyId(v string) *ReEncryptOutput {
  11851. s.SourceKeyId = &v
  11852. return s
  11853. }
  11854. type RetireGrantInput struct {
  11855. _ struct{} `type:"structure"`
  11856. // Unique identifier of the grant to retire. The grant ID is returned in the
  11857. // response to a CreateGrant operation.
  11858. //
  11859. // * Grant ID Example - 0123456789012345678901234567890123456789012345678901234567890123
  11860. GrantId *string `min:"1" type:"string"`
  11861. // Token that identifies the grant to be retired.
  11862. GrantToken *string `min:"1" type:"string"`
  11863. // The Amazon Resource Name (ARN) of the CMK associated with the grant.
  11864. //
  11865. // For example: arn:aws:kms:us-east-2:444455556666:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11866. KeyId *string `min:"1" type:"string"`
  11867. }
  11868. // String returns the string representation
  11869. func (s RetireGrantInput) String() string {
  11870. return awsutil.Prettify(s)
  11871. }
  11872. // GoString returns the string representation
  11873. func (s RetireGrantInput) GoString() string {
  11874. return s.String()
  11875. }
  11876. // Validate inspects the fields of the type to determine if they are valid.
  11877. func (s *RetireGrantInput) Validate() error {
  11878. invalidParams := request.ErrInvalidParams{Context: "RetireGrantInput"}
  11879. if s.GrantId != nil && len(*s.GrantId) < 1 {
  11880. invalidParams.Add(request.NewErrParamMinLen("GrantId", 1))
  11881. }
  11882. if s.GrantToken != nil && len(*s.GrantToken) < 1 {
  11883. invalidParams.Add(request.NewErrParamMinLen("GrantToken", 1))
  11884. }
  11885. if s.KeyId != nil && len(*s.KeyId) < 1 {
  11886. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  11887. }
  11888. if invalidParams.Len() > 0 {
  11889. return invalidParams
  11890. }
  11891. return nil
  11892. }
  11893. // SetGrantId sets the GrantId field's value.
  11894. func (s *RetireGrantInput) SetGrantId(v string) *RetireGrantInput {
  11895. s.GrantId = &v
  11896. return s
  11897. }
  11898. // SetGrantToken sets the GrantToken field's value.
  11899. func (s *RetireGrantInput) SetGrantToken(v string) *RetireGrantInput {
  11900. s.GrantToken = &v
  11901. return s
  11902. }
  11903. // SetKeyId sets the KeyId field's value.
  11904. func (s *RetireGrantInput) SetKeyId(v string) *RetireGrantInput {
  11905. s.KeyId = &v
  11906. return s
  11907. }
  11908. type RetireGrantOutput struct {
  11909. _ struct{} `type:"structure"`
  11910. }
  11911. // String returns the string representation
  11912. func (s RetireGrantOutput) String() string {
  11913. return awsutil.Prettify(s)
  11914. }
  11915. // GoString returns the string representation
  11916. func (s RetireGrantOutput) GoString() string {
  11917. return s.String()
  11918. }
  11919. type RevokeGrantInput struct {
  11920. _ struct{} `type:"structure"`
  11921. // Identifier of the grant to be revoked.
  11922. //
  11923. // GrantId is a required field
  11924. GrantId *string `min:"1" type:"string" required:"true"`
  11925. // A unique identifier for the customer master key associated with the grant.
  11926. //
  11927. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify
  11928. // a CMK in a different AWS account, you must use the key ARN.
  11929. //
  11930. // For example:
  11931. //
  11932. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11933. //
  11934. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  11935. //
  11936. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  11937. //
  11938. // KeyId is a required field
  11939. KeyId *string `min:"1" type:"string" required:"true"`
  11940. }
  11941. // String returns the string representation
  11942. func (s RevokeGrantInput) String() string {
  11943. return awsutil.Prettify(s)
  11944. }
  11945. // GoString returns the string representation
  11946. func (s RevokeGrantInput) GoString() string {
  11947. return s.String()
  11948. }
  11949. // Validate inspects the fields of the type to determine if they are valid.
  11950. func (s *RevokeGrantInput) Validate() error {
  11951. invalidParams := request.ErrInvalidParams{Context: "RevokeGrantInput"}
  11952. if s.GrantId == nil {
  11953. invalidParams.Add(request.NewErrParamRequired("GrantId"))
  11954. }
  11955. if s.GrantId != nil && len(*s.GrantId) < 1 {
  11956. invalidParams.Add(request.NewErrParamMinLen("GrantId", 1))
  11957. }
  11958. if s.KeyId == nil {
  11959. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  11960. }
  11961. if s.KeyId != nil && len(*s.KeyId) < 1 {
  11962. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  11963. }
  11964. if invalidParams.Len() > 0 {
  11965. return invalidParams
  11966. }
  11967. return nil
  11968. }
  11969. // SetGrantId sets the GrantId field's value.
  11970. func (s *RevokeGrantInput) SetGrantId(v string) *RevokeGrantInput {
  11971. s.GrantId = &v
  11972. return s
  11973. }
  11974. // SetKeyId sets the KeyId field's value.
  11975. func (s *RevokeGrantInput) SetKeyId(v string) *RevokeGrantInput {
  11976. s.KeyId = &v
  11977. return s
  11978. }
  11979. type RevokeGrantOutput struct {
  11980. _ struct{} `type:"structure"`
  11981. }
  11982. // String returns the string representation
  11983. func (s RevokeGrantOutput) String() string {
  11984. return awsutil.Prettify(s)
  11985. }
  11986. // GoString returns the string representation
  11987. func (s RevokeGrantOutput) GoString() string {
  11988. return s.String()
  11989. }
  11990. type ScheduleKeyDeletionInput struct {
  11991. _ struct{} `type:"structure"`
  11992. // The unique identifier of the customer master key (CMK) to delete.
  11993. //
  11994. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  11995. //
  11996. // For example:
  11997. //
  11998. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  11999. //
  12000. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12001. //
  12002. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  12003. //
  12004. // KeyId is a required field
  12005. KeyId *string `min:"1" type:"string" required:"true"`
  12006. // The waiting period, specified in number of days. After the waiting period
  12007. // ends, AWS KMS deletes the customer master key (CMK).
  12008. //
  12009. // This value is optional. If you include a value, it must be between 7 and
  12010. // 30, inclusive. If you do not include a value, it defaults to 30.
  12011. PendingWindowInDays *int64 `min:"1" type:"integer"`
  12012. }
  12013. // String returns the string representation
  12014. func (s ScheduleKeyDeletionInput) String() string {
  12015. return awsutil.Prettify(s)
  12016. }
  12017. // GoString returns the string representation
  12018. func (s ScheduleKeyDeletionInput) GoString() string {
  12019. return s.String()
  12020. }
  12021. // Validate inspects the fields of the type to determine if they are valid.
  12022. func (s *ScheduleKeyDeletionInput) Validate() error {
  12023. invalidParams := request.ErrInvalidParams{Context: "ScheduleKeyDeletionInput"}
  12024. if s.KeyId == nil {
  12025. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  12026. }
  12027. if s.KeyId != nil && len(*s.KeyId) < 1 {
  12028. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  12029. }
  12030. if s.PendingWindowInDays != nil && *s.PendingWindowInDays < 1 {
  12031. invalidParams.Add(request.NewErrParamMinValue("PendingWindowInDays", 1))
  12032. }
  12033. if invalidParams.Len() > 0 {
  12034. return invalidParams
  12035. }
  12036. return nil
  12037. }
  12038. // SetKeyId sets the KeyId field's value.
  12039. func (s *ScheduleKeyDeletionInput) SetKeyId(v string) *ScheduleKeyDeletionInput {
  12040. s.KeyId = &v
  12041. return s
  12042. }
  12043. // SetPendingWindowInDays sets the PendingWindowInDays field's value.
  12044. func (s *ScheduleKeyDeletionInput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionInput {
  12045. s.PendingWindowInDays = &v
  12046. return s
  12047. }
  12048. type ScheduleKeyDeletionOutput struct {
  12049. _ struct{} `type:"structure"`
  12050. // The date and time after which AWS KMS deletes the customer master key (CMK).
  12051. DeletionDate *time.Time `type:"timestamp"`
  12052. // The unique identifier of the customer master key (CMK) for which deletion
  12053. // is scheduled.
  12054. KeyId *string `min:"1" type:"string"`
  12055. }
  12056. // String returns the string representation
  12057. func (s ScheduleKeyDeletionOutput) String() string {
  12058. return awsutil.Prettify(s)
  12059. }
  12060. // GoString returns the string representation
  12061. func (s ScheduleKeyDeletionOutput) GoString() string {
  12062. return s.String()
  12063. }
  12064. // SetDeletionDate sets the DeletionDate field's value.
  12065. func (s *ScheduleKeyDeletionOutput) SetDeletionDate(v time.Time) *ScheduleKeyDeletionOutput {
  12066. s.DeletionDate = &v
  12067. return s
  12068. }
  12069. // SetKeyId sets the KeyId field's value.
  12070. func (s *ScheduleKeyDeletionOutput) SetKeyId(v string) *ScheduleKeyDeletionOutput {
  12071. s.KeyId = &v
  12072. return s
  12073. }
  12074. type SignInput struct {
  12075. _ struct{} `type:"structure"`
  12076. // A list of grant tokens.
  12077. //
  12078. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  12079. // in the AWS Key Management Service Developer Guide.
  12080. GrantTokens []*string `type:"list"`
  12081. // Identifies an asymmetric CMK. AWS KMS uses the private key in the asymmetric
  12082. // CMK to sign the message. The KeyUsage type of the CMK must be SIGN_VERIFY.
  12083. // To find the KeyUsage of a CMK, use the DescribeKey operation.
  12084. //
  12085. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  12086. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  12087. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  12088. //
  12089. // For example:
  12090. //
  12091. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  12092. //
  12093. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12094. //
  12095. // * Alias name: alias/ExampleAlias
  12096. //
  12097. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  12098. //
  12099. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  12100. // get the alias name and alias ARN, use ListAliases.
  12101. //
  12102. // KeyId is a required field
  12103. KeyId *string `min:"1" type:"string" required:"true"`
  12104. // Specifies the message or message digest to sign. Messages can be 0-4096 bytes.
  12105. // To sign a larger message, provide the message digest.
  12106. //
  12107. // If you provide a message, AWS KMS generates a hash digest of the message
  12108. // and then signs it.
  12109. //
  12110. // Message is automatically base64 encoded/decoded by the SDK.
  12111. //
  12112. // Message is a required field
  12113. Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"`
  12114. // Tells AWS KMS whether the value of the Message parameter is a message or
  12115. // message digest. To indicate a message, enter RAW. To indicate a message digest,
  12116. // enter DIGEST.
  12117. MessageType *string `type:"string" enum:"MessageType"`
  12118. // Specifies the signing algorithm to use when signing the message.
  12119. //
  12120. // Choose an algorithm that is compatible with the type and size of the specified
  12121. // asymmetric CMK.
  12122. //
  12123. // SigningAlgorithm is a required field
  12124. SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"`
  12125. }
  12126. // String returns the string representation
  12127. func (s SignInput) String() string {
  12128. return awsutil.Prettify(s)
  12129. }
  12130. // GoString returns the string representation
  12131. func (s SignInput) GoString() string {
  12132. return s.String()
  12133. }
  12134. // Validate inspects the fields of the type to determine if they are valid.
  12135. func (s *SignInput) Validate() error {
  12136. invalidParams := request.ErrInvalidParams{Context: "SignInput"}
  12137. if s.KeyId == nil {
  12138. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  12139. }
  12140. if s.KeyId != nil && len(*s.KeyId) < 1 {
  12141. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  12142. }
  12143. if s.Message == nil {
  12144. invalidParams.Add(request.NewErrParamRequired("Message"))
  12145. }
  12146. if s.Message != nil && len(s.Message) < 1 {
  12147. invalidParams.Add(request.NewErrParamMinLen("Message", 1))
  12148. }
  12149. if s.SigningAlgorithm == nil {
  12150. invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm"))
  12151. }
  12152. if invalidParams.Len() > 0 {
  12153. return invalidParams
  12154. }
  12155. return nil
  12156. }
  12157. // SetGrantTokens sets the GrantTokens field's value.
  12158. func (s *SignInput) SetGrantTokens(v []*string) *SignInput {
  12159. s.GrantTokens = v
  12160. return s
  12161. }
  12162. // SetKeyId sets the KeyId field's value.
  12163. func (s *SignInput) SetKeyId(v string) *SignInput {
  12164. s.KeyId = &v
  12165. return s
  12166. }
  12167. // SetMessage sets the Message field's value.
  12168. func (s *SignInput) SetMessage(v []byte) *SignInput {
  12169. s.Message = v
  12170. return s
  12171. }
  12172. // SetMessageType sets the MessageType field's value.
  12173. func (s *SignInput) SetMessageType(v string) *SignInput {
  12174. s.MessageType = &v
  12175. return s
  12176. }
  12177. // SetSigningAlgorithm sets the SigningAlgorithm field's value.
  12178. func (s *SignInput) SetSigningAlgorithm(v string) *SignInput {
  12179. s.SigningAlgorithm = &v
  12180. return s
  12181. }
  12182. type SignOutput struct {
  12183. _ struct{} `type:"structure"`
  12184. // The Amazon Resource Name (ARN) of the asymmetric CMK that was used to sign
  12185. // the message.
  12186. KeyId *string `min:"1" type:"string"`
  12187. // The cryptographic signature that was generated for the message.
  12188. //
  12189. // Signature is automatically base64 encoded/decoded by the SDK.
  12190. Signature []byte `min:"1" type:"blob"`
  12191. // The signing algorithm that was used to sign the message.
  12192. SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"`
  12193. }
  12194. // String returns the string representation
  12195. func (s SignOutput) String() string {
  12196. return awsutil.Prettify(s)
  12197. }
  12198. // GoString returns the string representation
  12199. func (s SignOutput) GoString() string {
  12200. return s.String()
  12201. }
  12202. // SetKeyId sets the KeyId field's value.
  12203. func (s *SignOutput) SetKeyId(v string) *SignOutput {
  12204. s.KeyId = &v
  12205. return s
  12206. }
  12207. // SetSignature sets the Signature field's value.
  12208. func (s *SignOutput) SetSignature(v []byte) *SignOutput {
  12209. s.Signature = v
  12210. return s
  12211. }
  12212. // SetSigningAlgorithm sets the SigningAlgorithm field's value.
  12213. func (s *SignOutput) SetSigningAlgorithm(v string) *SignOutput {
  12214. s.SigningAlgorithm = &v
  12215. return s
  12216. }
  12217. // A key-value pair. A tag consists of a tag key and a tag value. Tag keys and
  12218. // tag values are both required, but tag values can be empty (null) strings.
  12219. //
  12220. // For information about the rules that apply to tag keys and tag values, see
  12221. // User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html)
  12222. // in the AWS Billing and Cost Management User Guide.
  12223. type Tag struct {
  12224. _ struct{} `type:"structure"`
  12225. // The key of the tag.
  12226. //
  12227. // TagKey is a required field
  12228. TagKey *string `min:"1" type:"string" required:"true"`
  12229. // The value of the tag.
  12230. //
  12231. // TagValue is a required field
  12232. TagValue *string `type:"string" required:"true"`
  12233. }
  12234. // String returns the string representation
  12235. func (s Tag) String() string {
  12236. return awsutil.Prettify(s)
  12237. }
  12238. // GoString returns the string representation
  12239. func (s Tag) GoString() string {
  12240. return s.String()
  12241. }
  12242. // Validate inspects the fields of the type to determine if they are valid.
  12243. func (s *Tag) Validate() error {
  12244. invalidParams := request.ErrInvalidParams{Context: "Tag"}
  12245. if s.TagKey == nil {
  12246. invalidParams.Add(request.NewErrParamRequired("TagKey"))
  12247. }
  12248. if s.TagKey != nil && len(*s.TagKey) < 1 {
  12249. invalidParams.Add(request.NewErrParamMinLen("TagKey", 1))
  12250. }
  12251. if s.TagValue == nil {
  12252. invalidParams.Add(request.NewErrParamRequired("TagValue"))
  12253. }
  12254. if invalidParams.Len() > 0 {
  12255. return invalidParams
  12256. }
  12257. return nil
  12258. }
  12259. // SetTagKey sets the TagKey field's value.
  12260. func (s *Tag) SetTagKey(v string) *Tag {
  12261. s.TagKey = &v
  12262. return s
  12263. }
  12264. // SetTagValue sets the TagValue field's value.
  12265. func (s *Tag) SetTagValue(v string) *Tag {
  12266. s.TagValue = &v
  12267. return s
  12268. }
  12269. // The request was rejected because one or more tags are not valid.
  12270. type TagException struct {
  12271. _ struct{} `type:"structure"`
  12272. respMetadata protocol.ResponseMetadata
  12273. Message_ *string `locationName:"message" type:"string"`
  12274. }
  12275. // String returns the string representation
  12276. func (s TagException) String() string {
  12277. return awsutil.Prettify(s)
  12278. }
  12279. // GoString returns the string representation
  12280. func (s TagException) GoString() string {
  12281. return s.String()
  12282. }
  12283. func newErrorTagException(v protocol.ResponseMetadata) error {
  12284. return &TagException{
  12285. respMetadata: v,
  12286. }
  12287. }
  12288. // Code returns the exception type name.
  12289. func (s TagException) Code() string {
  12290. return "TagException"
  12291. }
  12292. // Message returns the exception's message.
  12293. func (s TagException) Message() string {
  12294. if s.Message_ != nil {
  12295. return *s.Message_
  12296. }
  12297. return ""
  12298. }
  12299. // OrigErr always returns nil, satisfies awserr.Error interface.
  12300. func (s TagException) OrigErr() error {
  12301. return nil
  12302. }
  12303. func (s TagException) Error() string {
  12304. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  12305. }
  12306. // Status code returns the HTTP status code for the request's response error.
  12307. func (s TagException) StatusCode() int {
  12308. return s.respMetadata.StatusCode
  12309. }
  12310. // RequestID returns the service's response RequestID for request.
  12311. func (s TagException) RequestID() string {
  12312. return s.respMetadata.RequestID
  12313. }
  12314. type TagResourceInput struct {
  12315. _ struct{} `type:"structure"`
  12316. // A unique identifier for the CMK you are tagging.
  12317. //
  12318. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  12319. //
  12320. // For example:
  12321. //
  12322. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  12323. //
  12324. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12325. //
  12326. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  12327. //
  12328. // KeyId is a required field
  12329. KeyId *string `min:"1" type:"string" required:"true"`
  12330. // One or more tags. Each tag consists of a tag key and a tag value.
  12331. //
  12332. // Tags is a required field
  12333. Tags []*Tag `type:"list" required:"true"`
  12334. }
  12335. // String returns the string representation
  12336. func (s TagResourceInput) String() string {
  12337. return awsutil.Prettify(s)
  12338. }
  12339. // GoString returns the string representation
  12340. func (s TagResourceInput) GoString() string {
  12341. return s.String()
  12342. }
  12343. // Validate inspects the fields of the type to determine if they are valid.
  12344. func (s *TagResourceInput) Validate() error {
  12345. invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"}
  12346. if s.KeyId == nil {
  12347. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  12348. }
  12349. if s.KeyId != nil && len(*s.KeyId) < 1 {
  12350. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  12351. }
  12352. if s.Tags == nil {
  12353. invalidParams.Add(request.NewErrParamRequired("Tags"))
  12354. }
  12355. if s.Tags != nil {
  12356. for i, v := range s.Tags {
  12357. if v == nil {
  12358. continue
  12359. }
  12360. if err := v.Validate(); err != nil {
  12361. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams))
  12362. }
  12363. }
  12364. }
  12365. if invalidParams.Len() > 0 {
  12366. return invalidParams
  12367. }
  12368. return nil
  12369. }
  12370. // SetKeyId sets the KeyId field's value.
  12371. func (s *TagResourceInput) SetKeyId(v string) *TagResourceInput {
  12372. s.KeyId = &v
  12373. return s
  12374. }
  12375. // SetTags sets the Tags field's value.
  12376. func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput {
  12377. s.Tags = v
  12378. return s
  12379. }
  12380. type TagResourceOutput struct {
  12381. _ struct{} `type:"structure"`
  12382. }
  12383. // String returns the string representation
  12384. func (s TagResourceOutput) String() string {
  12385. return awsutil.Prettify(s)
  12386. }
  12387. // GoString returns the string representation
  12388. func (s TagResourceOutput) GoString() string {
  12389. return s.String()
  12390. }
  12391. // The request was rejected because a specified parameter is not supported or
  12392. // a specified resource is not valid for this operation.
  12393. type UnsupportedOperationException struct {
  12394. _ struct{} `type:"structure"`
  12395. respMetadata protocol.ResponseMetadata
  12396. Message_ *string `locationName:"message" type:"string"`
  12397. }
  12398. // String returns the string representation
  12399. func (s UnsupportedOperationException) String() string {
  12400. return awsutil.Prettify(s)
  12401. }
  12402. // GoString returns the string representation
  12403. func (s UnsupportedOperationException) GoString() string {
  12404. return s.String()
  12405. }
  12406. func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error {
  12407. return &UnsupportedOperationException{
  12408. respMetadata: v,
  12409. }
  12410. }
  12411. // Code returns the exception type name.
  12412. func (s UnsupportedOperationException) Code() string {
  12413. return "UnsupportedOperationException"
  12414. }
  12415. // Message returns the exception's message.
  12416. func (s UnsupportedOperationException) Message() string {
  12417. if s.Message_ != nil {
  12418. return *s.Message_
  12419. }
  12420. return ""
  12421. }
  12422. // OrigErr always returns nil, satisfies awserr.Error interface.
  12423. func (s UnsupportedOperationException) OrigErr() error {
  12424. return nil
  12425. }
  12426. func (s UnsupportedOperationException) Error() string {
  12427. return fmt.Sprintf("%s: %s", s.Code(), s.Message())
  12428. }
  12429. // Status code returns the HTTP status code for the request's response error.
  12430. func (s UnsupportedOperationException) StatusCode() int {
  12431. return s.respMetadata.StatusCode
  12432. }
  12433. // RequestID returns the service's response RequestID for request.
  12434. func (s UnsupportedOperationException) RequestID() string {
  12435. return s.respMetadata.RequestID
  12436. }
  12437. type UntagResourceInput struct {
  12438. _ struct{} `type:"structure"`
  12439. // A unique identifier for the CMK from which you are removing tags.
  12440. //
  12441. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  12442. //
  12443. // For example:
  12444. //
  12445. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  12446. //
  12447. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12448. //
  12449. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  12450. //
  12451. // KeyId is a required field
  12452. KeyId *string `min:"1" type:"string" required:"true"`
  12453. // One or more tag keys. Specify only the tag keys, not the tag values.
  12454. //
  12455. // TagKeys is a required field
  12456. TagKeys []*string `type:"list" required:"true"`
  12457. }
  12458. // String returns the string representation
  12459. func (s UntagResourceInput) String() string {
  12460. return awsutil.Prettify(s)
  12461. }
  12462. // GoString returns the string representation
  12463. func (s UntagResourceInput) GoString() string {
  12464. return s.String()
  12465. }
  12466. // Validate inspects the fields of the type to determine if they are valid.
  12467. func (s *UntagResourceInput) Validate() error {
  12468. invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"}
  12469. if s.KeyId == nil {
  12470. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  12471. }
  12472. if s.KeyId != nil && len(*s.KeyId) < 1 {
  12473. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  12474. }
  12475. if s.TagKeys == nil {
  12476. invalidParams.Add(request.NewErrParamRequired("TagKeys"))
  12477. }
  12478. if invalidParams.Len() > 0 {
  12479. return invalidParams
  12480. }
  12481. return nil
  12482. }
  12483. // SetKeyId sets the KeyId field's value.
  12484. func (s *UntagResourceInput) SetKeyId(v string) *UntagResourceInput {
  12485. s.KeyId = &v
  12486. return s
  12487. }
  12488. // SetTagKeys sets the TagKeys field's value.
  12489. func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput {
  12490. s.TagKeys = v
  12491. return s
  12492. }
  12493. type UntagResourceOutput struct {
  12494. _ struct{} `type:"structure"`
  12495. }
  12496. // String returns the string representation
  12497. func (s UntagResourceOutput) String() string {
  12498. return awsutil.Prettify(s)
  12499. }
  12500. // GoString returns the string representation
  12501. func (s UntagResourceOutput) GoString() string {
  12502. return s.String()
  12503. }
  12504. type UpdateAliasInput struct {
  12505. _ struct{} `type:"structure"`
  12506. // Identifies the alias that is changing its CMK. This value must begin with
  12507. // alias/ followed by the alias name, such as alias/ExampleAlias. You cannot
  12508. // use UpdateAlias to change the alias name.
  12509. //
  12510. // AliasName is a required field
  12511. AliasName *string `min:"1" type:"string" required:"true"`
  12512. // Identifies the CMK to associate with the alias. When the update operation
  12513. // completes, the alias will point to this CMK.
  12514. //
  12515. // The CMK must be in the same AWS account and Region as the alias. Also, the
  12516. // new target CMK must be the same type as the current target CMK (both symmetric
  12517. // or both asymmetric) and they must have the same key usage.
  12518. //
  12519. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  12520. //
  12521. // For example:
  12522. //
  12523. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  12524. //
  12525. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12526. //
  12527. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  12528. //
  12529. // To verify that the alias is mapped to the correct CMK, use ListAliases.
  12530. //
  12531. // TargetKeyId is a required field
  12532. TargetKeyId *string `min:"1" type:"string" required:"true"`
  12533. }
  12534. // String returns the string representation
  12535. func (s UpdateAliasInput) String() string {
  12536. return awsutil.Prettify(s)
  12537. }
  12538. // GoString returns the string representation
  12539. func (s UpdateAliasInput) GoString() string {
  12540. return s.String()
  12541. }
  12542. // Validate inspects the fields of the type to determine if they are valid.
  12543. func (s *UpdateAliasInput) Validate() error {
  12544. invalidParams := request.ErrInvalidParams{Context: "UpdateAliasInput"}
  12545. if s.AliasName == nil {
  12546. invalidParams.Add(request.NewErrParamRequired("AliasName"))
  12547. }
  12548. if s.AliasName != nil && len(*s.AliasName) < 1 {
  12549. invalidParams.Add(request.NewErrParamMinLen("AliasName", 1))
  12550. }
  12551. if s.TargetKeyId == nil {
  12552. invalidParams.Add(request.NewErrParamRequired("TargetKeyId"))
  12553. }
  12554. if s.TargetKeyId != nil && len(*s.TargetKeyId) < 1 {
  12555. invalidParams.Add(request.NewErrParamMinLen("TargetKeyId", 1))
  12556. }
  12557. if invalidParams.Len() > 0 {
  12558. return invalidParams
  12559. }
  12560. return nil
  12561. }
  12562. // SetAliasName sets the AliasName field's value.
  12563. func (s *UpdateAliasInput) SetAliasName(v string) *UpdateAliasInput {
  12564. s.AliasName = &v
  12565. return s
  12566. }
  12567. // SetTargetKeyId sets the TargetKeyId field's value.
  12568. func (s *UpdateAliasInput) SetTargetKeyId(v string) *UpdateAliasInput {
  12569. s.TargetKeyId = &v
  12570. return s
  12571. }
  12572. type UpdateAliasOutput struct {
  12573. _ struct{} `type:"structure"`
  12574. }
  12575. // String returns the string representation
  12576. func (s UpdateAliasOutput) String() string {
  12577. return awsutil.Prettify(s)
  12578. }
  12579. // GoString returns the string representation
  12580. func (s UpdateAliasOutput) GoString() string {
  12581. return s.String()
  12582. }
  12583. type UpdateCustomKeyStoreInput struct {
  12584. _ struct{} `type:"structure"`
  12585. // Associates the custom key store with a related AWS CloudHSM cluster.
  12586. //
  12587. // Enter the cluster ID of the cluster that you used to create the custom key
  12588. // store or a cluster that shares a backup history and has the same cluster
  12589. // certificate as the original cluster. You cannot use this parameter to associate
  12590. // a custom key store with an unrelated cluster. In addition, the replacement
  12591. // cluster must fulfill the requirements (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
  12592. // for a cluster associated with a custom key store. To view the cluster certificate
  12593. // of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
  12594. // operation.
  12595. CloudHsmClusterId *string `min:"19" type:"string"`
  12596. // Identifies the custom key store that you want to update. Enter the ID of
  12597. // the custom key store. To find the ID of a custom key store, use the DescribeCustomKeyStores
  12598. // operation.
  12599. //
  12600. // CustomKeyStoreId is a required field
  12601. CustomKeyStoreId *string `min:"1" type:"string" required:"true"`
  12602. // Enter the current password of the kmsuser crypto user (CU) in the AWS CloudHSM
  12603. // cluster that is associated with the custom key store.
  12604. //
  12605. // This parameter tells AWS KMS the current password of the kmsuser crypto user
  12606. // (CU). It does not set or change the password of any users in the AWS CloudHSM
  12607. // cluster.
  12608. KeyStorePassword *string `min:"1" type:"string" sensitive:"true"`
  12609. // Changes the friendly name of the custom key store to the value that you specify.
  12610. // The custom key store name must be unique in the AWS account.
  12611. NewCustomKeyStoreName *string `min:"1" type:"string"`
  12612. }
  12613. // String returns the string representation
  12614. func (s UpdateCustomKeyStoreInput) String() string {
  12615. return awsutil.Prettify(s)
  12616. }
  12617. // GoString returns the string representation
  12618. func (s UpdateCustomKeyStoreInput) GoString() string {
  12619. return s.String()
  12620. }
  12621. // Validate inspects the fields of the type to determine if they are valid.
  12622. func (s *UpdateCustomKeyStoreInput) Validate() error {
  12623. invalidParams := request.ErrInvalidParams{Context: "UpdateCustomKeyStoreInput"}
  12624. if s.CloudHsmClusterId != nil && len(*s.CloudHsmClusterId) < 19 {
  12625. invalidParams.Add(request.NewErrParamMinLen("CloudHsmClusterId", 19))
  12626. }
  12627. if s.CustomKeyStoreId == nil {
  12628. invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId"))
  12629. }
  12630. if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 {
  12631. invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1))
  12632. }
  12633. if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 1 {
  12634. invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 1))
  12635. }
  12636. if s.NewCustomKeyStoreName != nil && len(*s.NewCustomKeyStoreName) < 1 {
  12637. invalidParams.Add(request.NewErrParamMinLen("NewCustomKeyStoreName", 1))
  12638. }
  12639. if invalidParams.Len() > 0 {
  12640. return invalidParams
  12641. }
  12642. return nil
  12643. }
  12644. // SetCloudHsmClusterId sets the CloudHsmClusterId field's value.
  12645. func (s *UpdateCustomKeyStoreInput) SetCloudHsmClusterId(v string) *UpdateCustomKeyStoreInput {
  12646. s.CloudHsmClusterId = &v
  12647. return s
  12648. }
  12649. // SetCustomKeyStoreId sets the CustomKeyStoreId field's value.
  12650. func (s *UpdateCustomKeyStoreInput) SetCustomKeyStoreId(v string) *UpdateCustomKeyStoreInput {
  12651. s.CustomKeyStoreId = &v
  12652. return s
  12653. }
  12654. // SetKeyStorePassword sets the KeyStorePassword field's value.
  12655. func (s *UpdateCustomKeyStoreInput) SetKeyStorePassword(v string) *UpdateCustomKeyStoreInput {
  12656. s.KeyStorePassword = &v
  12657. return s
  12658. }
  12659. // SetNewCustomKeyStoreName sets the NewCustomKeyStoreName field's value.
  12660. func (s *UpdateCustomKeyStoreInput) SetNewCustomKeyStoreName(v string) *UpdateCustomKeyStoreInput {
  12661. s.NewCustomKeyStoreName = &v
  12662. return s
  12663. }
  12664. type UpdateCustomKeyStoreOutput struct {
  12665. _ struct{} `type:"structure"`
  12666. }
  12667. // String returns the string representation
  12668. func (s UpdateCustomKeyStoreOutput) String() string {
  12669. return awsutil.Prettify(s)
  12670. }
  12671. // GoString returns the string representation
  12672. func (s UpdateCustomKeyStoreOutput) GoString() string {
  12673. return s.String()
  12674. }
  12675. type UpdateKeyDescriptionInput struct {
  12676. _ struct{} `type:"structure"`
  12677. // New description for the CMK.
  12678. //
  12679. // Description is a required field
  12680. Description *string `type:"string" required:"true"`
  12681. // A unique identifier for the customer master key (CMK).
  12682. //
  12683. // Specify the key ID or the Amazon Resource Name (ARN) of the CMK.
  12684. //
  12685. // For example:
  12686. //
  12687. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  12688. //
  12689. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12690. //
  12691. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey.
  12692. //
  12693. // KeyId is a required field
  12694. KeyId *string `min:"1" type:"string" required:"true"`
  12695. }
  12696. // String returns the string representation
  12697. func (s UpdateKeyDescriptionInput) String() string {
  12698. return awsutil.Prettify(s)
  12699. }
  12700. // GoString returns the string representation
  12701. func (s UpdateKeyDescriptionInput) GoString() string {
  12702. return s.String()
  12703. }
  12704. // Validate inspects the fields of the type to determine if they are valid.
  12705. func (s *UpdateKeyDescriptionInput) Validate() error {
  12706. invalidParams := request.ErrInvalidParams{Context: "UpdateKeyDescriptionInput"}
  12707. if s.Description == nil {
  12708. invalidParams.Add(request.NewErrParamRequired("Description"))
  12709. }
  12710. if s.KeyId == nil {
  12711. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  12712. }
  12713. if s.KeyId != nil && len(*s.KeyId) < 1 {
  12714. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  12715. }
  12716. if invalidParams.Len() > 0 {
  12717. return invalidParams
  12718. }
  12719. return nil
  12720. }
  12721. // SetDescription sets the Description field's value.
  12722. func (s *UpdateKeyDescriptionInput) SetDescription(v string) *UpdateKeyDescriptionInput {
  12723. s.Description = &v
  12724. return s
  12725. }
  12726. // SetKeyId sets the KeyId field's value.
  12727. func (s *UpdateKeyDescriptionInput) SetKeyId(v string) *UpdateKeyDescriptionInput {
  12728. s.KeyId = &v
  12729. return s
  12730. }
  12731. type UpdateKeyDescriptionOutput struct {
  12732. _ struct{} `type:"structure"`
  12733. }
  12734. // String returns the string representation
  12735. func (s UpdateKeyDescriptionOutput) String() string {
  12736. return awsutil.Prettify(s)
  12737. }
  12738. // GoString returns the string representation
  12739. func (s UpdateKeyDescriptionOutput) GoString() string {
  12740. return s.String()
  12741. }
  12742. type VerifyInput struct {
  12743. _ struct{} `type:"structure"`
  12744. // A list of grant tokens.
  12745. //
  12746. // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token)
  12747. // in the AWS Key Management Service Developer Guide.
  12748. GrantTokens []*string `type:"list"`
  12749. // Identifies the asymmetric CMK that will be used to verify the signature.
  12750. // This must be the same CMK that was used to generate the signature. If you
  12751. // specify a different CMK, the signature verification fails.
  12752. //
  12753. // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name,
  12754. // or alias ARN. When using an alias name, prefix it with "alias/". To specify
  12755. // a CMK in a different AWS account, you must use the key ARN or alias ARN.
  12756. //
  12757. // For example:
  12758. //
  12759. // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
  12760. //
  12761. // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
  12762. //
  12763. // * Alias name: alias/ExampleAlias
  12764. //
  12765. // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
  12766. //
  12767. // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To
  12768. // get the alias name and alias ARN, use ListAliases.
  12769. //
  12770. // KeyId is a required field
  12771. KeyId *string `min:"1" type:"string" required:"true"`
  12772. // Specifies the message that was signed, or a hash digest of that message.
  12773. // Messages can be 0-4096 bytes. To verify a larger message, provide a hash
  12774. // digest of the message.
  12775. //
  12776. // If the digest of the message specified here is different from the message
  12777. // digest that was signed, the signature verification fails.
  12778. //
  12779. // Message is automatically base64 encoded/decoded by the SDK.
  12780. //
  12781. // Message is a required field
  12782. Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"`
  12783. // Tells AWS KMS whether the value of the Message parameter is a message or
  12784. // message digest. To indicate a message, enter RAW. To indicate a message digest,
  12785. // enter DIGEST.
  12786. MessageType *string `type:"string" enum:"MessageType"`
  12787. // The signature that the Sign operation generated.
  12788. //
  12789. // Signature is automatically base64 encoded/decoded by the SDK.
  12790. //
  12791. // Signature is a required field
  12792. Signature []byte `min:"1" type:"blob" required:"true"`
  12793. // The signing algorithm that was used to sign the message. If you submit a
  12794. // different algorithm, the signature verification fails.
  12795. //
  12796. // SigningAlgorithm is a required field
  12797. SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"`
  12798. }
  12799. // String returns the string representation
  12800. func (s VerifyInput) String() string {
  12801. return awsutil.Prettify(s)
  12802. }
  12803. // GoString returns the string representation
  12804. func (s VerifyInput) GoString() string {
  12805. return s.String()
  12806. }
  12807. // Validate inspects the fields of the type to determine if they are valid.
  12808. func (s *VerifyInput) Validate() error {
  12809. invalidParams := request.ErrInvalidParams{Context: "VerifyInput"}
  12810. if s.KeyId == nil {
  12811. invalidParams.Add(request.NewErrParamRequired("KeyId"))
  12812. }
  12813. if s.KeyId != nil && len(*s.KeyId) < 1 {
  12814. invalidParams.Add(request.NewErrParamMinLen("KeyId", 1))
  12815. }
  12816. if s.Message == nil {
  12817. invalidParams.Add(request.NewErrParamRequired("Message"))
  12818. }
  12819. if s.Message != nil && len(s.Message) < 1 {
  12820. invalidParams.Add(request.NewErrParamMinLen("Message", 1))
  12821. }
  12822. if s.Signature == nil {
  12823. invalidParams.Add(request.NewErrParamRequired("Signature"))
  12824. }
  12825. if s.Signature != nil && len(s.Signature) < 1 {
  12826. invalidParams.Add(request.NewErrParamMinLen("Signature", 1))
  12827. }
  12828. if s.SigningAlgorithm == nil {
  12829. invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm"))
  12830. }
  12831. if invalidParams.Len() > 0 {
  12832. return invalidParams
  12833. }
  12834. return nil
  12835. }
  12836. // SetGrantTokens sets the GrantTokens field's value.
  12837. func (s *VerifyInput) SetGrantTokens(v []*string) *VerifyInput {
  12838. s.GrantTokens = v
  12839. return s
  12840. }
  12841. // SetKeyId sets the KeyId field's value.
  12842. func (s *VerifyInput) SetKeyId(v string) *VerifyInput {
  12843. s.KeyId = &v
  12844. return s
  12845. }
  12846. // SetMessage sets the Message field's value.
  12847. func (s *VerifyInput) SetMessage(v []byte) *VerifyInput {
  12848. s.Message = v
  12849. return s
  12850. }
  12851. // SetMessageType sets the MessageType field's value.
  12852. func (s *VerifyInput) SetMessageType(v string) *VerifyInput {
  12853. s.MessageType = &v
  12854. return s
  12855. }
  12856. // SetSignature sets the Signature field's value.
  12857. func (s *VerifyInput) SetSignature(v []byte) *VerifyInput {
  12858. s.Signature = v
  12859. return s
  12860. }
  12861. // SetSigningAlgorithm sets the SigningAlgorithm field's value.
  12862. func (s *VerifyInput) SetSigningAlgorithm(v string) *VerifyInput {
  12863. s.SigningAlgorithm = &v
  12864. return s
  12865. }
  12866. type VerifyOutput struct {
  12867. _ struct{} `type:"structure"`
  12868. // The unique identifier for the asymmetric CMK that was used to verify the
  12869. // signature.
  12870. KeyId *string `min:"1" type:"string"`
  12871. // A Boolean value that indicates whether the signature was verified. A value
  12872. // of True indicates that the Signature was produced by signing the Message
  12873. // with the specified KeyID and SigningAlgorithm. If the signature is not verified,
  12874. // the Verify operation fails with a KMSInvalidSignatureException exception.
  12875. SignatureValid *bool `type:"boolean"`
  12876. // The signing algorithm that was used to verify the signature.
  12877. SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"`
  12878. }
  12879. // String returns the string representation
  12880. func (s VerifyOutput) String() string {
  12881. return awsutil.Prettify(s)
  12882. }
  12883. // GoString returns the string representation
  12884. func (s VerifyOutput) GoString() string {
  12885. return s.String()
  12886. }
  12887. // SetKeyId sets the KeyId field's value.
  12888. func (s *VerifyOutput) SetKeyId(v string) *VerifyOutput {
  12889. s.KeyId = &v
  12890. return s
  12891. }
  12892. // SetSignatureValid sets the SignatureValid field's value.
  12893. func (s *VerifyOutput) SetSignatureValid(v bool) *VerifyOutput {
  12894. s.SignatureValid = &v
  12895. return s
  12896. }
  12897. // SetSigningAlgorithm sets the SigningAlgorithm field's value.
  12898. func (s *VerifyOutput) SetSigningAlgorithm(v string) *VerifyOutput {
  12899. s.SigningAlgorithm = &v
  12900. return s
  12901. }
  12902. const (
  12903. // AlgorithmSpecRsaesPkcs1V15 is a AlgorithmSpec enum value
  12904. AlgorithmSpecRsaesPkcs1V15 = "RSAES_PKCS1_V1_5"
  12905. // AlgorithmSpecRsaesOaepSha1 is a AlgorithmSpec enum value
  12906. AlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1"
  12907. // AlgorithmSpecRsaesOaepSha256 is a AlgorithmSpec enum value
  12908. AlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256"
  12909. )
  12910. const (
  12911. // ConnectionErrorCodeTypeInvalidCredentials is a ConnectionErrorCodeType enum value
  12912. ConnectionErrorCodeTypeInvalidCredentials = "INVALID_CREDENTIALS"
  12913. // ConnectionErrorCodeTypeClusterNotFound is a ConnectionErrorCodeType enum value
  12914. ConnectionErrorCodeTypeClusterNotFound = "CLUSTER_NOT_FOUND"
  12915. // ConnectionErrorCodeTypeNetworkErrors is a ConnectionErrorCodeType enum value
  12916. ConnectionErrorCodeTypeNetworkErrors = "NETWORK_ERRORS"
  12917. // ConnectionErrorCodeTypeInternalError is a ConnectionErrorCodeType enum value
  12918. ConnectionErrorCodeTypeInternalError = "INTERNAL_ERROR"
  12919. // ConnectionErrorCodeTypeInsufficientCloudhsmHsms is a ConnectionErrorCodeType enum value
  12920. ConnectionErrorCodeTypeInsufficientCloudhsmHsms = "INSUFFICIENT_CLOUDHSM_HSMS"
  12921. // ConnectionErrorCodeTypeUserLockedOut is a ConnectionErrorCodeType enum value
  12922. ConnectionErrorCodeTypeUserLockedOut = "USER_LOCKED_OUT"
  12923. )
  12924. const (
  12925. // ConnectionStateTypeConnected is a ConnectionStateType enum value
  12926. ConnectionStateTypeConnected = "CONNECTED"
  12927. // ConnectionStateTypeConnecting is a ConnectionStateType enum value
  12928. ConnectionStateTypeConnecting = "CONNECTING"
  12929. // ConnectionStateTypeFailed is a ConnectionStateType enum value
  12930. ConnectionStateTypeFailed = "FAILED"
  12931. // ConnectionStateTypeDisconnected is a ConnectionStateType enum value
  12932. ConnectionStateTypeDisconnected = "DISCONNECTED"
  12933. // ConnectionStateTypeDisconnecting is a ConnectionStateType enum value
  12934. ConnectionStateTypeDisconnecting = "DISCONNECTING"
  12935. )
  12936. const (
  12937. // CustomerMasterKeySpecRsa2048 is a CustomerMasterKeySpec enum value
  12938. CustomerMasterKeySpecRsa2048 = "RSA_2048"
  12939. // CustomerMasterKeySpecRsa3072 is a CustomerMasterKeySpec enum value
  12940. CustomerMasterKeySpecRsa3072 = "RSA_3072"
  12941. // CustomerMasterKeySpecRsa4096 is a CustomerMasterKeySpec enum value
  12942. CustomerMasterKeySpecRsa4096 = "RSA_4096"
  12943. // CustomerMasterKeySpecEccNistP256 is a CustomerMasterKeySpec enum value
  12944. CustomerMasterKeySpecEccNistP256 = "ECC_NIST_P256"
  12945. // CustomerMasterKeySpecEccNistP384 is a CustomerMasterKeySpec enum value
  12946. CustomerMasterKeySpecEccNistP384 = "ECC_NIST_P384"
  12947. // CustomerMasterKeySpecEccNistP521 is a CustomerMasterKeySpec enum value
  12948. CustomerMasterKeySpecEccNistP521 = "ECC_NIST_P521"
  12949. // CustomerMasterKeySpecEccSecgP256k1 is a CustomerMasterKeySpec enum value
  12950. CustomerMasterKeySpecEccSecgP256k1 = "ECC_SECG_P256K1"
  12951. // CustomerMasterKeySpecSymmetricDefault is a CustomerMasterKeySpec enum value
  12952. CustomerMasterKeySpecSymmetricDefault = "SYMMETRIC_DEFAULT"
  12953. )
  12954. const (
  12955. // DataKeyPairSpecRsa2048 is a DataKeyPairSpec enum value
  12956. DataKeyPairSpecRsa2048 = "RSA_2048"
  12957. // DataKeyPairSpecRsa3072 is a DataKeyPairSpec enum value
  12958. DataKeyPairSpecRsa3072 = "RSA_3072"
  12959. // DataKeyPairSpecRsa4096 is a DataKeyPairSpec enum value
  12960. DataKeyPairSpecRsa4096 = "RSA_4096"
  12961. // DataKeyPairSpecEccNistP256 is a DataKeyPairSpec enum value
  12962. DataKeyPairSpecEccNistP256 = "ECC_NIST_P256"
  12963. // DataKeyPairSpecEccNistP384 is a DataKeyPairSpec enum value
  12964. DataKeyPairSpecEccNistP384 = "ECC_NIST_P384"
  12965. // DataKeyPairSpecEccNistP521 is a DataKeyPairSpec enum value
  12966. DataKeyPairSpecEccNistP521 = "ECC_NIST_P521"
  12967. // DataKeyPairSpecEccSecgP256k1 is a DataKeyPairSpec enum value
  12968. DataKeyPairSpecEccSecgP256k1 = "ECC_SECG_P256K1"
  12969. )
  12970. const (
  12971. // DataKeySpecAes256 is a DataKeySpec enum value
  12972. DataKeySpecAes256 = "AES_256"
  12973. // DataKeySpecAes128 is a DataKeySpec enum value
  12974. DataKeySpecAes128 = "AES_128"
  12975. )
  12976. const (
  12977. // EncryptionAlgorithmSpecSymmetricDefault is a EncryptionAlgorithmSpec enum value
  12978. EncryptionAlgorithmSpecSymmetricDefault = "SYMMETRIC_DEFAULT"
  12979. // EncryptionAlgorithmSpecRsaesOaepSha1 is a EncryptionAlgorithmSpec enum value
  12980. EncryptionAlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1"
  12981. // EncryptionAlgorithmSpecRsaesOaepSha256 is a EncryptionAlgorithmSpec enum value
  12982. EncryptionAlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256"
  12983. )
  12984. const (
  12985. // ExpirationModelTypeKeyMaterialExpires is a ExpirationModelType enum value
  12986. ExpirationModelTypeKeyMaterialExpires = "KEY_MATERIAL_EXPIRES"
  12987. // ExpirationModelTypeKeyMaterialDoesNotExpire is a ExpirationModelType enum value
  12988. ExpirationModelTypeKeyMaterialDoesNotExpire = "KEY_MATERIAL_DOES_NOT_EXPIRE"
  12989. )
  12990. const (
  12991. // GrantOperationDecrypt is a GrantOperation enum value
  12992. GrantOperationDecrypt = "Decrypt"
  12993. // GrantOperationEncrypt is a GrantOperation enum value
  12994. GrantOperationEncrypt = "Encrypt"
  12995. // GrantOperationGenerateDataKey is a GrantOperation enum value
  12996. GrantOperationGenerateDataKey = "GenerateDataKey"
  12997. // GrantOperationGenerateDataKeyWithoutPlaintext is a GrantOperation enum value
  12998. GrantOperationGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext"
  12999. // GrantOperationReEncryptFrom is a GrantOperation enum value
  13000. GrantOperationReEncryptFrom = "ReEncryptFrom"
  13001. // GrantOperationReEncryptTo is a GrantOperation enum value
  13002. GrantOperationReEncryptTo = "ReEncryptTo"
  13003. // GrantOperationSign is a GrantOperation enum value
  13004. GrantOperationSign = "Sign"
  13005. // GrantOperationVerify is a GrantOperation enum value
  13006. GrantOperationVerify = "Verify"
  13007. // GrantOperationGetPublicKey is a GrantOperation enum value
  13008. GrantOperationGetPublicKey = "GetPublicKey"
  13009. // GrantOperationCreateGrant is a GrantOperation enum value
  13010. GrantOperationCreateGrant = "CreateGrant"
  13011. // GrantOperationRetireGrant is a GrantOperation enum value
  13012. GrantOperationRetireGrant = "RetireGrant"
  13013. // GrantOperationDescribeKey is a GrantOperation enum value
  13014. GrantOperationDescribeKey = "DescribeKey"
  13015. // GrantOperationGenerateDataKeyPair is a GrantOperation enum value
  13016. GrantOperationGenerateDataKeyPair = "GenerateDataKeyPair"
  13017. // GrantOperationGenerateDataKeyPairWithoutPlaintext is a GrantOperation enum value
  13018. GrantOperationGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext"
  13019. )
  13020. const (
  13021. // KeyManagerTypeAws is a KeyManagerType enum value
  13022. KeyManagerTypeAws = "AWS"
  13023. // KeyManagerTypeCustomer is a KeyManagerType enum value
  13024. KeyManagerTypeCustomer = "CUSTOMER"
  13025. )
  13026. const (
  13027. // KeyStateEnabled is a KeyState enum value
  13028. KeyStateEnabled = "Enabled"
  13029. // KeyStateDisabled is a KeyState enum value
  13030. KeyStateDisabled = "Disabled"
  13031. // KeyStatePendingDeletion is a KeyState enum value
  13032. KeyStatePendingDeletion = "PendingDeletion"
  13033. // KeyStatePendingImport is a KeyState enum value
  13034. KeyStatePendingImport = "PendingImport"
  13035. // KeyStateUnavailable is a KeyState enum value
  13036. KeyStateUnavailable = "Unavailable"
  13037. )
  13038. const (
  13039. // KeyUsageTypeSignVerify is a KeyUsageType enum value
  13040. KeyUsageTypeSignVerify = "SIGN_VERIFY"
  13041. // KeyUsageTypeEncryptDecrypt is a KeyUsageType enum value
  13042. KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT"
  13043. )
  13044. const (
  13045. // MessageTypeRaw is a MessageType enum value
  13046. MessageTypeRaw = "RAW"
  13047. // MessageTypeDigest is a MessageType enum value
  13048. MessageTypeDigest = "DIGEST"
  13049. )
  13050. const (
  13051. // OriginTypeAwsKms is a OriginType enum value
  13052. OriginTypeAwsKms = "AWS_KMS"
  13053. // OriginTypeExternal is a OriginType enum value
  13054. OriginTypeExternal = "EXTERNAL"
  13055. // OriginTypeAwsCloudhsm is a OriginType enum value
  13056. OriginTypeAwsCloudhsm = "AWS_CLOUDHSM"
  13057. )
  13058. const (
  13059. // SigningAlgorithmSpecRsassaPssSha256 is a SigningAlgorithmSpec enum value
  13060. SigningAlgorithmSpecRsassaPssSha256 = "RSASSA_PSS_SHA_256"
  13061. // SigningAlgorithmSpecRsassaPssSha384 is a SigningAlgorithmSpec enum value
  13062. SigningAlgorithmSpecRsassaPssSha384 = "RSASSA_PSS_SHA_384"
  13063. // SigningAlgorithmSpecRsassaPssSha512 is a SigningAlgorithmSpec enum value
  13064. SigningAlgorithmSpecRsassaPssSha512 = "RSASSA_PSS_SHA_512"
  13065. // SigningAlgorithmSpecRsassaPkcs1V15Sha256 is a SigningAlgorithmSpec enum value
  13066. SigningAlgorithmSpecRsassaPkcs1V15Sha256 = "RSASSA_PKCS1_V1_5_SHA_256"
  13067. // SigningAlgorithmSpecRsassaPkcs1V15Sha384 is a SigningAlgorithmSpec enum value
  13068. SigningAlgorithmSpecRsassaPkcs1V15Sha384 = "RSASSA_PKCS1_V1_5_SHA_384"
  13069. // SigningAlgorithmSpecRsassaPkcs1V15Sha512 is a SigningAlgorithmSpec enum value
  13070. SigningAlgorithmSpecRsassaPkcs1V15Sha512 = "RSASSA_PKCS1_V1_5_SHA_512"
  13071. // SigningAlgorithmSpecEcdsaSha256 is a SigningAlgorithmSpec enum value
  13072. SigningAlgorithmSpecEcdsaSha256 = "ECDSA_SHA_256"
  13073. // SigningAlgorithmSpecEcdsaSha384 is a SigningAlgorithmSpec enum value
  13074. SigningAlgorithmSpecEcdsaSha384 = "ECDSA_SHA_384"
  13075. // SigningAlgorithmSpecEcdsaSha512 is a SigningAlgorithmSpec enum value
  13076. SigningAlgorithmSpecEcdsaSha512 = "ECDSA_SHA_512"
  13077. )
  13078. const (
  13079. // WrappingKeySpecRsa2048 is a WrappingKeySpec enum value
  13080. WrappingKeySpecRsa2048 = "RSA_2048"
  13081. )