| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261 |
- /*!
- * Copyright (c) 2014, GlobalSign
- * Copyright (c) 2015-2019, Peculiar Ventures
- * All rights reserved.
- *
- * Author 2014-2019, Yury Strozhevsky
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright notice, this
- * list of conditions and the following disclaimer in the documentation and/or
- * other materials provided with the distribution.
- *
- * * Neither the name of the {organization} nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
- import * as asn1js from 'asn1js';
- import { BitString, OctetString } from 'asn1js';
- import * as bs from 'bytestreamjs';
- type SchemaType = any;
- type SchemaNames = {
- blockName?: string;
- optional?: boolean;
- };
- interface SchemaCompatible {
- /**
- * Converts parsed ASN.1 object into current class
- * @param schema
- */
- fromSchema(schema: SchemaType): void;
- /**
- * Convert current object to asn1js object and set correct values
- * @returns asn1js object
- */
- toSchema(): SchemaType;
- toJSON(): any;
- }
- interface SchemaConstructor {
- schema?: SchemaType;
- }
- /**
- * Parameters for schema generation
- */
- interface SchemaParameters<N extends Record<string, any> = object> {
- names?: SchemaNames & N;
- }
- interface PkiObjectParameters {
- schema?: SchemaType;
- }
- interface PkiObjectConstructor<T extends PkiObject = PkiObject> {
- new (params: PkiObjectParameters): T;
- CLASS_NAME: string;
- }
- declare abstract class PkiObject {
- /**
- * Name of the class
- */
- static CLASS_NAME: string;
- /**
- * Returns block name
- * @returns Returns string block name
- */
- static blockName(): string;
- /**
- * Creates PKI object from the raw data
- * @param raw ASN.1 encoded raw data
- * @returns Initialized and filled current class object
- */
- static fromBER<T extends PkiObject>(this: PkiObjectConstructor<T>, raw: BufferSource): T;
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: string): any;
- /**
- * Returns value of pre-defined ASN.1 schema for current class
- * @param parameters Input parameters for the schema
- * @returns ASN.1 schema object
- */
- static schema(parameters?: SchemaParameters): SchemaType;
- get className(): string;
- /**
- * Converts parsed ASN.1 object into current class
- * @param schema ASN.1 schema
- */
- abstract fromSchema(schema: SchemaType): void;
- /**
- * Converts current object to ASN.1 object and sets correct values
- * @param encodeFlag If param equal to `false` then creates schema via decoding stored value. In other case creates schema via assembling from cached parts
- * @returns ASN.1 object
- */
- abstract toSchema(encodeFlag?: boolean): SchemaType;
- /**
- * Converts the class to JSON object
- * @returns JSON object
- */
- abstract toJSON(): any;
- toString(encoding?: "hex" | "base64" | "base64url"): string;
- }
- declare const TYPE$5 = "type";
- declare const VALUE$6 = "value";
- interface IGeneralName {
- /**
- * value type - from a tagged value (0 for "otherName", 1 for "rfc822Name" etc.)
- */
- type: number;
- /**
- * ASN.1 object having GeneralName value (type depends on TYPE value)
- */
- value: any;
- }
- type GeneralNameParameters = PkiObjectParameters & Partial<{
- type: 1 | 2 | 6;
- value: string;
- } | {
- type: 0 | 3 | 4 | 7 | 8;
- value: any;
- }>;
- interface GeneralNameSchema {
- names?: {
- blockName?: string;
- directoryName?: object;
- builtInStandardAttributes?: object;
- otherName?: string;
- rfc822Name?: string;
- dNSName?: string;
- x400Address?: string;
- ediPartyName?: string;
- uniformResourceIdentifier?: string;
- iPAddress?: string;
- registeredID?: string;
- };
- }
- interface GeneralNameJson {
- type: number;
- value: string;
- }
- /**
- * Represents the GeneralName structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class GeneralName extends PkiObject implements IGeneralName {
- static CLASS_NAME: string;
- type: number;
- value: any;
- /**
- * Initializes a new instance of the {@link GeneralName} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: GeneralNameParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TYPE$5): number;
- static defaultValues(memberName: typeof VALUE$6): any;
- /**
- * Compares values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * GeneralName ::= Choice {
- * otherName [0] OtherName,
- * rfc822Name [1] IA5String,
- * dNSName [2] IA5String,
- * x400Address [3] ORAddress,
- * directoryName [4] value,
- * ediPartyName [5] EDIPartyName,
- * uniformResourceIdentifier [6] IA5String,
- * iPAddress [7] OCTET STRING,
- * registeredID [8] OBJECT IDENTIFIER }
- *```
- */
- static schema(parameters?: GeneralNameSchema): asn1js.Choice;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Constructed | asn1js.IA5String | asn1js.ObjectIdentifier | asn1js.Choice;
- toJSON(): GeneralNameJson;
- }
- declare const ACCESS_METHOD = "accessMethod";
- declare const ACCESS_LOCATION = "accessLocation";
- interface IAccessDescription {
- /**
- * The type and format of the information are specified by the accessMethod field. This profile defines two accessMethod OIDs: id-ad-caIssuers and id-ad-ocsp
- */
- accessMethod: string;
- /**
- * The accessLocation field specifies the location of the information
- */
- accessLocation: GeneralName;
- }
- type AccessDescriptionParameters = PkiObjectParameters & Partial<IAccessDescription>;
- /**
- * JSON representation of {@link AccessDescription}
- */
- interface AccessDescriptionJson {
- accessMethod: string;
- accessLocation: GeneralNameJson;
- }
- /**
- * Represents the AccessDescription structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- *
- * The authority information access extension indicates how to access
- * information and services for the issuer of the certificate in which
- * the extension appears. Information and services may include on-line
- * validation services and CA policy data. This extension may be included in
- * end entity or CA certificates. Conforming CAs MUST mark this
- * extension as non-critical.
- */
- declare class AccessDescription extends PkiObject implements IAccessDescription {
- static CLASS_NAME: string;
- accessMethod: string;
- accessLocation: GeneralName;
- /**
- * Initializes a new instance of the {@link AccessDescription} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AccessDescriptionParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ACCESS_METHOD): string;
- static defaultValues(memberName: typeof ACCESS_LOCATION): GeneralName;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AccessDescription ::= SEQUENCE {
- * accessMethod OBJECT IDENTIFIER,
- * accessLocation GeneralName }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- accessMethod?: string;
- accessLocation?: GeneralNameSchema;
- }>): asn1js.Sequence;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AccessDescriptionJson;
- }
- declare const SECONDS = "seconds";
- declare const MILLIS = "millis";
- declare const MICROS = "micros";
- interface IAccuracy {
- /**
- * Seconds
- */
- seconds?: number;
- /**
- * Milliseconds
- */
- millis?: number;
- /**
- * Microseconds
- */
- micros?: number;
- }
- type AccuracyParameters = PkiObjectParameters & Partial<IAccuracy>;
- type AccuracySchema = SchemaParameters<{
- seconds?: string;
- millis?: string;
- micros?: string;
- }>;
- /**
- * JSON representation of {@link Accuracy}
- */
- interface AccuracyJson {
- seconds?: number;
- millis?: number;
- micros?: number;
- }
- /**
- * Represents the time deviation around the UTC time contained in GeneralizedTime. Described in [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- */
- declare class Accuracy extends PkiObject implements IAccuracy {
- static CLASS_NAME: string;
- seconds?: number;
- millis?: number;
- micros?: number;
- /**
- * Initializes a new instance of the {@link Accuracy} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AccuracyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SECONDS): number;
- static defaultValues(memberName: typeof MILLIS): number;
- static defaultValues(memberName: typeof MICROS): number;
- static defaultValues(memberName: string): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: typeof SECONDS | typeof MILLIS | typeof MICROS, memberValue: number): boolean;
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Accuracy ::= SEQUENCE {
- * seconds INTEGER OPTIONAL,
- * millis [0] INTEGER (1..999) OPTIONAL,
- * micros [1] INTEGER (1..999) OPTIONAL }
- *```
- */
- static schema(parameters?: AccuracySchema): any;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AccuracyJson;
- }
- declare const ALGORITHM_ID = "algorithmId";
- declare const ALGORITHM_PARAMS = "algorithmParams";
- interface IAlgorithmIdentifier {
- /**
- * ObjectIdentifier for algorithm (string representation)
- */
- algorithmId: string;
- /**
- * Any algorithm parameters
- */
- algorithmParams?: any;
- }
- type AlgorithmIdentifierParameters = PkiObjectParameters & Partial<IAlgorithmIdentifier>;
- /**
- * JSON representation of {@link AlgorithmIdentifier}
- */
- interface AlgorithmIdentifierJson {
- algorithmId: string;
- algorithmParams?: any;
- }
- type AlgorithmIdentifierSchema = SchemaParameters<{
- algorithmIdentifier?: string;
- algorithmParams?: string;
- }>;
- /**
- * Represents the AlgorithmIdentifier structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class AlgorithmIdentifier extends PkiObject implements IAlgorithmIdentifier {
- static CLASS_NAME: string;
- algorithmId: string;
- algorithmParams?: any;
- /**
- * Initializes a new instance of the {@link AlgorithmIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AlgorithmIdentifierParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ALGORITHM_ID): string;
- static defaultValues(memberName: typeof ALGORITHM_PARAMS): any;
- /**
- * Compares values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AlgorithmIdentifier ::= Sequence {
- * algorithm OBJECT IDENTIFIER,
- * parameters ANY DEFINED BY algorithm OPTIONAL }
- *```
- */
- static schema(parameters?: AlgorithmIdentifierSchema): any;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AlgorithmIdentifierJson;
- /**
- * Checks that two "AlgorithmIdentifiers" are equal
- * @param algorithmIdentifier
- */
- isEqual(algorithmIdentifier: unknown): boolean;
- }
- declare const ALT_NAMES = "altNames";
- interface IAltName {
- /**
- * Array of alternative names in GeneralName type
- */
- altNames: GeneralName[];
- }
- type AltNameParameters = PkiObjectParameters & Partial<IAltName>;
- interface AltNameJson {
- altNames: GeneralNameJson[];
- }
- /**
- * Represents the AltName structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class AltName extends PkiObject implements IAltName {
- static CLASS_NAME: string;
- altNames: GeneralName[];
- /**
- * Initializes a new instance of the {@link AltName} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AltNameParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ALT_NAMES): GeneralName[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AltName ::= GeneralNames
- *```
- */
- static schema(parameters?: SchemaParameters<{
- altNames?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AltNameJson;
- }
- declare const TYPE$4 = "type";
- declare const VALUES$1 = "values";
- interface IAttribute {
- /**
- * Specifies type of attribute value
- */
- type: string;
- /**
- * List of attribute values
- */
- values: any[];
- }
- type AttributeParameters = PkiObjectParameters & Partial<IAttribute>;
- type AttributeSchema = SchemaParameters<{
- setName?: string;
- type?: string;
- values?: string;
- }>;
- interface AttributeJson {
- type: string;
- values: any[];
- }
- /**
- * Represents the Attribute structure described in [RFC2986](https://datatracker.ietf.org/doc/html/rfc2986)
- */
- declare class Attribute extends PkiObject implements IAttribute {
- static CLASS_NAME: string;
- type: string;
- values: any[];
- /**
- * Initializes a new instance of the {@link Attribute} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttributeParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TYPE$4): string;
- static defaultValues(memberName: typeof VALUES$1): any[];
- /**
- * Compares values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE {
- * type ATTRIBUTE.&id({IOSet}),
- * values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type})
- * }
- *```
- */
- static schema(parameters?: AttributeSchema): asn1js.Sequence;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttributeJson;
- }
- declare const NOT_BEFORE_TIME = "notBeforeTime";
- declare const NOT_AFTER_TIME = "notAfterTime";
- interface IAttCertValidityPeriod {
- notBeforeTime: Date;
- notAfterTime: Date;
- }
- type AttCertValidityPeriodParameters = PkiObjectParameters & Partial<IAttCertValidityPeriod>;
- type AttCertValidityPeriodSchema = SchemaParameters<{
- notBeforeTime?: string;
- notAfterTime?: string;
- }>;
- interface AttCertValidityPeriodJson {
- notBeforeTime: Date;
- notAfterTime: Date;
- }
- /**
- * Represents the AttCertValidityPeriod structure described in [RFC5755 Section 4.1](https://datatracker.ietf.org/doc/html/rfc5755#section-4.1)
- */
- declare class AttCertValidityPeriod extends PkiObject implements IAttCertValidityPeriod {
- static CLASS_NAME: string;
- notBeforeTime: Date;
- notAfterTime: Date;
- /**
- * Initializes a new instance of the {@link AttCertValidityPeriod} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttCertValidityPeriodParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof NOT_BEFORE_TIME): Date;
- static defaultValues(memberName: typeof NOT_AFTER_TIME): Date;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AttCertValidityPeriod ::= SEQUENCE {
- * notBeforeTime GeneralizedTime,
- * notAfterTime GeneralizedTime
- * }
- *```
- */
- static schema(parameters?: AttCertValidityPeriodSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttCertValidityPeriodJson;
- }
- declare const NAMES = "names";
- interface IGeneralNames {
- names: GeneralName[];
- }
- type GeneralNamesParameters = PkiObjectParameters & Partial<IGeneralNames>;
- type GeneralNamesSchema = SchemaParameters<{
- generalNames?: string;
- }>;
- interface GeneralNamesJson {
- names: GeneralNameJson[];
- }
- /**
- * Represents the GeneralNames structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class GeneralNames extends PkiObject implements IGeneralNames {
- static CLASS_NAME: string;
- /**
- * Array of "general names"
- */
- names: GeneralName[];
- /**
- * Initializes a new instance of the {@link GeneralNames} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: GeneralNamesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof NAMES): GeneralName[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
- * ```
- *
- * @param parameters Input parameters for the schema
- * @param optional Flag would be element optional or not
- * @returns ASN.1 schema object
- */
- static schema(parameters?: GeneralNamesSchema, optional?: boolean): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): GeneralNamesJson;
- }
- type ExtensionParsedValue = (SchemaCompatible & {
- parsingError?: string;
- }) | SchemaType;
- interface ExtensionValueType {
- name: string;
- type: ExtensionValueConstructor;
- }
- interface ExtensionValueConstructor {
- new (params?: {
- schema: any;
- }): SchemaCompatible;
- }
- declare class ExtensionValueFactory {
- static types?: Record<string, ExtensionValueType>;
- private static getItems;
- static fromBER(id: string, raw: BufferSource): ExtensionParsedValue | null;
- static find(id: string): ExtensionValueType | null;
- static register(id: string, name: string, type: ExtensionValueConstructor): void;
- }
- declare const EXTN_ID = "extnID";
- declare const CRITICAL = "critical";
- declare const EXTN_VALUE = "extnValue";
- declare const PARSED_VALUE$5 = "parsedValue";
- interface IExtension {
- extnID: string;
- critical: boolean;
- extnValue: asn1js.OctetString;
- parsedValue?: ExtensionParsedValue;
- }
- interface ExtensionConstructorParameters {
- extnID?: string;
- critical?: boolean;
- extnValue?: ArrayBuffer;
- parsedValue?: ExtensionParsedValue;
- }
- type ExtensionParameters = PkiObjectParameters & ExtensionConstructorParameters;
- type ExtensionSchema = SchemaParameters<{
- extnID?: string;
- critical?: string;
- extnValue?: string;
- }>;
- interface ExtensionJson {
- extnID: string;
- extnValue: asn1js.OctetStringJson;
- critical?: boolean;
- parsedValue?: any;
- }
- /**
- * Represents the Extension structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class Extension extends PkiObject implements IExtension {
- static CLASS_NAME: string;
- extnID: string;
- critical: boolean;
- extnValue: asn1js.OctetString;
- private _parsedValue?;
- get parsedValue(): ExtensionParsedValue | undefined;
- set parsedValue(value: ExtensionParsedValue | undefined);
- /**
- * Initializes a new instance of the {@link Extension} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ExtensionParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof EXTN_ID): string;
- static defaultValues(memberName: typeof CRITICAL): boolean;
- static defaultValues(memberName: typeof EXTN_VALUE): asn1js.OctetString;
- static defaultValues(memberName: typeof PARSED_VALUE$5): ExtensionParsedValue;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Extension ::= SEQUENCE {
- * extnID OBJECT IDENTIFIER,
- * critical BOOLEAN DEFAULT FALSE,
- * extnValue OCTET STRING
- * }
- *```
- */
- static schema(parameters?: ExtensionSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ExtensionJson;
- }
- declare const EXTENSIONS$6 = "extensions";
- interface IExtensions {
- /**
- * List of extensions
- */
- extensions: Extension[];
- }
- type ExtensionsParameters = PkiObjectParameters & Partial<IExtensions>;
- type ExtensionsSchema = SchemaParameters<{
- extensions?: string;
- extension?: ExtensionSchema;
- }>;
- interface ExtensionsJson {
- extensions: ExtensionJson[];
- }
- /**
- * Represents the Extensions structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class Extensions extends PkiObject implements IExtensions {
- static CLASS_NAME: string;
- extensions: Extension[];
- /**
- * Initializes a new instance of the {@link Extensions} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ExtensionsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof EXTENSIONS$6): Extension[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
- * ```
- *
- * @param parameters Input parameters for the schema
- * @param optional Flag that current schema should be optional
- * @returns ASN.1 schema object
- */
- static schema(parameters?: ExtensionsSchema, optional?: boolean): asn1js.Sequence;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ExtensionsJson;
- }
- declare const ISSUER$5 = "issuer";
- declare const SERIAL_NUMBER$6 = "serialNumber";
- declare const ISSUER_UID = "issuerUID";
- interface IIssuerSerial {
- /**
- * Issuer name
- */
- issuer: GeneralNames;
- /**
- * Serial number
- */
- serialNumber: asn1js.Integer;
- /**
- * Issuer unique identifier
- */
- issuerUID?: asn1js.BitString;
- }
- type IssuerSerialParameters = PkiObjectParameters & Partial<IIssuerSerial>;
- interface IssuerSerialJson {
- issuer: GeneralNamesJson;
- serialNumber: asn1js.IntegerJson;
- issuerUID?: asn1js.BitStringJson;
- }
- /**
- * Represents the IssuerSerial structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class IssuerSerial extends PkiObject implements IIssuerSerial {
- static CLASS_NAME: string;
- issuer: GeneralNames;
- serialNumber: asn1js.Integer;
- issuerUID?: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link IssuerSerial} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: IssuerSerialParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ISSUER$5): GeneralNames;
- static defaultValues(memberName: typeof SERIAL_NUMBER$6): asn1js.Integer;
- static defaultValues(memberName: typeof ISSUER_UID): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * IssuerSerial ::= SEQUENCE {
- * issuer GeneralNames,
- * serial CertificateSerialNumber,
- * issuerUID UniqueIdentifier OPTIONAL
- * }
- *
- * CertificateSerialNumber ::= INTEGER
- * UniqueIdentifier ::= BIT STRING
- *```
- */
- static schema(parameters?: SchemaParameters<{
- issuer?: GeneralNamesSchema;
- serialNumber?: string;
- issuerUID?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): IssuerSerialJson;
- }
- declare const VERSION$k = "version";
- declare const BASE_CERTIFICATE_ID$2 = "baseCertificateID";
- declare const SUBJECT_NAME = "subjectName";
- declare const ISSUER$4 = "issuer";
- declare const SIGNATURE$7 = "signature";
- declare const SERIAL_NUMBER$5 = "serialNumber";
- declare const ATTR_CERT_VALIDITY_PERIOD$1 = "attrCertValidityPeriod";
- declare const ATTRIBUTES$4 = "attributes";
- declare const ISSUER_UNIQUE_ID$2 = "issuerUniqueID";
- declare const EXTENSIONS$5 = "extensions";
- interface IAttributeCertificateInfoV1 {
- /**
- * The version field MUST have the value of v2
- */
- version: number;
- baseCertificateID?: IssuerSerial;
- subjectName?: GeneralNames;
- issuer: GeneralNames;
- /**
- * Contains the algorithm identifier used to validate the AC signature
- */
- signature: AlgorithmIdentifier;
- serialNumber: asn1js.Integer;
- /**
- * Specifies the period for which the AC issuer certifies that the binding between
- * the holder and the attributes fields will be valid
- */
- attrCertValidityPeriod: AttCertValidityPeriod;
- /**
- * The attributes field gives information about the AC holder
- */
- attributes: Attribute[];
- /**
- * Issuer unique identifier
- */
- issuerUniqueID?: asn1js.BitString;
- /**
- * The extensions field generally gives information about the AC as opposed
- * to information about the AC holder
- */
- extensions?: Extensions;
- }
- interface AttributeCertificateInfoV1Json {
- version: number;
- baseCertificateID?: IssuerSerialJson;
- subjectName?: GeneralNamesJson;
- issuer: GeneralNamesJson;
- signature: AlgorithmIdentifierJson;
- serialNumber: asn1js.IntegerJson;
- attrCertValidityPeriod: AttCertValidityPeriodJson;
- attributes: AttributeJson[];
- issuerUniqueID: asn1js.BitStringJson;
- extensions: ExtensionsJson;
- }
- type AttributeCertificateInfoV1Parameters = PkiObjectParameters & Partial<IAttributeCertificateInfoV1>;
- type AttributeCertificateInfoV1Schema = SchemaParameters<{
- version?: string;
- baseCertificateID?: string;
- subjectName?: string;
- signature?: AlgorithmIdentifierSchema;
- issuer?: string;
- attrCertValidityPeriod?: AttCertValidityPeriodSchema;
- serialNumber?: string;
- attributes?: string;
- issuerUniqueID?: string;
- extensions?: ExtensionsSchema;
- }>;
- /**
- * Represents the AttributeCertificateInfoV1 structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class AttributeCertificateInfoV1 extends PkiObject implements IAttributeCertificateInfoV1 {
- static CLASS_NAME: string;
- version: number;
- baseCertificateID?: IssuerSerial;
- subjectName?: GeneralNames;
- issuer: GeneralNames;
- signature: AlgorithmIdentifier;
- serialNumber: asn1js.Integer;
- attrCertValidityPeriod: AttCertValidityPeriod;
- attributes: Attribute[];
- issuerUniqueID?: asn1js.BitString;
- extensions?: Extensions;
- /**
- * Initializes a new instance of the {@link AttributeCertificateInfoV1} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttributeCertificateInfoV1Parameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$k): number;
- static defaultValues(memberName: typeof BASE_CERTIFICATE_ID$2): IssuerSerial;
- static defaultValues(memberName: typeof SUBJECT_NAME): GeneralNames;
- static defaultValues(memberName: typeof ISSUER$4): GeneralNames;
- static defaultValues(memberName: typeof SIGNATURE$7): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SERIAL_NUMBER$5): asn1js.Integer;
- static defaultValues(memberName: typeof ATTR_CERT_VALIDITY_PERIOD$1): AttCertValidityPeriod;
- static defaultValues(memberName: typeof ATTRIBUTES$4): Attribute[];
- static defaultValues(memberName: typeof ISSUER_UNIQUE_ID$2): asn1js.BitString;
- static defaultValues(memberName: typeof EXTENSIONS$5): Extensions;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AttributeCertificateInfo ::= SEQUENCE {
- * version Version DEFAULT v1,
- * subject CHOICE {
- * baseCertificateID [0] IssuerSerial, -- associated with a Public Key Certificate
- * subjectName [1] GeneralNames }, -- associated with a name
- * issuer GeneralNames, -- CA issuing the attribute certificate
- * signature AlgorithmIdentifier,
- * serialNumber CertificateSerialNumber,
- * attrCertValidityPeriod AttCertValidityPeriod,
- * attributes SEQUENCE OF Attribute,
- * issuerUniqueID UniqueIdentifier OPTIONAL,
- * extensions Extensions OPTIONAL
- * }
- *```
- */
- static schema(parameters?: AttributeCertificateInfoV1Schema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttributeCertificateInfoV1Json;
- }
- declare const ACINFO$1 = "acinfo";
- declare const SIGNATURE_ALGORITHM$8 = "signatureAlgorithm";
- declare const SIGNATURE_VALUE$4 = "signatureValue";
- interface IAttributeCertificateV1 {
- /**
- * Attribute certificate information
- */
- acinfo: AttributeCertificateInfoV1;
- /**
- * Signature algorithm
- */
- signatureAlgorithm: AlgorithmIdentifier;
- /**
- * Signature value
- */
- signatureValue: asn1js.BitString;
- }
- interface AttributeCertificateV1Json {
- acinfo: AttributeCertificateInfoV1Json;
- signatureAlgorithm: AlgorithmIdentifierJson;
- signatureValue: asn1js.BitStringJson;
- }
- type AttributeCertificateV1Parameters = PkiObjectParameters & Partial<IAttributeCertificateV1>;
- /**
- * Class from X.509:1997
- */
- declare class AttributeCertificateV1 extends PkiObject implements IAttributeCertificateV1 {
- static CLASS_NAME: string;
- acinfo: AttributeCertificateInfoV1;
- signatureAlgorithm: AlgorithmIdentifier;
- signatureValue: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link AttributeCertificateV1} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttributeCertificateV1Parameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ACINFO$1): AttributeCertificateInfoV1;
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$8): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE_VALUE$4): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AttributeCertificate ::= SEQUENCE {
- * acinfo AttributeCertificateInfoV1,
- * signatureAlgorithm AlgorithmIdentifier,
- * signatureValue BIT STRING
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- acinfo?: AttributeCertificateInfoV1Schema;
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signatureValue?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttributeCertificateV1Json;
- }
- declare const DIGESTED_OBJECT_TYPE = "digestedObjectType";
- declare const OTHER_OBJECT_TYPE_ID = "otherObjectTypeID";
- declare const DIGEST_ALGORITHM$2 = "digestAlgorithm";
- declare const OBJECT_DIGEST = "objectDigest";
- interface IObjectDigestInfo {
- digestedObjectType: asn1js.Enumerated;
- otherObjectTypeID?: asn1js.ObjectIdentifier;
- digestAlgorithm: AlgorithmIdentifier;
- objectDigest: asn1js.BitString;
- }
- type ObjectDigestInfoParameters = PkiObjectParameters & Partial<IObjectDigestInfo>;
- interface ObjectDigestInfoJson {
- digestedObjectType: asn1js.EnumeratedJson;
- otherObjectTypeID?: asn1js.ObjectIdentifierJson;
- digestAlgorithm: AlgorithmIdentifierJson;
- objectDigest: asn1js.BitStringJson;
- }
- /**
- * Represents the ObjectDigestInfo structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class ObjectDigestInfo extends PkiObject implements IObjectDigestInfo {
- static CLASS_NAME: string;
- digestedObjectType: asn1js.Enumerated;
- otherObjectTypeID?: asn1js.ObjectIdentifier;
- digestAlgorithm: AlgorithmIdentifier;
- objectDigest: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link ObjectDigestInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ObjectDigestInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof DIGESTED_OBJECT_TYPE): asn1js.Enumerated;
- static defaultValues(memberName: typeof OTHER_OBJECT_TYPE_ID): asn1js.ObjectIdentifier;
- static defaultValues(memberName: typeof DIGEST_ALGORITHM$2): AlgorithmIdentifier;
- static defaultValues(memberName: typeof OBJECT_DIGEST): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ObjectDigestInfo ::= SEQUENCE {
- * digestedObjectType ENUMERATED {
- * publicKey (0),
- * publicKeyCert (1),
- * otherObjectTypes (2) },
- * -- otherObjectTypes MUST NOT
- * -- be used in this profile
- * otherObjectTypeID OBJECT IDENTIFIER OPTIONAL,
- * digestAlgorithm AlgorithmIdentifier,
- * objectDigest BIT STRING
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- digestedObjectType?: string;
- otherObjectTypeID?: string;
- digestAlgorithm?: AlgorithmIdentifierSchema;
- objectDigest?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ObjectDigestInfoJson;
- }
- declare const ISSUER_NAME = "issuerName";
- declare const BASE_CERTIFICATE_ID$1 = "baseCertificateID";
- declare const OBJECT_DIGEST_INFO$1 = "objectDigestInfo";
- interface IV2Form {
- issuerName?: GeneralNames;
- baseCertificateID?: IssuerSerial;
- objectDigestInfo?: ObjectDigestInfo;
- }
- type V2FormParameters = PkiObjectParameters & Partial<IV2Form>;
- interface V2FormJson {
- issuerName?: GeneralNamesJson;
- baseCertificateID?: IssuerSerialJson;
- objectDigestInfo?: ObjectDigestInfoJson;
- }
- /**
- * Represents the V2Form structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class V2Form extends PkiObject implements IV2Form {
- static CLASS_NAME: string;
- issuerName?: GeneralNames;
- baseCertificateID?: IssuerSerial;
- objectDigestInfo?: ObjectDigestInfo;
- /**
- * Initializes a new instance of the {@link V2Form} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: V2FormParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ISSUER_NAME): GeneralNames;
- static defaultValues(memberName: typeof BASE_CERTIFICATE_ID$1): IssuerSerial;
- static defaultValues(memberName: typeof OBJECT_DIGEST_INFO$1): ObjectDigestInfo;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * V2Form ::= SEQUENCE {
- * issuerName GeneralNames OPTIONAL,
- * baseCertificateID [0] IssuerSerial OPTIONAL,
- * objectDigestInfo [1] ObjectDigestInfo OPTIONAL
- * -- issuerName MUST be present in this profile
- * -- baseCertificateID and objectDigestInfo MUST NOT
- * -- be present in this profile
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- issuerName?: string;
- baseCertificateID?: string;
- objectDigestInfo?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): V2FormJson;
- }
- declare const BASE_CERTIFICATE_ID = "baseCertificateID";
- declare const ENTITY_NAME = "entityName";
- declare const OBJECT_DIGEST_INFO = "objectDigestInfo";
- interface IHolder {
- baseCertificateID?: IssuerSerial;
- entityName?: GeneralNames;
- objectDigestInfo?: ObjectDigestInfo;
- }
- type HolderParameters = PkiObjectParameters & Partial<IHolder>;
- type HolderSchema = SchemaParameters<{
- baseCertificateID?: string;
- entityName?: string;
- objectDigestInfo?: string;
- }>;
- interface HolderJson {
- baseCertificateID?: IssuerSerialJson;
- entityName?: GeneralNamesJson;
- objectDigestInfo?: ObjectDigestInfoJson;
- }
- /**
- * Represents the Holder structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class Holder extends PkiObject implements IHolder {
- static CLASS_NAME: string;
- baseCertificateID?: IssuerSerial;
- entityName?: GeneralNames;
- objectDigestInfo?: ObjectDigestInfo;
- /**
- * Initializes a new instance of the {@link AttributeCertificateInfoV1} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: HolderParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof BASE_CERTIFICATE_ID): IssuerSerial;
- static defaultValues(memberName: typeof ENTITY_NAME): GeneralNames;
- static defaultValues(memberName: typeof OBJECT_DIGEST_INFO): ObjectDigestInfo;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Holder ::= SEQUENCE {
- * baseCertificateID [0] IssuerSerial OPTIONAL,
- * -- the issuer and serial number of
- * -- the holder's Public Key Certificate
- * entityName [1] GeneralNames OPTIONAL,
- * -- the name of the claimant or role
- * objectDigestInfo [2] ObjectDigestInfo OPTIONAL
- * -- used to directly authenticate the holder,
- * -- for example, an executable
- * }
- *```
- */
- static schema(parameters?: HolderSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): HolderJson;
- }
- declare const VERSION$j = "version";
- declare const HOLDER = "holder";
- declare const ISSUER$3 = "issuer";
- declare const SIGNATURE$6 = "signature";
- declare const SERIAL_NUMBER$4 = "serialNumber";
- declare const ATTR_CERT_VALIDITY_PERIOD = "attrCertValidityPeriod";
- declare const ATTRIBUTES$3 = "attributes";
- declare const ISSUER_UNIQUE_ID$1 = "issuerUniqueID";
- declare const EXTENSIONS$4 = "extensions";
- interface IAttributeCertificateInfoV2 {
- version: number;
- holder: Holder;
- issuer: GeneralNames | V2Form;
- signature: AlgorithmIdentifier;
- serialNumber: asn1js.Integer;
- attrCertValidityPeriod: AttCertValidityPeriod;
- attributes: Attribute[];
- issuerUniqueID?: asn1js.BitString;
- extensions?: Extensions;
- }
- type AttributeCertificateInfoV2Parameters = PkiObjectParameters & Partial<AttributeCertificateInfoV2>;
- type AttributeCertificateInfoV2Schema = SchemaParameters<{
- version?: string;
- holder?: HolderSchema;
- issuer?: string;
- signature?: AlgorithmIdentifierSchema;
- serialNumber?: string;
- attrCertValidityPeriod?: AttCertValidityPeriodSchema;
- attributes?: string;
- issuerUniqueID?: string;
- extensions?: ExtensionsSchema;
- }>;
- interface AttributeCertificateInfoV2Json {
- version: number;
- holder: HolderJson;
- issuer: GeneralNamesJson | V2FormJson;
- signature: AlgorithmIdentifierJson;
- serialNumber: asn1js.IntegerJson;
- attrCertValidityPeriod: AttCertValidityPeriodJson;
- attributes: AttributeJson[];
- issuerUniqueID?: asn1js.BitStringJson;
- extensions?: ExtensionsJson;
- }
- /**
- * Represents the AttributeCertificateInfoV2 structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class AttributeCertificateInfoV2 extends PkiObject implements IAttributeCertificateInfoV2 {
- static CLASS_NAME: string;
- version: number;
- holder: Holder;
- issuer: GeneralNames | V2Form;
- signature: AlgorithmIdentifier;
- serialNumber: asn1js.Integer;
- attrCertValidityPeriod: AttCertValidityPeriod;
- attributes: Attribute[];
- issuerUniqueID?: asn1js.BitString;
- extensions?: Extensions;
- /**
- * Initializes a new instance of the {@link AttributeCertificateInfoV2} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttributeCertificateInfoV2Parameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$j): number;
- static defaultValues(memberName: typeof HOLDER): Holder;
- static defaultValues(memberName: typeof ISSUER$3): GeneralNames | V2Form;
- static defaultValues(memberName: typeof SIGNATURE$6): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SERIAL_NUMBER$4): asn1js.Integer;
- static defaultValues(memberName: typeof ATTR_CERT_VALIDITY_PERIOD): AttCertValidityPeriod;
- static defaultValues(memberName: typeof ATTRIBUTES$3): Attribute[];
- static defaultValues(memberName: typeof ISSUER_UNIQUE_ID$1): asn1js.BitString;
- static defaultValues(memberName: typeof EXTENSIONS$4): Extensions;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AttributeCertificateInfoV2 ::= SEQUENCE {
- * version AttCertVersion, -- version is v2
- * holder Holder,
- * issuer AttCertIssuer,
- * signature AlgorithmIdentifier,
- * serialNumber CertificateSerialNumber,
- * attrCertValidityPeriod AttCertValidityPeriod,
- * attributes SEQUENCE OF Attribute,
- * issuerUniqueID UniqueIdentifier OPTIONAL,
- * extensions Extensions OPTIONAL
- * }
- *```
- */
- static schema(parameters?: AttributeCertificateInfoV2Schema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttributeCertificateInfoV2Json;
- }
- declare const ACINFO = "acinfo";
- declare const SIGNATURE_ALGORITHM$7 = "signatureAlgorithm";
- declare const SIGNATURE_VALUE$3 = "signatureValue";
- interface IAttributeCertificateV2 {
- /**
- * Attribute certificate information
- */
- acinfo: AttributeCertificateInfoV2;
- /**
- * Signature algorithm
- */
- signatureAlgorithm: AlgorithmIdentifier;
- /**
- * Signature value
- */
- signatureValue: asn1js.BitString;
- }
- type AttributeCertificateV2Parameters = PkiObjectParameters & Partial<IAttributeCertificateV2>;
- interface AttributeCertificateV2Json {
- acinfo: AttributeCertificateInfoV2Json;
- signatureAlgorithm: AlgorithmIdentifierJson;
- signatureValue: asn1js.BitStringJson;
- }
- /**
- * Represents the AttributeCertificateV2 structure described in [RFC5755](https://datatracker.ietf.org/doc/html/rfc5755)
- */
- declare class AttributeCertificateV2 extends PkiObject implements IAttributeCertificateV2 {
- static CLASS_NAME: string;
- acinfo: AttributeCertificateInfoV2;
- signatureAlgorithm: AlgorithmIdentifier;
- signatureValue: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link AttributeCertificateV2} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttributeCertificateV2Parameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ACINFO): AttributeCertificateInfoV2;
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$7): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE_VALUE$3): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AttributeCertificate ::= SEQUENCE {
- * acinfo AttributeCertificateInfoV2,
- * signatureAlgorithm AlgorithmIdentifier,
- * signatureValue BIT STRING
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- acinfo?: AttributeCertificateInfoV2Schema;
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signatureValue?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttributeCertificateV2Json;
- }
- declare const TYPE$3 = "type";
- declare const VALUE$5 = "value";
- interface IAttributeTypeAndValue {
- type: string;
- value: AttributeValueType;
- }
- type AttributeTypeAndValueParameters = PkiObjectParameters & Partial<IAttributeTypeAndValue>;
- type AttributeValueType = asn1js.Utf8String | asn1js.BmpString | asn1js.UniversalString | asn1js.NumericString | asn1js.PrintableString | asn1js.TeletexString | asn1js.VideotexString | asn1js.IA5String | asn1js.GraphicString | asn1js.VisibleString | asn1js.GeneralString | asn1js.CharacterString;
- interface AttributeTypeAndValueJson {
- type: string;
- value: any;
- }
- /**
- * Represents the AttributeTypeAndValue structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class AttributeTypeAndValue extends PkiObject implements IAttributeTypeAndValue {
- static CLASS_NAME: string;
- type: string;
- value: AttributeValueType;
- /**
- * Initializes a new instance of the {@link AttributeTypeAndValue} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AttributeTypeAndValueParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TYPE$3): string;
- static defaultValues(memberName: typeof VALUE$5): AttributeValueType;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AttributeTypeAndValue ::= Sequence {
- * type AttributeType,
- * value AttributeValue }
- *
- * AttributeType ::= OBJECT IDENTIFIER
- *
- * AttributeValue ::= ANY -- DEFINED BY AttributeType
- *```
- */
- static schema(parameters?: SchemaParameters<{
- type?: string;
- value?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AttributeTypeAndValueJson;
- /**
- * Compares two AttributeTypeAndValue values, or AttributeTypeAndValue with ArrayBuffer value
- * @param compareTo The value compare to current
- */
- isEqual(compareTo: AttributeTypeAndValue | ArrayBuffer): boolean;
- }
- declare const CONTENT_TYPE$1 = "contentType";
- declare const CONTENT = "content";
- interface IContentInfo {
- contentType: string;
- content: any;
- }
- type ContentInfoParameters = PkiObjectParameters & Partial<IContentInfo>;
- type ContentInfoSchema = SchemaParameters<{
- contentType?: string;
- content?: string;
- }>;
- interface ContentInfoJson {
- contentType: string;
- content?: any;
- }
- /**
- * Represents the ContentInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class ContentInfo extends PkiObject implements IContentInfo {
- static CLASS_NAME: string;
- static readonly DATA = "1.2.840.113549.1.7.1";
- static readonly SIGNED_DATA = "1.2.840.113549.1.7.2";
- static readonly ENVELOPED_DATA = "1.2.840.113549.1.7.3";
- static readonly ENCRYPTED_DATA = "1.2.840.113549.1.7.6";
- contentType: string;
- content: any;
- /**
- * Initializes a new instance of the {@link ContentInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ContentInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CONTENT_TYPE$1): string;
- static defaultValues(memberName: typeof CONTENT): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault<T>(memberName: string, memberValue: T): memberValue is T;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ContentInfo ::= SEQUENCE {
- * contentType ContentType,
- * content [0] EXPLICIT ANY DEFINED BY contentType }
- *```
- */
- static schema(parameters?: ContentInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ContentInfoJson;
- }
- declare const CONTENT_TYPE = "contentType";
- declare const CONTENT_ENCRYPTION_ALGORITHM = "contentEncryptionAlgorithm";
- declare const ENCRYPTED_CONTENT = "encryptedContent";
- interface IEncryptedContentInfo {
- contentType: string;
- contentEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedContent?: asn1js.OctetString;
- }
- interface EncryptedContentInfoJson {
- contentType: string;
- contentEncryptionAlgorithm: AlgorithmIdentifierJson;
- encryptedContent?: asn1js.OctetStringJson;
- }
- interface EncryptedContentInfoSplit {
- /**
- * Disables OctetString splitting for encryptedContent.
- */
- disableSplit?: boolean;
- }
- type EncryptedContentParameters = PkiObjectParameters & Partial<IEncryptedContentInfo> & EncryptedContentInfoSplit;
- type EncryptedContentInfoSchema = SchemaParameters<{
- contentType?: string;
- contentEncryptionAlgorithm?: AlgorithmIdentifierSchema;
- encryptedContent?: string;
- }>;
- /**
- * Represents the EncryptedContentInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class EncryptedContentInfo extends PkiObject implements IEncryptedContentInfo {
- static CLASS_NAME: string;
- contentType: string;
- contentEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedContent?: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link EncryptedContentInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: EncryptedContentParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CONTENT_TYPE): string;
- static defaultValues(memberName: typeof CONTENT_ENCRYPTION_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENCRYPTED_CONTENT): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * EncryptedContentInfo ::= SEQUENCE {
- * contentType ContentType,
- * contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
- * encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL }
- *
- * Comment: Strange, but modern crypto engines create ENCRYPTED_CONTENT as "[0] EXPLICIT EncryptedContent"
- *
- * EncryptedContent ::= OCTET STRING
- *```
- */
- static schema(parameters?: EncryptedContentInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): EncryptedContentInfoJson;
- /**
- * Returns concatenated buffer from `encryptedContent` field.
- * @returns Array buffer
- * @since 3.0.0
- * @throws Throws Error if `encryptedContent` is undefined
- */
- getEncryptedContent(): ArrayBuffer;
- }
- declare const X = "x";
- declare const Y = "y";
- declare const NAMED_CURVE$1 = "namedCurve";
- interface IECPublicKey {
- namedCurve: string;
- x: ArrayBuffer;
- y: ArrayBuffer;
- }
- interface ECPublicKeyJson {
- crv: string;
- x: string;
- y: string;
- }
- type ECPublicKeyParameters = PkiObjectParameters & Partial<IECPublicKey> & {
- json?: ECPublicKeyJson;
- };
- /**
- * Represents the PrivateKeyInfo structure described in [RFC5480](https://datatracker.ietf.org/doc/html/rfc5480)
- */
- declare class ECPublicKey extends PkiObject implements IECPublicKey {
- static CLASS_NAME: string;
- namedCurve: string;
- x: ArrayBuffer;
- y: ArrayBuffer;
- /**
- * Initializes a new instance of the {@link ECPublicKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ECPublicKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof NAMED_CURVE$1): string;
- static defaultValues(memberName: typeof X | typeof Y): ArrayBuffer;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault<T>(memberName: string, memberValue: T): memberValue is T;
- /**
- * Returns value of pre-defined ASN.1 schema for current class
- * @param parameters Input parameters for the schema
- * @returns ASN.1 schema object
- */
- static schema(): SchemaType;
- fromSchema(schema1: BufferSource): any;
- toSchema(): asn1js.RawData;
- toJSON(): ECPublicKeyJson;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: any): void;
- }
- interface IRSAPublicKey {
- /**
- * Modulus part of RSA public key
- */
- modulus: asn1js.Integer;
- /**
- * Public exponent of RSA public key
- */
- publicExponent: asn1js.Integer;
- }
- interface RSAPublicKeyJson {
- n: string;
- e: string;
- }
- type RSAPublicKeyParameters = PkiObjectParameters & Partial<IRSAPublicKey> & {
- json?: RSAPublicKeyJson;
- };
- declare const MODULUS$1 = "modulus";
- declare const PUBLIC_EXPONENT$1 = "publicExponent";
- /**
- * Represents the RSAPublicKey structure described in [RFC3447](https://datatracker.ietf.org/doc/html/rfc3447)
- */
- declare class RSAPublicKey extends PkiObject implements IRSAPublicKey {
- static CLASS_NAME: string;
- modulus: asn1js.Integer;
- publicExponent: asn1js.Integer;
- /**
- * Initializes a new instance of the {@link RSAPublicKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RSAPublicKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof MODULUS$1 | typeof PUBLIC_EXPONENT$1): asn1js.Integer;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RSAPublicKey ::= Sequence {
- * modulus Integer, -- n
- * publicExponent Integer -- e
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- modulus?: string;
- publicExponent?: string;
- }>): SchemaType;
- fromSchema(schema: asn1js.AsnType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RSAPublicKeyJson;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: RSAPublicKeyJson): void;
- }
- declare const ALGORITHM$1 = "algorithm";
- declare const SUBJECT_PUBLIC_KEY = "subjectPublicKey";
- interface IPublicKeyInfo {
- /**
- * Algorithm identifier
- */
- algorithm: AlgorithmIdentifier;
- /**
- * Subject public key value
- */
- subjectPublicKey: asn1js.BitString;
- /**
- * Parsed public key value
- */
- parsedKey?: ECPublicKey | RSAPublicKey | undefined;
- }
- type PublicKeyInfoParameters = PkiObjectParameters & Partial<IPublicKeyInfo> & {
- json?: JsonWebKey;
- };
- interface PublicKeyInfoJson {
- algorithm: AlgorithmIdentifierJson;
- subjectPublicKey: asn1js.BitStringJson;
- }
- type PublicKeyInfoSchema = SchemaParameters<{
- algorithm?: AlgorithmIdentifierSchema;
- subjectPublicKey?: string;
- }>;
- /**
- * Represents the PublicKeyInfo structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PublicKeyInfo extends PkiObject implements IPublicKeyInfo {
- static CLASS_NAME: string;
- algorithm: AlgorithmIdentifier;
- subjectPublicKey: asn1js.BitString;
- private _parsedKey?;
- get parsedKey(): ECPublicKey | RSAPublicKey | undefined;
- set parsedKey(value: ECPublicKey | RSAPublicKey | undefined);
- /**
- * Initializes a new instance of the {@link PublicKeyInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PublicKeyInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ALGORITHM$1): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SUBJECT_PUBLIC_KEY): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SubjectPublicKeyInfo ::= Sequence {
- * algorithm AlgorithmIdentifier,
- * subjectPublicKey BIT STRING }
- *```
- */
- static schema(parameters?: PublicKeyInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PublicKeyInfoJson | JsonWebKey;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: any): void;
- importKey(publicKey: CryptoKey, crypto?: ICryptoEngine): Promise<void>;
- }
- type CryptoEngineAlgorithmOperation = "sign" | "encrypt" | "generateKey" | "importKey" | "exportKey" | "verify";
- /**
- * Algorithm parameters
- */
- interface CryptoEngineAlgorithmParams {
- /**
- * Algorithm
- */
- algorithm: Algorithm | object;
- /**
- * Key usages
- */
- usages: KeyUsage[];
- }
- interface CryptoEngineSignatureParams {
- signatureAlgorithm: AlgorithmIdentifier;
- parameters: CryptoEngineAlgorithmParams;
- }
- interface CryptoEngineSignWithPrivateKeyParams {
- algorithm: Algorithm;
- }
- /**
- * Public key parameters
- */
- interface CryptoEnginePublicKeyParams {
- /**
- * Algorithm
- */
- algorithm: CryptoEngineAlgorithmParams;
- }
- type ContentEncryptionAesCbcParams = AesCbcParams & AesDerivedKeyParams;
- type ContentEncryptionAesGcmParams = AesGcmParams & AesDerivedKeyParams;
- type ContentEncryptionAlgorithm = ContentEncryptionAesCbcParams | ContentEncryptionAesGcmParams;
- interface CryptoEngineEncryptParams {
- password: ArrayBuffer;
- contentEncryptionAlgorithm: ContentEncryptionAlgorithm;
- hmacHashAlgorithm: string;
- iterationCount: number;
- contentToEncrypt: ArrayBuffer;
- contentType: string;
- }
- interface CryptoEngineDecryptParams {
- password: ArrayBuffer;
- encryptedContentInfo: EncryptedContentInfo;
- }
- interface CryptoEngineStampDataWithPasswordParams {
- password: ArrayBuffer;
- hashAlgorithm: string;
- salt: ArrayBuffer;
- iterationCount: number;
- contentToStamp: ArrayBuffer;
- }
- interface CryptoEngineVerifyDataStampedWithPasswordParams {
- password: ArrayBuffer;
- hashAlgorithm: string;
- salt: ArrayBuffer;
- iterationCount: number;
- contentToVerify: ArrayBuffer;
- signatureToVerify: ArrayBuffer;
- }
- interface ICryptoEngine extends SubtleCrypto {
- name: string;
- crypto: Crypto;
- subtle: SubtleCrypto;
- getRandomValues<T extends ArrayBufferView | null>(array: T): T;
- /**
- * Get OID for each specific algorithm
- * @param algorithm WebCrypto Algorithm
- * @param safety If `true` throws exception on unknown algorithm. Default is `false`
- * @param target Name of the target
- * @throws Throws {@link Error} exception if unknown WebCrypto algorithm
- */
- getOIDByAlgorithm(algorithm: Algorithm, safety?: boolean, target?: string): string;
- /**
- * Get default algorithm parameters for each kind of operation
- * @param algorithmName Algorithm name to get common parameters for
- * @param operation Kind of operation: "sign", "encrypt", "generateKey", "importKey", "exportKey", "verify"
- */
- getAlgorithmParameters(algorithmName: string, operation: CryptoEngineAlgorithmOperation): CryptoEngineAlgorithmParams;
- /**
- * Gets WebCrypto algorithm by wel-known OID
- * @param oid algorithm identifier
- * @param safety if `true` throws exception on unknown algorithm identifier
- * @param target name of the target
- * @returns Returns WebCrypto algorithm or an empty object
- */
- getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety?: boolean, target?: string): T | object;
- /**
- * Gets WebCrypto algorithm by wel-known OID
- * @param oid algorithm identifier
- * @param safety if `true` throws exception on unknown algorithm identifier
- * @param target name of the target
- * @returns Returns WebCrypto algorithm
- * @throws Throws {@link Error} exception if unknown algorithm identifier
- */
- getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety: true, target?: string): T;
- /**
- * Getting hash algorithm by signature algorithm
- * @param signatureAlgorithm Signature algorithm
- */
- getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string;
- /**
- * Get signature parameters by analyzing private key algorithm
- * @param privateKey The private key user would like to use
- * @param hashAlgorithm Hash algorithm user would like to use. Default is SHA-1
- */
- getSignatureParameters(privateKey: CryptoKey, hashAlgorithm?: string): Promise<CryptoEngineSignatureParams>;
- /**
- * Sign data with pre-defined private key
- * @param data Data to be signed
- * @param privateKey Private key to use
- * @param parameters Parameters for used algorithm
- */
- signWithPrivateKey(data: BufferSource, privateKey: CryptoKey, parameters: CryptoEngineSignWithPrivateKeyParams): Promise<ArrayBuffer>;
- /**
- * Verify data with the public key
- * @param data Data to be verified
- * @param signature Signature value
- * @param publicKeyInfo Public key information
- * @param signatureAlgorithm Signature algorithm
- * @param shaAlgorithm Hash algorithm
- */
- verifyWithPublicKey(data: BufferSource, signature: asn1js.BitString | asn1js.OctetString, publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier, shaAlgorithm?: string): Promise<boolean>;
- getPublicKey(publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier, parameters?: CryptoEnginePublicKeyParams): Promise<CryptoKey>;
- /**
- * Specialized function encrypting "EncryptedContentInfo" object using parameters
- * @param parameters
- */
- encryptEncryptedContentInfo(parameters: CryptoEngineEncryptParams): Promise<EncryptedContentInfo>;
- /**
- * Decrypt data stored in "EncryptedContentInfo" object using parameters
- * @param parameters
- */
- decryptEncryptedContentInfo(parameters: CryptoEngineDecryptParams): Promise<ArrayBuffer>;
- /**
- * Stamping (signing) data using algorithm similar to HMAC
- * @param parameters
- */
- stampDataWithPassword(parameters: CryptoEngineStampDataWithPasswordParams): Promise<ArrayBuffer>;
- verifyDataStampedWithPassword(parameters: CryptoEngineVerifyDataStampedWithPasswordParams): Promise<boolean>;
- }
- interface CryptoEngineParameters {
- name?: string;
- crypto: Crypto;
- /**
- * @deprecated
- */
- subtle?: SubtleCrypto;
- }
- interface CryptoEngineConstructor {
- new (params: CryptoEngineParameters): ICryptoEngine;
- }
- interface GlobalCryptoEngine {
- name: string;
- crypto: ICryptoEngine | null;
- }
- declare let engine: GlobalCryptoEngine;
- /**
- * Sets global crypto engine
- * @param name Name of the crypto engine
- * @param crypto
- * @param subtle
- * @deprecated Since version 3.0.0
- */
- declare function setEngine(name: string, crypto: ICryptoEngine | Crypto, subtle: ICryptoEngine | SubtleCrypto): void;
- /**
- * Sets global crypto engine
- * @param name Name of the crypto engine
- * @param crypto Crypto engine. If the parameter is omitted, `CryptoEngine` with `self.crypto` are used
- * @since 3.0.0
- */
- declare function setEngine(name: string, crypto?: ICryptoEngine): void;
- declare function getEngine(): GlobalCryptoEngine;
- /**
- * Gets crypto subtle from the current "crypto engine"
- * @param safety
- * @returns Reruns {@link ICryptoEngine} or `null`
- */
- declare function getCrypto(safety?: boolean): ICryptoEngine | null;
- /**
- * Gets crypto subtle from the current "crypto engine"
- * @param safety
- * @returns Reruns {@link ICryptoEngine} or throws en exception
- * @throws Throws {@link Error} if `subtle` is empty
- */
- declare function getCrypto(safety: true): ICryptoEngine;
- /**
- * Initialize input Uint8Array by random values (with help from current "crypto engine")
- * @param view
- */
- declare function getRandomValues(view: Uint8Array): Uint8Array<ArrayBufferLike>;
- /**
- * Get OID for each specific algorithm
- * @param algorithm WebCrypto Algorithm
- * @param safety if `true` throws exception on unknown algorithm
- * @param target name of the target
- * @throws Throws {@link Error} exception if unknown WebCrypto algorithm
- */
- declare function getOIDByAlgorithm(algorithm: Algorithm, safety?: boolean, target?: string): string;
- /**
- * Get default algorithm parameters for each kind of operation
- * @param algorithmName Algorithm name to get common parameters for
- * @param operation Kind of operation: "sign", "encrypt", "generateKey", "importKey", "exportKey", "verify"
- */
- declare function getAlgorithmParameters(algorithmName: string, operation: CryptoEngineAlgorithmOperation): CryptoEngineAlgorithmParams;
- /**
- * Create CMS ECDSA signature from WebCrypto ECDSA signature
- * @param signatureBuffer WebCrypto result of "sign" function
- */
- declare function createCMSECDSASignature(signatureBuffer: ArrayBuffer): ArrayBuffer;
- /**
- * Create a single ArrayBuffer from CMS ECDSA signature
- * @param cmsSignature ASN.1 SEQUENCE contains CMS ECDSA signature
- * @param pointSize Size of EC point. Use {@link ECNamedCurves.find} to get correct point size
- * @returns WebCrypto signature
- */
- declare function createECDSASignatureFromCMS(cmsSignature: asn1js.AsnType, pointSize: number): ArrayBuffer;
- /**
- * Gets WebCrypto algorithm by well-known OID
- * @param oid algorithm identifier
- * @param safety if true throws exception on unknown algorithm identifier
- * @param target name of the target
- * @returns WebCrypto algorithm or an empty object
- */
- declare function getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety?: boolean, target?: string): T | object;
- declare function getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety: true, target?: string): T;
- /**
- * Getting hash algorithm by signature algorithm
- * @param signatureAlgorithm Signature algorithm
- */
- declare function getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string;
- /**
- * ANS X9.63 Key Derivation Function
- * @param hashFunction Used hash function
- * @param Zbuffer ArrayBuffer containing ECDH shared secret to derive from
- * @param keydatalen Length (!!! in BITS !!!) of used kew derivation function
- * @param SharedInfo Usually DER encoded "ECC_CMS_SharedInfo" structure
- * @param crypto Crypto engine
- */
- declare function kdf(hashFunction: string, Zbuffer: ArrayBuffer, keydatalen: number, SharedInfo: ArrayBuffer, crypto?: ICryptoEngine): Promise<ArrayBuffer>;
- declare const TYPE_AND_VALUES = "typesAndValues";
- declare const VALUE_BEFORE_DECODE = "valueBeforeDecode";
- declare const RDN = "RDN";
- interface IRelativeDistinguishedNames {
- /**
- * Array of "type and value" objects
- */
- typesAndValues: AttributeTypeAndValue[];
- /**
- * Value of the RDN before decoding from schema
- */
- valueBeforeDecode: ArrayBuffer;
- }
- type RelativeDistinguishedNamesParameters = PkiObjectParameters & Partial<IRelativeDistinguishedNames>;
- type RelativeDistinguishedNamesSchema = SchemaParameters<{
- repeatedSequence?: string;
- repeatedSet?: string;
- typeAndValue?: SchemaType;
- }>;
- interface RelativeDistinguishedNamesJson {
- typesAndValues: AttributeTypeAndValueJson[];
- }
- /**
- * Represents the RelativeDistinguishedNames structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class RelativeDistinguishedNames extends PkiObject implements IRelativeDistinguishedNames {
- static CLASS_NAME: string;
- typesAndValues: AttributeTypeAndValue[];
- valueBeforeDecode: ArrayBuffer;
- /**
- * Initializes a new instance of the {@link RelativeDistinguishedNames} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RelativeDistinguishedNamesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TYPE_AND_VALUES): AttributeTypeAndValue[];
- static defaultValues(memberName: typeof VALUE_BEFORE_DECODE): ArrayBuffer;
- /**
- * Compares values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RDNSequence ::= Sequence OF RelativeDistinguishedName
- *
- * RelativeDistinguishedName ::=
- * SET SIZE (1..MAX) OF AttributeTypeAndValue
- *```
- */
- static schema(parameters?: RelativeDistinguishedNamesSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RelativeDistinguishedNamesJson;
- /**
- * Compares two RDN values, or RDN with ArrayBuffer value
- * @param compareTo The value compare to current
- */
- isEqual(compareTo: unknown): boolean;
- }
- declare const TYPE$2 = "type";
- declare const VALUE$4 = "value";
- declare enum TimeType {
- UTCTime = 0,
- GeneralizedTime = 1,
- empty = 2
- }
- interface ITime {
- /**
- * 0 - UTCTime; 1 - GeneralizedTime; 2 - empty value
- */
- type: TimeType;
- /**
- * Value of the TIME class
- */
- value: Date;
- }
- type TimeParameters = PkiObjectParameters & Partial<ITime>;
- type TimeSchema = SchemaParameters<{
- utcTimeName?: string;
- generalTimeName?: string;
- }>;
- interface TimeJson {
- type: TimeType;
- value: Date;
- }
- /**
- * Represents the Time structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class Time extends PkiObject implements ITime {
- static CLASS_NAME: string;
- type: TimeType;
- value: Date;
- /**
- * Initializes a new instance of the {@link Time} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: TimeParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TYPE$2): TimeType;
- static defaultValues(memberName: typeof VALUE$4): Date;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Time ::= CHOICE {
- * utcTime UTCTime,
- * generalTime GeneralizedTime }
- * ```
- *
- * @param parameters Input parameters for the schema
- * @param optional Flag that current schema should be optional
- * @returns ASN.1 schema object
- */
- static schema(parameters?: TimeSchema, optional?: boolean): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.UTCTime | asn1js.GeneralizedTime;
- toJSON(): TimeJson;
- }
- declare const TBS$4 = "tbs";
- declare const VERSION$i = "version";
- declare const SERIAL_NUMBER$3 = "serialNumber";
- declare const SIGNATURE$5 = "signature";
- declare const ISSUER$2 = "issuer";
- declare const NOT_BEFORE$1 = "notBefore";
- declare const NOT_AFTER$1 = "notAfter";
- declare const SUBJECT$1 = "subject";
- declare const SUBJECT_PUBLIC_KEY_INFO = "subjectPublicKeyInfo";
- declare const ISSUER_UNIQUE_ID = "issuerUniqueID";
- declare const SUBJECT_UNIQUE_ID = "subjectUniqueID";
- declare const EXTENSIONS$3 = "extensions";
- declare const SIGNATURE_ALGORITHM$6 = "signatureAlgorithm";
- declare const SIGNATURE_VALUE$2 = "signatureValue";
- type TBSCertificateSchema = SchemaParameters<{
- tbsCertificateVersion?: string;
- tbsCertificateSerialNumber?: string;
- signature?: AlgorithmIdentifierSchema;
- issuer?: RelativeDistinguishedNamesSchema;
- tbsCertificateValidity?: string;
- notBefore?: TimeSchema;
- notAfter?: TimeSchema;
- subject?: RelativeDistinguishedNamesSchema;
- subjectPublicKeyInfo?: PublicKeyInfoSchema;
- tbsCertificateIssuerUniqueID?: string;
- tbsCertificateSubjectUniqueID?: string;
- extensions?: ExtensionsSchema;
- }>;
- interface ICertificate {
- /**
- * ToBeSigned (TBS) part of the certificate
- */
- tbs: ArrayBuffer;
- /**
- * Version number
- */
- version: number;
- /**
- * Serial number of the certificate
- */
- serialNumber: asn1js.Integer;
- /**
- * This field contains the algorithm identifier for the algorithm used by the CA to sign the certificate
- */
- signature: AlgorithmIdentifier;
- /**
- * The issuer field identifies the entity that has signed and issued the certificate
- */
- issuer: RelativeDistinguishedNames;
- /**
- * The date on which the certificate validity period begins
- */
- notBefore: Time;
- /**
- * The date on which the certificate validity period ends
- */
- notAfter: Time;
- /**
- * The subject field identifies the entity associated with the public key stored in the subject public key field
- */
- subject: RelativeDistinguishedNames;
- /**
- * This field is used to carry the public key and identify the algorithm with which the key is used
- */
- subjectPublicKeyInfo: PublicKeyInfo;
- /**
- * The subject and issuer unique identifiers are present in the certificate to handle the possibility of reuse of subject and/or issuer names over time
- */
- issuerUniqueID?: ArrayBuffer;
- /**
- * The subject and issuer unique identifiers are present in the certificate to handle the possibility of reuse of subject and/or issuer names over time
- */
- subjectUniqueID?: ArrayBuffer;
- /**
- * If present, this field is a SEQUENCE of one or more certificate extensions
- */
- extensions?: Extension[];
- /**
- * The signatureAlgorithm field contains the identifier for the cryptographic algorithm used by the CA to sign this certificate
- */
- signatureAlgorithm: AlgorithmIdentifier;
- /**
- * The signatureValue field contains a digital signature computed upon the ASN.1 DER encoded tbsCertificate
- */
- signatureValue: asn1js.BitString;
- }
- /**
- * Constructor parameters for the {@link Certificate} class
- */
- type CertificateParameters = PkiObjectParameters & Partial<ICertificate>;
- /**
- * Parameters for {@link Certificate} schema generation
- */
- type CertificateSchema = SchemaParameters<{
- tbsCertificate?: TBSCertificateSchema;
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signatureValue?: string;
- }>;
- interface CertificateJson {
- tbs: string;
- version: number;
- serialNumber: asn1js.IntegerJson;
- signature: AlgorithmIdentifierJson;
- issuer: RelativeDistinguishedNamesJson;
- notBefore: TimeJson;
- notAfter: TimeJson;
- subject: RelativeDistinguishedNamesJson;
- subjectPublicKeyInfo: PublicKeyInfoJson | JsonWebKey;
- issuerUniqueID?: string;
- subjectUniqueID?: string;
- extensions?: ExtensionJson[];
- signatureAlgorithm: AlgorithmIdentifierJson;
- signatureValue: asn1js.BitStringJson;
- }
- /**
- * Represents an X.509 certificate described in [RFC5280 Section 4](https://datatracker.ietf.org/doc/html/rfc5280#section-4).
- *
- * @example The following example demonstrates how to parse X.509 Certificate
- * ```js
- * const asn1 = asn1js.fromBER(raw);
- * if (asn1.offset === -1) {
- * throw new Error("Incorrect encoded ASN.1 data");
- * }
- *
- * const cert = new pkijs.Certificate({ schema: asn1.result });
- * ```
- *
- * @example The following example demonstrates how to create self-signed certificate
- * ```js
- * const crypto = pkijs.getCrypto(true);
- *
- * // Create certificate
- * const certificate = new pkijs.Certificate();
- * certificate.version = 2;
- * certificate.serialNumber = new asn1js.Integer({ value: 1 });
- * certificate.issuer.typesAndValues.push(new pkijs.AttributeTypeAndValue({
- * type: "2.5.4.3", // Common name
- * value: new asn1js.BmpString({ value: "Test" })
- * }));
- * certificate.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
- * type: "2.5.4.3", // Common name
- * value: new asn1js.BmpString({ value: "Test" })
- * }));
- *
- * certificate.notBefore.value = new Date();
- * const notAfter = new Date();
- * notAfter.setUTCFullYear(notAfter.getUTCFullYear() + 1);
- * certificate.notAfter.value = notAfter;
- *
- * certificate.extensions = []; // Extensions are not a part of certificate by default, it's an optional array
- *
- * // "BasicConstraints" extension
- * const basicConstr = new pkijs.BasicConstraints({
- * cA: true,
- * pathLenConstraint: 3
- * });
- * certificate.extensions.push(new pkijs.Extension({
- * extnID: "2.5.29.19",
- * critical: false,
- * extnValue: basicConstr.toSchema().toBER(false),
- * parsedValue: basicConstr // Parsed value for well-known extensions
- * }));
- *
- * // "KeyUsage" extension
- * const bitArray = new ArrayBuffer(1);
- * const bitView = new Uint8Array(bitArray);
- * bitView[0] |= 0x02; // Key usage "cRLSign" flag
- * bitView[0] |= 0x04; // Key usage "keyCertSign" flag
- * const keyUsage = new asn1js.BitString({ valueHex: bitArray });
- * certificate.extensions.push(new pkijs.Extension({
- * extnID: "2.5.29.15",
- * critical: false,
- * extnValue: keyUsage.toBER(false),
- * parsedValue: keyUsage // Parsed value for well-known extensions
- * }));
- *
- * const algorithm = pkijs.getAlgorithmParameters("RSASSA-PKCS1-v1_5", "generateKey");
- * if ("hash" in algorithm.algorithm) {
- * algorithm.algorithm.hash.name = "SHA-256";
- * }
- *
- * const keys = await crypto.generateKey(algorithm.algorithm, true, algorithm.usages);
- *
- * // Exporting public key into "subjectPublicKeyInfo" value of certificate
- * await certificate.subjectPublicKeyInfo.importKey(keys.publicKey);
- *
- * // Signing final certificate
- * await certificate.sign(keys.privateKey, "SHA-256");
- *
- * const raw = certificate.toSchema().toBER();
- * ```
- */
- declare class Certificate extends PkiObject implements ICertificate {
- static CLASS_NAME: string;
- tbsView: Uint8Array;
- /**
- * @deprecated Since version 3.0.0
- */
- get tbs(): ArrayBuffer;
- /**
- * @deprecated Since version 3.0.0
- */
- set tbs(value: ArrayBuffer);
- version: number;
- serialNumber: asn1js.Integer;
- signature: AlgorithmIdentifier;
- issuer: RelativeDistinguishedNames;
- notBefore: Time;
- notAfter: Time;
- subject: RelativeDistinguishedNames;
- subjectPublicKeyInfo: PublicKeyInfo;
- issuerUniqueID?: ArrayBuffer;
- subjectUniqueID?: ArrayBuffer;
- extensions?: Extension[];
- signatureAlgorithm: AlgorithmIdentifier;
- signatureValue: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link Certificate} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertificateParameters);
- /**
- * Return default values for all class members
- * @param memberName String name for a class member
- * @returns Predefined default value
- */
- static defaultValues(memberName: typeof TBS$4): ArrayBuffer;
- static defaultValues(memberName: typeof VERSION$i): number;
- static defaultValues(memberName: typeof SERIAL_NUMBER$3): asn1js.Integer;
- static defaultValues(memberName: typeof SIGNATURE$5): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ISSUER$2): RelativeDistinguishedNames;
- static defaultValues(memberName: typeof NOT_BEFORE$1): Time;
- static defaultValues(memberName: typeof NOT_AFTER$1): Time;
- static defaultValues(memberName: typeof SUBJECT$1): RelativeDistinguishedNames;
- static defaultValues(memberName: typeof SUBJECT_PUBLIC_KEY_INFO): PublicKeyInfo;
- static defaultValues(memberName: typeof ISSUER_UNIQUE_ID): ArrayBuffer;
- static defaultValues(memberName: typeof SUBJECT_UNIQUE_ID): ArrayBuffer;
- static defaultValues(memberName: typeof EXTENSIONS$3): Extension[];
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$6): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE_VALUE$2): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Certificate ::= SEQUENCE {
- * tbsCertificate TBSCertificate,
- * signatureAlgorithm AlgorithmIdentifier,
- * signatureValue BIT STRING }
- *
- * TBSCertificate ::= SEQUENCE {
- * version [0] EXPLICIT Version DEFAULT v1,
- * serialNumber CertificateSerialNumber,
- * signature AlgorithmIdentifier,
- * issuer Name,
- * validity Validity,
- * subject Name,
- * subjectPublicKeyInfo SubjectPublicKeyInfo,
- * issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL,
- * -- If present, version MUST be v2 or v3
- * subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL,
- * -- If present, version MUST be v2 or v3
- * extensions [3] EXPLICIT Extensions OPTIONAL
- * -- If present, version MUST be v3
- * }
- *
- * Version ::= INTEGER { v1(0), v2(1), v3(2) }
- *
- * CertificateSerialNumber ::= INTEGER
- *
- * Validity ::= SEQUENCE {
- * notBefore Time,
- * notAfter Time }
- *
- * Time ::= CHOICE {
- * utcTime UTCTime,
- * generalTime GeneralizedTime }
- *
- * UniqueIdentifier ::= BIT STRING
- *
- * SubjectPublicKeyInfo ::= SEQUENCE {
- * algorithm AlgorithmIdentifier,
- * subjectPublicKey BIT STRING }
- *
- * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
- *
- * Extension ::= SEQUENCE {
- * extnID OBJECT IDENTIFIER,
- * critical BOOLEAN DEFAULT FALSE,
- * extnValue OCTET STRING
- * -- contains the DER encoding of an ASN.1 value
- * -- corresponding to the extension type identified
- * -- by extnID
- * }
- *```
- */
- static schema(parameters?: CertificateSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- /**
- * Creates ASN.1 schema for existing values of TBS part for the certificate
- * @returns ASN.1 SEQUENCE
- */
- encodeTBS(): asn1js.Sequence;
- toSchema(encodeFlag?: boolean): asn1js.Sequence;
- toJSON(): CertificateJson;
- /**
- * Importing public key for current certificate
- * @param parameters Public key export parameters
- * @param crypto Crypto engine
- * @returns WebCrypto public key
- */
- getPublicKey(parameters?: CryptoEnginePublicKeyParams, crypto?: ICryptoEngine): Promise<CryptoKey>;
- /**
- * Get hash value for subject public key (default SHA-1)
- * @param hashAlgorithm Hashing algorithm name
- * @param crypto Crypto engine
- * @returns Computed hash value from `Certificate.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey`
- */
- getKeyHash(hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<ArrayBuffer>;
- /**
- * Make a signature for current value from TBS section
- * @param privateKey Private key for SUBJECT_PUBLIC_KEY_INFO structure
- * @param hashAlgorithm Hashing algorithm
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Verifies the certificate signature
- * @param issuerCertificate
- * @param crypto Crypto engine
- */
- verify(issuerCertificate?: Certificate, crypto?: ICryptoEngine): Promise<boolean>;
- }
- /**
- * Check CA flag for the certificate
- * @param cert Certificate to find CA flag for
- * @returns Returns {@link Certificate} if `cert` is CA certificate otherwise return `null`
- */
- declare function checkCA(cert: Certificate, signerCert?: Certificate | null): Certificate | null;
- declare const OTHER_CERT_FORMAT = "otherCertFormat";
- declare const OTHER_CERT = "otherCert";
- interface IOtherCertificateFormat {
- otherCertFormat: string;
- otherCert: any;
- }
- interface OtherCertificateFormatJson {
- otherCertFormat: string;
- otherCert?: any;
- }
- type OtherCertificateFormatParameters = PkiObjectParameters & Partial<IOtherCertificateFormat>;
- /**
- * Represents the OtherCertificateFormat structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OtherCertificateFormat extends PkiObject implements IOtherCertificateFormat {
- otherCertFormat: string;
- otherCert: any;
- /**
- * Initializes a new instance of the {@link OtherCertificateFormat} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OtherCertificateFormatParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof OTHER_CERT_FORMAT): string;
- static defaultValues(memberName: typeof OTHER_CERT): asn1js.Any;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OtherCertificateFormat ::= SEQUENCE {
- * otherCertFormat OBJECT IDENTIFIER,
- * otherCert ANY DEFINED BY otherCertFormat }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- otherCertFormat?: string;
- otherCert?: string;
- }>): SchemaType;
- fromSchema(schema: any): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OtherCertificateFormatJson;
- }
- declare const CERTIFICATES$1 = "certificates";
- interface ICertificateSet {
- certificates: CertificateSetItem[];
- }
- interface CertificateSetJson {
- certificates: CertificateSetItemJson[];
- }
- type CertificateSetItemJson = CertificateJson | AttributeCertificateV1Json | AttributeCertificateV2Json | OtherCertificateFormatJson;
- type CertificateSetItem = Certificate | AttributeCertificateV1 | AttributeCertificateV2 | OtherCertificateFormat;
- type CertificateSetParameters = PkiObjectParameters & Partial<ICertificateSet>;
- /**
- * Represents the CertificateSet structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class CertificateSet extends PkiObject implements ICertificateSet {
- static CLASS_NAME: string;
- certificates: CertificateSetItem[];
- /**
- * Initializes a new instance of the {@link CertificateSet} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertificateSetParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CERTIFICATES$1): CertificateSetItem[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CertificateSet ::= SET OF CertificateChoices
- *
- * CertificateChoices ::= CHOICE {
- * certificate Certificate,
- * extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete
- * v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete
- * v2AttrCert [2] IMPLICIT AttributeCertificateV2,
- * other [3] IMPLICIT OtherCertificateFormat }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- certificates?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Set;
- toJSON(): CertificateSetJson;
- }
- declare const USER_CERTIFICATE = "userCertificate";
- declare const REVOCATION_DATE = "revocationDate";
- declare const CRL_ENTRY_EXTENSIONS = "crlEntryExtensions";
- interface IRevokedCertificate {
- userCertificate: asn1js.Integer;
- revocationDate: Time;
- crlEntryExtensions?: Extensions;
- }
- type RevokedCertificateParameters = PkiObjectParameters & Partial<IRevokedCertificate>;
- interface RevokedCertificateJson {
- userCertificate: asn1js.IntegerJson;
- revocationDate: TimeJson;
- crlEntryExtensions?: ExtensionsJson;
- }
- /**
- * Represents the RevokedCertificate structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class RevokedCertificate extends PkiObject implements IRevokedCertificate {
- static CLASS_NAME: string;
- userCertificate: asn1js.Integer;
- revocationDate: Time;
- crlEntryExtensions?: Extensions;
- /**
- * Initializes a new instance of the {@link RevokedCertificate} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RevokedCertificateParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof USER_CERTIFICATE): asn1js.Integer;
- static defaultValues(memberName: typeof REVOCATION_DATE): Time;
- static defaultValues(memberName: typeof CRL_ENTRY_EXTENSIONS): Extensions;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * revokedCertificates SEQUENCE OF SEQUENCE {
- * userCertificate CertificateSerialNumber,
- * revocationDate Time,
- * crlEntryExtensions Extensions OPTIONAL
- * -- if present, version MUST be v2
- * } OPTIONAL,
- *```
- */
- static schema(parameters?: SchemaParameters<{
- userCertificate?: string;
- revocationDate?: string;
- crlEntryExtensions?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RevokedCertificateJson;
- }
- declare const TBS$3 = "tbs";
- declare const VERSION$h = "version";
- declare const SIGNATURE$4 = "signature";
- declare const ISSUER$1 = "issuer";
- declare const THIS_UPDATE$1 = "thisUpdate";
- declare const NEXT_UPDATE$1 = "nextUpdate";
- declare const REVOKED_CERTIFICATES = "revokedCertificates";
- declare const CRL_EXTENSIONS = "crlExtensions";
- declare const SIGNATURE_ALGORITHM$5 = "signatureAlgorithm";
- declare const SIGNATURE_VALUE$1 = "signatureValue";
- interface ICertificateRevocationList {
- tbs: ArrayBuffer;
- version: number;
- signature: AlgorithmIdentifier;
- issuer: RelativeDistinguishedNames;
- thisUpdate: Time;
- nextUpdate?: Time;
- revokedCertificates?: RevokedCertificate[];
- crlExtensions?: Extensions;
- signatureAlgorithm: AlgorithmIdentifier;
- signatureValue: asn1js.BitString;
- }
- type TBSCertListSchema = SchemaParameters<{
- tbsCertListVersion?: string;
- signature?: AlgorithmIdentifierSchema;
- issuer?: RelativeDistinguishedNamesSchema;
- tbsCertListThisUpdate?: TimeSchema;
- tbsCertListNextUpdate?: TimeSchema;
- tbsCertListRevokedCertificates?: string;
- crlExtensions?: ExtensionsSchema;
- }>;
- interface CertificateRevocationListJson {
- tbs: string;
- version: number;
- signature: AlgorithmIdentifierJson;
- issuer: RelativeDistinguishedNamesJson;
- thisUpdate: TimeJson;
- nextUpdate?: TimeJson;
- revokedCertificates?: RevokedCertificateJson[];
- crlExtensions?: ExtensionsJson;
- signatureAlgorithm: AlgorithmIdentifierJson;
- signatureValue: asn1js.BitStringJson;
- }
- type CertificateRevocationListParameters = PkiObjectParameters & Partial<ICertificateRevocationList>;
- interface CertificateRevocationListVerifyParams {
- issuerCertificate?: Certificate;
- publicKeyInfo?: PublicKeyInfo;
- }
- /**
- * Represents the CertificateRevocationList structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class CertificateRevocationList extends PkiObject implements ICertificateRevocationList {
- static CLASS_NAME: string;
- tbsView: Uint8Array;
- /**
- * @deprecated Since version 3.0.0
- */
- get tbs(): ArrayBuffer;
- /**
- * @deprecated Since version 3.0.0
- */
- set tbs(value: ArrayBuffer);
- version: number;
- signature: AlgorithmIdentifier;
- issuer: RelativeDistinguishedNames;
- thisUpdate: Time;
- nextUpdate?: Time;
- revokedCertificates?: RevokedCertificate[];
- crlExtensions?: Extensions;
- signatureAlgorithm: AlgorithmIdentifier;
- signatureValue: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link CertificateRevocationList} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertificateRevocationListParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TBS$3): ArrayBuffer;
- static defaultValues(memberName: typeof VERSION$h): number;
- static defaultValues(memberName: typeof SIGNATURE$4): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ISSUER$1): RelativeDistinguishedNames;
- static defaultValues(memberName: typeof THIS_UPDATE$1): Time;
- static defaultValues(memberName: typeof NEXT_UPDATE$1): Time;
- static defaultValues(memberName: typeof REVOKED_CERTIFICATES): RevokedCertificate[];
- static defaultValues(memberName: typeof CRL_EXTENSIONS): Extensions;
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$5): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE_VALUE$1): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CertificateList ::= SEQUENCE {
- * tbsCertList TBSCertList,
- * signatureAlgorithm AlgorithmIdentifier,
- * signatureValue BIT STRING }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- tbsCertListVersion?: string;
- signature?: AlgorithmIdentifierSchema;
- issuer?: RelativeDistinguishedNamesSchema;
- tbsCertListThisUpdate?: TimeSchema;
- tbsCertListNextUpdate?: TimeSchema;
- tbsCertListRevokedCertificates?: string;
- crlExtensions?: ExtensionsSchema;
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signatureValue?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- protected encodeTBS(): asn1js.Sequence;
- /**
- * Convert current object to asn1js object and set correct values
- * @returns asn1js object
- */
- toSchema(encodeFlag?: boolean): any;
- toJSON(): CertificateRevocationListJson;
- /**
- * Returns `true` if supplied certificate is revoked, otherwise `false`
- * @param certificate
- */
- isCertificateRevoked(certificate: Certificate): boolean;
- /**
- * Make a signature for existing CRL data
- * @param privateKey Private key for "subjectPublicKeyInfo" structure
- * @param hashAlgorithm Hashing algorithm. Default SHA-1
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Verify existing signature
- * @param parameters
- * @param crypto Crypto engine
- */
- verify(parameters?: CertificateRevocationListVerifyParams, crypto?: ICryptoEngine): Promise<boolean>;
- }
- declare const OTHER_REV_INFO_FORMAT = "otherRevInfoFormat";
- declare const OTHER_REV_INFO = "otherRevInfo";
- interface IOtherRevocationInfoFormat {
- otherRevInfoFormat: string;
- otherRevInfo: any;
- }
- interface OtherRevocationInfoFormatJson {
- otherRevInfoFormat: string;
- otherRevInfo?: any;
- }
- type OtherRevocationInfoFormatParameters = PkiObjectParameters & Partial<IOtherRevocationInfoFormat>;
- /**
- * Represents the OtherRevocationInfoFormat structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OtherRevocationInfoFormat extends PkiObject implements IOtherRevocationInfoFormat {
- static CLASS_NAME: string;
- otherRevInfoFormat: string;
- otherRevInfo: any;
- /**
- * Initializes a new instance of the {@link OtherRevocationInfoFormat} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OtherRevocationInfoFormatParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof OTHER_REV_INFO_FORMAT): string;
- static defaultValues(memberName: typeof OTHER_REV_INFO): any;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OtherCertificateFormat ::= SEQUENCE {
- * otherRevInfoFormat OBJECT IDENTIFIER,
- * otherRevInfo ANY DEFINED BY otherCertFormat }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- otherRevInfoFormat?: string;
- otherRevInfo?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OtherRevocationInfoFormatJson;
- }
- declare const CRLS$3 = "crls";
- declare const OTHER_REVOCATION_INFOS = "otherRevocationInfos";
- interface IRevocationInfoChoices {
- crls: CertificateRevocationList[];
- otherRevocationInfos: OtherRevocationInfoFormat[];
- }
- interface RevocationInfoChoicesJson {
- crls: CertificateRevocationListJson[];
- otherRevocationInfos: OtherRevocationInfoFormatJson[];
- }
- type RevocationInfoChoicesParameters = PkiObjectParameters & Partial<IRevocationInfoChoices>;
- type RevocationInfoChoicesSchema = SchemaParameters<{
- crls?: string;
- }>;
- /**
- * Represents the RevocationInfoChoices structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class RevocationInfoChoices extends PkiObject implements IRevocationInfoChoices {
- static CLASS_NAME: string;
- crls: CertificateRevocationList[];
- otherRevocationInfos: OtherRevocationInfoFormat[];
- /**
- * Initializes a new instance of the {@link RevocationInfoChoices} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RevocationInfoChoicesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CRLS$3): CertificateRevocationList[];
- static defaultValues(memberName: typeof OTHER_REVOCATION_INFOS): OtherRevocationInfoFormat[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RevocationInfoChoices ::= SET OF RevocationInfoChoice
- *
- * RevocationInfoChoice ::= CHOICE {
- * crl CertificateList,
- * other [1] IMPLICIT OtherRevocationInfoFormat }
- *```
- */
- static schema(parameters?: RevocationInfoChoicesSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RevocationInfoChoicesJson;
- }
- declare const CERTS$3 = "certs";
- declare const CRLS$2 = "crls";
- interface IOriginatorInfo {
- /**
- * Collection of certificates. In may contain originator certificates associated with several different
- * key management algorithms. It may also contain attribute certificates associated with the originator.
- */
- certs?: CertificateSet;
- /**
- * Collection of CRLs. It is intended that the set contain information sufficient to determine whether
- * or not the certificates in the certs field are valid, but such correspondence is not necessary
- */
- crls?: RevocationInfoChoices;
- }
- interface OriginatorInfoJson {
- certs?: CertificateSetJson;
- crls?: RevocationInfoChoicesJson;
- }
- type OriginatorInfoParameters = PkiObjectParameters & Partial<IOriginatorInfo>;
- /**
- * Represents the OriginatorInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OriginatorInfo extends PkiObject implements IOriginatorInfo {
- static CLASS_NAME: string;
- certs?: CertificateSet;
- crls?: RevocationInfoChoices;
- /**
- * Initializes a new instance of the {@link CertificateSet} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OriginatorInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CERTS$3): CertificateSet;
- static defaultValues(memberName: typeof CRLS$2): RevocationInfoChoices;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OriginatorInfo ::= SEQUENCE {
- * certs [0] IMPLICIT CertificateSet OPTIONAL,
- * crls [1] IMPLICIT RevocationInfoChoices OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- certs?: string;
- crls?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OriginatorInfoJson;
- }
- declare const ISSUER = "issuer";
- declare const SERIAL_NUMBER$2 = "serialNumber";
- interface IIssuerAndSerialNumber {
- /**
- * Certificate issuer name
- */
- issuer: RelativeDistinguishedNames;
- /**
- * Certificate serial number
- */
- serialNumber: asn1js.Integer;
- }
- interface IssuerAndSerialNumberJson {
- issuer: RelativeDistinguishedNamesJson;
- serialNumber: asn1js.IntegerJson;
- }
- type IssuerAndSerialNumberParameters = PkiObjectParameters & Partial<IIssuerAndSerialNumber>;
- type IssuerAndSerialNumberSchema = SchemaParameters<{
- issuer?: RelativeDistinguishedNamesSchema;
- serialNumber?: string;
- }>;
- /**
- * Represents the IssuerAndSerialNumber structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class IssuerAndSerialNumber extends PkiObject implements IIssuerAndSerialNumber {
- static CLASS_NAME: string;
- issuer: RelativeDistinguishedNames;
- serialNumber: asn1js.Integer;
- /**
- * Initializes a new instance of the {@link IssuerAndSerialNumber} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: IssuerAndSerialNumberParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ISSUER): RelativeDistinguishedNames;
- static defaultValues(memberName: typeof SERIAL_NUMBER$2): asn1js.Integer;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * IssuerAndSerialNumber ::= SEQUENCE {
- * issuer Name,
- * serialNumber CertificateSerialNumber }
- *
- * CertificateSerialNumber ::= INTEGER
- *```
- */
- static schema(parameters?: IssuerAndSerialNumberSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): IssuerAndSerialNumberJson;
- }
- declare const VARIANT$3 = "variant";
- declare const VALUE$3 = "value";
- interface IRecipientIdentifier {
- variant: number;
- value: IssuerAndSerialNumber | asn1js.OctetString;
- }
- interface RecipientIdentifierJson {
- variant: number;
- value?: IssuerAndSerialNumberJson | asn1js.OctetStringJson;
- }
- type RecipientIdentifierParameters = PkiObjectParameters & Partial<IRecipientIdentifier>;
- type RecipientIdentifierSchema = SchemaParameters;
- /**
- * Represents the RecipientIdentifier structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class RecipientIdentifier extends PkiObject implements IRecipientIdentifier {
- static CLASS_NAME: string;
- variant: number;
- value: IssuerAndSerialNumber | asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link RecipientIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RecipientIdentifierParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VARIANT$3): number;
- static defaultValues(memberName: typeof VALUE$3): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RecipientIdentifier ::= CHOICE {
- * issuerAndSerialNumber IssuerAndSerialNumber,
- * subjectKeyIdentifier [0] SubjectKeyIdentifier }
- *
- * SubjectKeyIdentifier ::= OCTET STRING
- *```
- */
- static schema(parameters?: RecipientIdentifierSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.BaseBlock<any>;
- toJSON(): RecipientIdentifierJson;
- }
- declare const VERSION$g = "version";
- declare const RID$1 = "rid";
- declare const KEY_ENCRYPTION_ALGORITHM$3 = "keyEncryptionAlgorithm";
- declare const ENCRYPTED_KEY$3 = "encryptedKey";
- declare const RECIPIENT_CERTIFICATE$1 = "recipientCertificate";
- interface IKeyTransRecipientInfo {
- version: number;
- rid: RecipientIdentifierType;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedKey: asn1js.OctetString;
- recipientCertificate: Certificate;
- }
- interface KeyTransRecipientInfoJson {
- version: number;
- rid: RecipientIdentifierMixedJson;
- keyEncryptionAlgorithm: AlgorithmIdentifierJson;
- encryptedKey: asn1js.OctetStringJson;
- }
- type RecipientIdentifierType = IssuerAndSerialNumber | asn1js.OctetString;
- type RecipientIdentifierMixedJson = IssuerAndSerialNumberJson | asn1js.OctetStringJson;
- type KeyTransRecipientInfoParameters = PkiObjectParameters & Partial<IKeyTransRecipientInfo>;
- /**
- * Represents the KeyTransRecipientInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class KeyTransRecipientInfo extends PkiObject implements IKeyTransRecipientInfo {
- static CLASS_NAME: string;
- version: number;
- rid: RecipientIdentifierType;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedKey: asn1js.OctetString;
- recipientCertificate: Certificate;
- /**
- * Initializes a new instance of the {@link KeyTransRecipientInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: KeyTransRecipientInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$g): number;
- static defaultValues(memberName: typeof RID$1): RecipientIdentifierType;
- static defaultValues(memberName: typeof KEY_ENCRYPTION_ALGORITHM$3): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENCRYPTED_KEY$3): asn1js.OctetString;
- static defaultValues(memberName: typeof RECIPIENT_CERTIFICATE$1): Certificate;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * KeyTransRecipientInfo ::= SEQUENCE {
- * version CMSVersion, -- always set to 0 or 2
- * rid RecipientIdentifier,
- * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
- * encryptedKey EncryptedKey }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- rid?: RecipientIdentifierSchema;
- keyEncryptionAlgorithm?: AlgorithmIdentifierSchema;
- encryptedKey?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): KeyTransRecipientInfoJson;
- }
- declare const VARIANT$2 = "variant";
- declare const VALUE$2 = "value";
- interface IOriginatorIdentifierOrKey {
- variant: number;
- value?: any;
- }
- interface OriginatorIdentifierOrKeyJson {
- variant: number;
- value?: any;
- }
- type OriginatorIdentifierOrKeyParameters = PkiObjectParameters & Partial<IOriginatorIdentifierOrKey>;
- type OriginatorIdentifierOrKeySchema = SchemaParameters;
- /**
- * Represents the OriginatorIdentifierOrKey structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OriginatorIdentifierOrKey extends PkiObject implements IOriginatorIdentifierOrKey {
- static CLASS_NAME: string;
- variant: number;
- value?: any;
- /**
- * Initializes a new instance of the {@link OriginatorIdentifierOrKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OriginatorIdentifierOrKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VARIANT$2): number;
- static defaultValues(memberName: typeof VALUE$2): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OriginatorIdentifierOrKey ::= CHOICE {
- * issuerAndSerialNumber IssuerAndSerialNumber,
- * subjectKeyIdentifier [0] SubjectKeyIdentifier,
- * originatorKey [1] OriginatorPublicKey }
- *```
- */
- static schema(parameters?: OriginatorIdentifierOrKeySchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.BaseBlock<any>;
- toJSON(): OriginatorIdentifierOrKeyJson;
- }
- declare const KEY_ATTR_ID = "keyAttrId";
- declare const KEY_ATTR = "keyAttr";
- interface IOtherKeyAttribute {
- keyAttrId: string;
- keyAttr?: any;
- }
- interface OtherKeyAttributeJson {
- keyAttrId: string;
- keyAttr?: any;
- }
- type OtherKeyAttributeParameters = PkiObjectParameters & Partial<IOtherKeyAttribute>;
- type OtherKeyAttributeSchema = SchemaType;
- /**
- * Represents the OtherKeyAttribute structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OtherKeyAttribute extends PkiObject implements IOtherKeyAttribute {
- static CLASS_NAME: string;
- keyAttrId: string;
- keyAttr?: any;
- /**
- * Initializes a new instance of the {@link OtherKeyAttribute} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OtherKeyAttributeParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof KEY_ATTR_ID): string;
- static defaultValues(memberName: typeof KEY_ATTR): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault<T extends object>(memberName: string, memberValue: T): memberValue is T;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OtherKeyAttribute ::= SEQUENCE {
- * keyAttrId OBJECT IDENTIFIER,
- * keyAttr ANY DEFINED BY keyAttrId OPTIONAL }
- *```
- */
- static schema(parameters?: OtherKeyAttributeSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OtherKeyAttributeJson;
- }
- declare const SUBJECT_KEY_IDENTIFIER = "subjectKeyIdentifier";
- declare const DATE$1 = "date";
- declare const OTHER$1 = "other";
- interface IRecipientKeyIdentifier {
- subjectKeyIdentifier: asn1js.OctetString;
- date?: asn1js.GeneralizedTime;
- other?: OtherKeyAttribute;
- }
- interface RecipientKeyIdentifierJson {
- subjectKeyIdentifier: asn1js.OctetStringJson;
- date?: asn1js.BaseBlockJson;
- other?: OtherKeyAttributeJson;
- }
- type RecipientKeyIdentifierParameters = PkiObjectParameters & Partial<IRecipientKeyIdentifier>;
- type RecipientKeyIdentifierSchema = SchemaParameters<{
- subjectKeyIdentifier?: string;
- date?: string;
- other?: OtherKeyAttributeSchema;
- }>;
- /**
- * Represents the RecipientKeyIdentifier structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class RecipientKeyIdentifier extends PkiObject implements IRecipientKeyIdentifier {
- static CLASS_NAME: string;
- subjectKeyIdentifier: asn1js.OctetString;
- date?: asn1js.GeneralizedTime;
- other?: OtherKeyAttribute;
- /**
- * Initializes a new instance of the {@link RecipientKeyIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RecipientKeyIdentifierParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SUBJECT_KEY_IDENTIFIER): asn1js.OctetString;
- static defaultValues(memberName: typeof DATE$1): asn1js.GeneralizedTime;
- static defaultValues(memberName: typeof OTHER$1): OtherKeyAttribute;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RecipientKeyIdentifier ::= SEQUENCE {
- * subjectKeyIdentifier SubjectKeyIdentifier,
- * date GeneralizedTime OPTIONAL,
- * other OtherKeyAttribute OPTIONAL }
- *```
- */
- static schema(parameters?: RecipientKeyIdentifierSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RecipientKeyIdentifierJson;
- }
- declare const VARIANT$1 = "variant";
- declare const VALUE$1 = "value";
- interface IKeyAgreeRecipientIdentifier {
- variant: number;
- value: any;
- }
- interface KeyAgreeRecipientIdentifierJson {
- variant: number;
- value?: IssuerAndSerialNumberJson | RecipientKeyIdentifierJson;
- }
- type KeyAgreeRecipientIdentifierParameters = PkiObjectParameters & Partial<IKeyAgreeRecipientIdentifier>;
- type KeyAgreeRecipientIdentifierSchema = SchemaParameters<{
- issuerAndSerialNumber?: IssuerAndSerialNumberSchema;
- rKeyId?: RecipientKeyIdentifierSchema;
- }>;
- /**
- * Represents the KeyAgreeRecipientIdentifier structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class KeyAgreeRecipientIdentifier extends PkiObject implements IKeyAgreeRecipientIdentifier {
- static CLASS_NAME: string;
- variant: number;
- value: any;
- /**
- * Initializes a new instance of the {@link KeyAgreeRecipientIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: KeyAgreeRecipientIdentifierParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VARIANT$1): number;
- static defaultValues(memberName: typeof VALUE$1): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * KeyAgreeRecipientIdentifier ::= CHOICE {
- * issuerAndSerialNumber IssuerAndSerialNumber,
- * rKeyId [0] IMPLICIT RecipientKeyIdentifier }
- *```
- */
- static schema(parameters?: KeyAgreeRecipientIdentifierSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.BaseBlock<any>;
- toJSON(): KeyAgreeRecipientIdentifierJson;
- }
- declare const RID = "rid";
- declare const ENCRYPTED_KEY$2 = "encryptedKey";
- interface IRecipientEncryptedKey {
- rid: KeyAgreeRecipientIdentifier;
- encryptedKey: asn1js.OctetString;
- }
- interface RecipientEncryptedKeyJson {
- rid: KeyAgreeRecipientIdentifierJson;
- encryptedKey: asn1js.OctetStringJson;
- }
- type RecipientEncryptedKeyParameters = PkiObjectParameters & Partial<IRecipientEncryptedKey>;
- /**
- * Represents the RecipientEncryptedKey structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class RecipientEncryptedKey extends PkiObject implements IRecipientEncryptedKey {
- static CLASS_NAME: string;
- rid: KeyAgreeRecipientIdentifier;
- encryptedKey: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link RecipientEncryptedKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RecipientEncryptedKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof RID): KeyAgreeRecipientIdentifier;
- static defaultValues(memberName: typeof ENCRYPTED_KEY$2): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RecipientEncryptedKey ::= SEQUENCE {
- * rid KeyAgreeRecipientIdentifier,
- * encryptedKey EncryptedKey }
- *
- * EncryptedKey ::= OCTET STRING
- *```
- */
- static schema(parameters?: SchemaParameters<{
- rid?: KeyAgreeRecipientIdentifierSchema;
- encryptedKey?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RecipientEncryptedKeyJson;
- }
- declare const ENCRYPTED_KEYS = "encryptedKeys";
- interface IRecipientEncryptedKeys {
- encryptedKeys: RecipientEncryptedKey[];
- }
- interface RecipientEncryptedKeysJson {
- encryptedKeys: RecipientEncryptedKeyJson[];
- }
- type RecipientEncryptedKeysParameters = PkiObjectParameters & Partial<IRecipientEncryptedKeys>;
- type RecipientEncryptedKeysSchema = SchemaParameters<{
- RecipientEncryptedKeys?: string;
- }>;
- /**
- * Represents the RecipientEncryptedKeys structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class RecipientEncryptedKeys extends PkiObject implements IRecipientEncryptedKeys {
- static CLASS_NAME: string;
- encryptedKeys: RecipientEncryptedKey[];
- /**
- * Initializes a new instance of the {@link RecipientEncryptedKeys} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RecipientEncryptedKeysParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ENCRYPTED_KEYS): RecipientEncryptedKey[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey
- *```
- */
- static schema(parameters?: RecipientEncryptedKeysSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RecipientEncryptedKeysJson;
- }
- declare const VERSION$f = "version";
- declare const ORIGINATOR = "originator";
- declare const UKM = "ukm";
- declare const KEY_ENCRYPTION_ALGORITHM$2 = "keyEncryptionAlgorithm";
- declare const RECIPIENT_ENCRYPTED_KEY = "recipientEncryptedKeys";
- declare const RECIPIENT_CERTIFICATE = "recipientCertificate";
- declare const RECIPIENT_PUBLIC_KEY = "recipientPublicKey";
- interface IKeyAgreeRecipientInfo {
- version: number;
- originator: OriginatorIdentifierOrKey;
- ukm?: asn1js.OctetString;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- recipientEncryptedKeys: RecipientEncryptedKeys;
- recipientCertificate: Certificate;
- recipientPublicKey: CryptoKey | null;
- }
- interface KeyAgreeRecipientInfoJson {
- version: number;
- originator: OriginatorIdentifierOrKeyJson;
- ukm?: asn1js.OctetStringJson;
- keyEncryptionAlgorithm: AlgorithmIdentifierJson;
- recipientEncryptedKeys: RecipientEncryptedKeysJson;
- }
- type KeyAgreeRecipientInfoParameters = PkiObjectParameters & Partial<IKeyAgreeRecipientInfo>;
- /**
- * Represents the KeyAgreeRecipientInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class KeyAgreeRecipientInfo extends PkiObject implements IKeyAgreeRecipientInfo {
- static CLASS_NAME: string;
- version: number;
- originator: OriginatorIdentifierOrKey;
- ukm?: asn1js.OctetString;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- recipientEncryptedKeys: RecipientEncryptedKeys;
- recipientCertificate: Certificate;
- recipientPublicKey: CryptoKey | null;
- /**
- * Initializes a new instance of the {@link KeyAgreeRecipientInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: KeyAgreeRecipientInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$f): number;
- static defaultValues(memberName: typeof ORIGINATOR): OriginatorIdentifierOrKey;
- static defaultValues(memberName: typeof UKM): asn1js.OctetString;
- static defaultValues(memberName: typeof KEY_ENCRYPTION_ALGORITHM$2): AlgorithmIdentifier;
- static defaultValues(memberName: typeof RECIPIENT_ENCRYPTED_KEY): RecipientEncryptedKeys;
- static defaultValues(memberName: typeof RECIPIENT_CERTIFICATE): Certificate;
- static defaultValues(memberName: typeof RECIPIENT_PUBLIC_KEY): null;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * KeyAgreeRecipientInfo ::= SEQUENCE {
- * version CMSVersion, -- always set to 3
- * originator [0] EXPLICIT OriginatorIdentifierOrKey,
- * ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
- * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
- * recipientEncryptedKeys RecipientEncryptedKeys }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- originator?: OriginatorIdentifierOrKeySchema;
- ukm?: string;
- keyEncryptionAlgorithm?: AlgorithmIdentifierSchema;
- recipientEncryptedKeys?: RecipientEncryptedKeysSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- /**
- * Conversion for the class to JSON object
- * @returns
- */
- toJSON(): KeyAgreeRecipientInfoJson;
- }
- declare const KEY_IDENTIFIER$1 = "keyIdentifier";
- declare const DATE = "date";
- declare const OTHER = "other";
- interface IKEKIdentifier {
- keyIdentifier: asn1js.OctetString;
- date?: asn1js.GeneralizedTime;
- other?: OtherKeyAttribute;
- }
- interface KEKIdentifierJson {
- keyIdentifier: asn1js.OctetStringJson;
- date?: asn1js.GeneralizedTime;
- other?: OtherKeyAttributeJson;
- }
- type KEKIdentifierParameters = PkiObjectParameters & Partial<IKEKIdentifier>;
- type KEKIdentifierSchema = SchemaParameters<{
- keyIdentifier?: string;
- date?: string;
- other?: OtherKeyAttributeSchema;
- }>;
- /**
- * Represents the KEKIdentifier structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class KEKIdentifier extends PkiObject implements IKEKIdentifier {
- static CLASS_NAME: string;
- keyIdentifier: asn1js.OctetString;
- date?: asn1js.GeneralizedTime;
- other?: OtherKeyAttribute;
- /**
- * Initializes a new instance of the {@link KEKIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: KEKIdentifierParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof KEY_IDENTIFIER$1): asn1js.OctetString;
- static defaultValues(memberName: typeof DATE): asn1js.GeneralizedTime;
- static defaultValues(memberName: typeof OTHER): OtherKeyAttribute;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * KEKIdentifier ::= SEQUENCE {
- * keyIdentifier OCTET STRING,
- * date GeneralizedTime OPTIONAL,
- * other OtherKeyAttribute OPTIONAL }
- *```
- */
- static schema(parameters?: KEKIdentifierSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): KEKIdentifierJson;
- }
- declare const VERSION$e = "version";
- declare const KEK_ID = "kekid";
- declare const KEY_ENCRYPTION_ALGORITHM$1 = "keyEncryptionAlgorithm";
- declare const ENCRYPTED_KEY$1 = "encryptedKey";
- declare const PER_DEFINED_KEK = "preDefinedKEK";
- interface IKEKRecipientInfo {
- version: number;
- kekid: KEKIdentifier;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedKey: asn1js.OctetString;
- preDefinedKEK: ArrayBuffer;
- }
- interface KEKRecipientInfoJson {
- version: number;
- kekid: KEKIdentifierJson;
- keyEncryptionAlgorithm: AlgorithmIdentifierJson;
- encryptedKey: asn1js.OctetStringJson;
- }
- type KEKRecipientInfoParameters = PkiObjectParameters & Partial<IKEKRecipientInfo>;
- /**
- * Represents the KEKRecipientInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class KEKRecipientInfo extends PkiObject implements IKEKRecipientInfo {
- static CLASS_NAME: string;
- version: number;
- kekid: KEKIdentifier;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedKey: asn1js.OctetString;
- preDefinedKEK: ArrayBuffer;
- /**
- * Initializes a new instance of the {@link KEKRecipientInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: KEKRecipientInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$e): number;
- static defaultValues(memberName: typeof KEK_ID): KEKIdentifier;
- static defaultValues(memberName: typeof KEY_ENCRYPTION_ALGORITHM$1): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENCRYPTED_KEY$1): asn1js.OctetString;
- static defaultValues(memberName: typeof PER_DEFINED_KEK): ArrayBuffer;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * KEKRecipientInfo ::= SEQUENCE {
- * version CMSVersion, -- always set to 4
- * kekid KEKIdentifier,
- * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
- * encryptedKey EncryptedKey }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- kekid?: KEKIdentifierSchema;
- keyEncryptionAlgorithm?: AlgorithmIdentifierSchema;
- encryptedKey?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): KEKRecipientInfoJson;
- }
- declare const VERSION$d = "version";
- declare const KEY_DERIVATION_ALGORITHM = "keyDerivationAlgorithm";
- declare const KEY_ENCRYPTION_ALGORITHM = "keyEncryptionAlgorithm";
- declare const ENCRYPTED_KEY = "encryptedKey";
- declare const PASSWORD = "password";
- interface IPasswordRecipientInfo {
- version: number;
- keyDerivationAlgorithm?: AlgorithmIdentifier;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedKey: asn1js.OctetString;
- password: ArrayBuffer;
- }
- interface PasswordRecipientInfoJson {
- version: number;
- keyDerivationAlgorithm?: AlgorithmIdentifierJson;
- keyEncryptionAlgorithm: AlgorithmIdentifierJson;
- encryptedKey: asn1js.OctetStringJson;
- }
- type PasswordRecipientinfoParameters = PkiObjectParameters & Partial<IPasswordRecipientInfo>;
- /**
- * Represents the PasswordRecipientInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class PasswordRecipientinfo extends PkiObject implements IPasswordRecipientInfo {
- static CLASS_NAME: string;
- version: number;
- keyDerivationAlgorithm?: AlgorithmIdentifier;
- keyEncryptionAlgorithm: AlgorithmIdentifier;
- encryptedKey: asn1js.OctetString;
- password: ArrayBuffer;
- /**
- * Initializes a new instance of the {@link PasswordRecipientinfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PasswordRecipientinfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$d): number;
- static defaultValues(memberName: typeof KEY_DERIVATION_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof KEY_ENCRYPTION_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENCRYPTED_KEY): asn1js.OctetString;
- static defaultValues(memberName: typeof PASSWORD): ArrayBuffer;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PasswordRecipientInfo ::= SEQUENCE {
- * version CMSVersion, -- Always set to 0
- * keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier OPTIONAL,
- * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
- * encryptedKey EncryptedKey }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- keyDerivationAlgorithm?: string;
- keyEncryptionAlgorithm?: AlgorithmIdentifierSchema;
- encryptedKey?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PasswordRecipientInfoJson;
- }
- declare const ORI_TYPE = "oriType";
- declare const ORI_VALUE = "oriValue";
- interface IOtherRecipientInfo {
- oriType: string;
- oriValue: any;
- }
- interface OtherRecipientInfoJson {
- oriType: string;
- oriValue?: any;
- }
- type OtherRecipientInfoParameters = PkiObjectParameters & Partial<IOtherRecipientInfo>;
- /**
- * Represents the OtherRecipientInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OtherRecipientInfo extends PkiObject implements IOtherRecipientInfo {
- static CLASS_NAME: string;
- oriType: string;
- oriValue: any;
- /**
- * Initializes a new instance of the {@link OtherRecipientInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OtherRecipientInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ORI_TYPE): string;
- static defaultValues(memberName: typeof ORI_VALUE): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OtherRecipientInfo ::= SEQUENCE {
- * oriType OBJECT IDENTIFIER,
- * oriValue ANY DEFINED BY oriType }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- oriType?: string;
- oriValue?: string;
- }>): asn1js.Sequence;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OtherRecipientInfoJson;
- }
- declare const VARIANT = "variant";
- declare const VALUE = "value";
- interface IRecipientInfo {
- variant: number;
- value?: RecipientInfoValue;
- }
- interface RecipientInfoJson {
- variant: number;
- value?: RecipientInfoValueJson;
- }
- type RecipientInfoValue = KeyTransRecipientInfo | KeyAgreeRecipientInfo | KEKRecipientInfo | PasswordRecipientinfo | OtherRecipientInfo;
- type RecipientInfoValueJson = KeyTransRecipientInfoJson | KeyAgreeRecipientInfoJson | KEKRecipientInfoJson | PasswordRecipientInfoJson | OtherRecipientInfoJson;
- type RecipientInfoParameters = PkiObjectParameters & Partial<IRecipientInfo>;
- /**
- * Represents the RecipientInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class RecipientInfo extends PkiObject implements IRecipientInfo {
- static CLASS_NAME: string;
- variant: number;
- value?: RecipientInfoValue;
- /**
- * Initializes a new instance of the {@link RecipientInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RecipientInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VARIANT): number;
- static defaultValues(memberName: typeof VALUE): RecipientInfoValue;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RecipientInfo ::= CHOICE {
- * ktri KeyTransRecipientInfo,
- * kari [1] KeyAgreeRecipientInfo,
- * kekri [2] KEKRecipientInfo,
- * pwri [3] PasswordRecipientinfo,
- * ori [4] OtherRecipientInfo }
- *```
- */
- static schema(parameters?: SchemaParameters): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.BaseBlock<any>;
- toJSON(): RecipientInfoJson;
- }
- declare const VERSION$c = "version";
- declare const ORIGINATOR_INFO = "originatorInfo";
- declare const RECIPIENT_INFOS = "recipientInfos";
- declare const ENCRYPTED_CONTENT_INFO$1 = "encryptedContentInfo";
- declare const UNPROTECTED_ATTRS$1 = "unprotectedAttrs";
- interface IEnvelopedData {
- /**
- * Version number.
- *
- * The appropriate value depends on `originatorInfo`, `RecipientInfo`, and `unprotectedAttrs`.
- *
- * The version MUST be assigned as follows:
- * ```
- * IF (originatorInfo is present) AND
- * ((any certificates with a type of other are present) OR
- * (any crls with a type of other are present))
- * THEN version is 4
- * ELSE
- * IF ((originatorInfo is present) AND
- * (any version 2 attribute certificates are present)) OR
- * (any RecipientInfo structures include pwri) OR
- * (any RecipientInfo structures include ori)
- * THEN version is 3
- * ELSE
- * IF (originatorInfo is absent) AND
- * (unprotectedAttrs is absent) AND
- * (all RecipientInfo structures are version 0)
- * THEN version is 0
- * ELSE version is 2
- * ```
- */
- version: number;
- /**
- * Optionally provides information about the originator. It is present only if required by the key management algorithm.
- * It may contain certificates and CRLs.
- */
- originatorInfo?: OriginatorInfo;
- /**
- * Collection of per-recipient information. There MUST be at least one element in the collection.
- */
- recipientInfos: RecipientInfo[];
- /**
- * Encrypted content information
- */
- encryptedContentInfo: EncryptedContentInfo;
- /**
- * Collection of attributes that are not encrypted
- */
- unprotectedAttrs?: Attribute[];
- }
- /**
- * JSON representation of {@link EnvelopedData}
- */
- interface EnvelopedDataJson {
- version: number;
- originatorInfo?: OriginatorInfoJson;
- recipientInfos: RecipientInfoJson[];
- encryptedContentInfo: EncryptedContentInfoJson;
- unprotectedAttrs?: AttributeJson[];
- }
- type EnvelopedDataParameters = PkiObjectParameters & Partial<IEnvelopedData> & EncryptedContentInfoSplit;
- interface EnvelopedDataEncryptionParams {
- kekEncryptionLength: number;
- kdfAlgorithm: string;
- }
- interface EnvelopedDataDecryptBaseParams {
- preDefinedData?: BufferSource;
- recipientCertificate?: Certificate;
- }
- interface EnvelopedDataDecryptKeyParams extends EnvelopedDataDecryptBaseParams {
- recipientPrivateKey: CryptoKey;
- /**
- * Crypto provider assigned to `recipientPrivateKey`. If the filed is empty uses default crypto provider.
- */
- crypto?: Crypto;
- }
- interface EnvelopedDataDecryptBufferParams extends EnvelopedDataDecryptBaseParams {
- recipientPrivateKey?: BufferSource;
- }
- type EnvelopedDataDecryptParams = EnvelopedDataDecryptBufferParams | EnvelopedDataDecryptKeyParams;
- /**
- * Represents the EnvelopedData structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- *
- * @example The following example demonstrates how to create and encrypt CMS Enveloped Data
- * ```js
- * const cmsEnveloped = new pkijs.EnvelopedData();
- *
- * // Add recipient
- * cmsEnveloped.addRecipientByCertificate(cert, { oaepHashAlgorithm: "SHA-256" });
- *
- * // Secret key algorithm
- * const alg = {
- * name: "AES-GCM",
- * length: 256,
- * }
- * await cmsEnveloped.encrypt(alg, dataToEncrypt);
- *
- * // Add Enveloped Data into CMS Content Info
- * const cmsContent = new pkijs.ContentInfo();
- * cmsContent.contentType = pkijs.ContentInfo.ENVELOPED_DATA;
- * cmsContent.content = cmsEnveloped.toSchema();
- *
- * const cmsContentRaw = cmsContent.toSchema().toBER();
- * ```
- *
- * @example The following example demonstrates how to decrypt CMS Enveloped Data
- * ```js
- * // Get a "crypto" extension
- * const crypto = pkijs.getCrypto();
- *
- * // Parse CMS Content Info
- * const cmsContent = pkijs.ContentInfo.fromBER(cmsContentRaw);
- * if (cmsContent.contentType !== pkijs.ContentInfo.ENVELOPED_DATA) {
- * throw new Error("CMS is not Enveloped Data");
- * }
- * // Parse CMS Enveloped Data
- * const cmsEnveloped = new pkijs.EnvelopedData({ schema: cmsContent.content });
- *
- * // Export private key to PKCS#8
- * const pkcs8 = await crypto.exportKey("pkcs8", keys.privateKey);
- *
- * // Decrypt data
- * const decryptedData = await cmsEnveloped.decrypt(0, {
- * recipientCertificate: cert,
- * recipientPrivateKey: pkcs8,
- * });
- * ```
- */
- declare class EnvelopedData extends PkiObject implements IEnvelopedData {
- static CLASS_NAME: string;
- version: number;
- originatorInfo?: OriginatorInfo;
- recipientInfos: RecipientInfo[];
- encryptedContentInfo: EncryptedContentInfo;
- unprotectedAttrs?: Attribute[];
- policy: Required<EncryptedContentInfoSplit>;
- /**
- * Initializes a new instance of the {@link EnvelopedData} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: EnvelopedDataParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$c): number;
- static defaultValues(memberName: typeof ORIGINATOR_INFO): OriginatorInfo;
- static defaultValues(memberName: typeof RECIPIENT_INFOS): RecipientInfo[];
- static defaultValues(memberName: typeof ENCRYPTED_CONTENT_INFO$1): EncryptedContentInfo;
- static defaultValues(memberName: typeof UNPROTECTED_ATTRS$1): Attribute[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * EnvelopedData ::= SEQUENCE {
- * version CMSVersion,
- * originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
- * recipientInfos RecipientInfos,
- * encryptedContentInfo EncryptedContentInfo,
- * unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- originatorInfo?: string;
- recipientInfos?: string;
- encryptedContentInfo?: EncryptedContentInfoSchema;
- unprotectedAttrs?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): EnvelopedDataJson;
- /**
- * Helpers function for filling "RecipientInfo" based on recipient's certificate.
- * Problem with WebCrypto is that for RSA certificates we have only one option - "key transport" and
- * for ECC certificates we also have one option - "key agreement". As soon as Google will implement
- * DH algorithm it would be possible to use "key agreement" also for RSA certificates.
- * @param certificate Recipient's certificate
- * @param parameters Additional parameters necessary for "fine tunning" of encryption process
- * @param variant Variant = 1 is for "key transport", variant = 2 is for "key agreement". In fact the "variant" is unnecessary now because Google has no DH algorithm implementation. Thus key encryption scheme would be choosen by certificate type only: "key transport" for RSA and "key agreement" for ECC certificates.
- * @param crypto Crypto engine
- */
- addRecipientByCertificate(certificate: Certificate, parameters?: object, variant?: number, crypto?: ICryptoEngine): boolean;
- /**
- * Add recipient based on pre-defined data like password or KEK
- * @param preDefinedData ArrayBuffer with pre-defined data
- * @param parameters Additional parameters necessary for "fine tunning" of encryption process
- * @param variant Variant = 1 for pre-defined "key encryption key" (KEK). Variant = 2 for password-based encryption.
- * @param crypto Crypto engine
- */
- addRecipientByPreDefinedData(preDefinedData: ArrayBuffer, parameters: {
- keyIdentifier?: ArrayBuffer;
- hmacHashAlgorithm?: string;
- iterationCount?: number;
- keyEncryptionAlgorithm?: AesKeyGenParams;
- keyEncryptionAlgorithmParams?: any;
- } | undefined, variant: number, crypto?: ICryptoEngine): void;
- /**
- * Add a "RecipientInfo" using a KeyAgreeRecipientInfo of type RecipientKeyIdentifier.
- * @param key Recipient's public key
- * @param keyId The id for the recipient's public key
- * @param parameters Additional parameters for "fine tuning" the encryption process
- * @param crypto Crypto engine
- */
- addRecipientByKeyIdentifier(key?: CryptoKey, keyId?: ArrayBuffer, parameters?: any, crypto?: ICryptoEngine): void;
- /**
- * Add a "RecipientInfo" using a KeyAgreeRecipientInfo of type RecipientKeyIdentifier.
- * @param recipientIdentifier Recipient identifier
- * @param encryptionParameters Additional parameters for "fine tuning" the encryption process
- * @param extraRecipientInfoParams Additional params for KeyAgreeRecipientInfo
- * @param crypto Crypto engine
- */
- private _addKeyAgreeRecipientInfo;
- /**
- * Creates a new CMS Enveloped Data content with encrypted data
- * @param contentEncryptionAlgorithm WebCrypto algorithm. For the moment here could be only "AES-CBC" or "AES-GCM" algorithms.
- * @param contentToEncrypt Content to encrypt
- * @param crypto Crypto engine
- */
- encrypt(contentEncryptionAlgorithm: Algorithm, contentToEncrypt: ArrayBuffer, crypto?: ICryptoEngine): Promise<(void | {
- ecdhPrivateKey: CryptoKey;
- })[]>;
- /**
- * Decrypts existing CMS Enveloped Data content
- * @param recipientIndex Index of recipient
- * @param parameters Additional parameters
- * @param crypto Crypto engine
- */
- decrypt(recipientIndex: number, parameters: EnvelopedDataDecryptParams, crypto?: ICryptoEngine): Promise<ArrayBuffer>;
- }
- declare const VERSION$b = "version";
- declare const ENCRYPTED_CONTENT_INFO = "encryptedContentInfo";
- declare const UNPROTECTED_ATTRS = "unprotectedAttrs";
- interface IEncryptedData {
- /**
- * Version number.
- *
- * If `unprotectedAttrs` is present, then the version MUST be 2. If `unprotectedAttrs` is absent, then version MUST be 0.
- */
- version: number;
- /**
- * Encrypted content information
- */
- encryptedContentInfo: EncryptedContentInfo;
- /**
- * Collection of attributes that are not encrypted
- */
- unprotectedAttrs?: Attribute[];
- }
- interface EncryptedDataJson {
- version: number;
- encryptedContentInfo: EncryptedContentInfoJson;
- unprotectedAttrs?: AttributeJson[];
- }
- type EncryptedDataParameters = PkiObjectParameters & Partial<IEncryptedData>;
- type EncryptedDataEncryptParams = Omit<CryptoEngineEncryptParams, "contentType">;
- /**
- * Represents the EncryptedData structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- *
- * @example The following example demonstrates how to create and encrypt CMS Encrypted Data
- * ```js
- * const cmsEncrypted = new pkijs.EncryptedData();
- *
- * await cmsEncrypted.encrypt({
- * contentEncryptionAlgorithm: {
- * name: "AES-GCM",
- * length: 256,
- * },
- * hmacHashAlgorithm: "SHA-256",
- * iterationCount: 1000,
- * password: password,
- * contentToEncrypt: dataToEncrypt,
- * });
- *
- * // Add Encrypted Data into CMS Content Info
- * const cmsContent = new pkijs.ContentInfo();
- * cmsContent.contentType = pkijs.ContentInfo.ENCRYPTED_DATA;
- * cmsContent.content = cmsEncrypted.toSchema();
- *
- * const cmsContentRaw = cmsContent.toSchema().toBER();
- * ```
- *
- * @example The following example demonstrates how to decrypt CMS Encrypted Data
- * ```js
- * // Parse CMS Content Info
- * const cmsContent = pkijs.ContentInfo.fromBER(cmsContentRaw);
- * if (cmsContent.contentType !== pkijs.ContentInfo.ENCRYPTED_DATA) {
- * throw new Error("CMS is not Encrypted Data");
- * }
- * // Parse CMS Encrypted Data
- * const cmsEncrypted = new pkijs.EncryptedData({ schema: cmsContent.content });
- *
- * // Decrypt data
- * const decryptedData = await cmsEncrypted.decrypt({
- * password: password,
- * });
- * ```
- */
- declare class EncryptedData extends PkiObject implements IEncryptedData {
- static CLASS_NAME: string;
- version: number;
- encryptedContentInfo: EncryptedContentInfo;
- unprotectedAttrs?: Attribute[];
- /**
- * Initializes a new instance of the {@link EncryptedData} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: EncryptedDataParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$b): number;
- static defaultValues(memberName: typeof ENCRYPTED_CONTENT_INFO): EncryptedContentInfo;
- static defaultValues(memberName: typeof UNPROTECTED_ATTRS): Attribute[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * EncryptedData ::= SEQUENCE {
- * version CMSVersion,
- * encryptedContentInfo EncryptedContentInfo,
- * unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- encryptedContentInfo?: EncryptedContentInfoSchema;
- unprotectedAttrs?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): EncryptedDataJson;
- /**
- * Creates a new CMS Encrypted Data content
- * @param parameters Parameters necessary for encryption
- */
- encrypt(parameters: EncryptedDataEncryptParams, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Creates a new CMS Encrypted Data content
- * @param parameters Parameters necessary for encryption
- * @param crypto Crypto engine
- * @returns Returns decrypted raw data
- */
- decrypt(parameters: {
- password: ArrayBuffer;
- }, crypto?: ICryptoEngine): Promise<ArrayBuffer>;
- }
- declare const SAFE_CONTENTS = "safeContents";
- declare const PARSED_VALUE$4 = "parsedValue";
- interface IAuthenticatedSafe {
- safeContents: ContentInfo[];
- parsedValue: any;
- }
- type AuthenticatedSafeParameters = PkiObjectParameters & Partial<IAuthenticatedSafe>;
- interface AuthenticatedSafeJson {
- safeContents: ContentInfoJson[];
- }
- type SafeContent = ContentInfo | EncryptedData | EnvelopedData | object;
- /**
- * Represents the AuthenticatedSafe structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class AuthenticatedSafe extends PkiObject implements IAuthenticatedSafe {
- static CLASS_NAME: string;
- safeContents: ContentInfo[];
- parsedValue: any;
- /**
- * Initializes a new instance of the {@link AuthenticatedSafe} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AuthenticatedSafeParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SAFE_CONTENTS): ContentInfo[];
- static defaultValues(memberName: typeof PARSED_VALUE$4): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AuthenticatedSafe ::= SEQUENCE OF ContentInfo
- * -- Data if unencrypted
- * -- EncryptedData if password-encrypted
- * -- EnvelopedData if public key-encrypted
- *```
- */
- static schema(parameters?: SchemaParameters<{
- contentInfos?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AuthenticatedSafeJson;
- parseInternalValues(parameters: {
- safeContents: SafeContent[];
- }, crypto?: ICryptoEngine): Promise<void>;
- makeInternalValues(parameters: {
- safeContents: any[];
- }, crypto?: ICryptoEngine): Promise<this>;
- }
- declare const KEY_IDENTIFIER = "keyIdentifier";
- declare const AUTHORITY_CERT_ISSUER = "authorityCertIssuer";
- declare const AUTHORITY_CERT_SERIAL_NUMBER = "authorityCertSerialNumber";
- interface IAuthorityKeyIdentifier {
- keyIdentifier?: asn1js.OctetString;
- authorityCertIssuer?: GeneralName[];
- authorityCertSerialNumber?: asn1js.Integer;
- }
- type AuthorityKeyIdentifierParameters = PkiObjectParameters & Partial<IAuthorityKeyIdentifier>;
- interface AuthorityKeyIdentifierJson {
- keyIdentifier?: asn1js.OctetStringJson;
- authorityCertIssuer?: GeneralNameJson[];
- authorityCertSerialNumber?: asn1js.IntegerJson;
- }
- /**
- * Represents the AuthorityKeyIdentifier structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class AuthorityKeyIdentifier extends PkiObject implements IAuthorityKeyIdentifier {
- static CLASS_NAME: string;
- keyIdentifier?: asn1js.OctetString;
- authorityCertIssuer?: GeneralName[];
- authorityCertSerialNumber?: asn1js.Integer;
- /**
- * Initializes a new instance of the {@link AuthorityKeyIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: AuthorityKeyIdentifierParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof KEY_IDENTIFIER): asn1js.OctetString;
- static defaultValues(memberName: typeof AUTHORITY_CERT_ISSUER): GeneralName[];
- static defaultValues(memberName: typeof AUTHORITY_CERT_SERIAL_NUMBER): asn1js.Integer;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AuthorityKeyIdentifier OID ::= 2.5.29.35
- *
- * AuthorityKeyIdentifier ::= SEQUENCE {
- * keyIdentifier [0] KeyIdentifier OPTIONAL,
- * authorityCertIssuer [1] GeneralNames OPTIONAL,
- * authorityCertSerialNumber [2] CertificateSerialNumber OPTIONAL }
- *
- * KeyIdentifier ::= OCTET STRING
- *```
- */
- static schema(parameters?: SchemaParameters<{
- keyIdentifier?: string;
- authorityCertIssuer?: string;
- authorityCertSerialNumber?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): AuthorityKeyIdentifierJson;
- }
- declare const CA = "cA";
- interface IBasicConstraints {
- cA: boolean;
- pathLenConstraint?: number | asn1js.Integer;
- }
- type BasicConstraintsParameters = PkiObjectParameters & Partial<IBasicConstraints>;
- interface BasicConstraintsJson {
- cA?: boolean;
- pathLenConstraint?: asn1js.IntegerJson | number;
- }
- /**
- * Represents the BasicConstraints structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class BasicConstraints extends PkiObject implements IBasicConstraints {
- static CLASS_NAME: string;
- cA: boolean;
- pathLenConstraint?: number | asn1js.Integer;
- /**
- * Initializes a new instance of the {@link AuthorityKeyIdentifier} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: BasicConstraintsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CA): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * BasicConstraints ::= SEQUENCE {
- * cA BOOLEAN DEFAULT FALSE,
- * pathLenConstraint INTEGER (0..MAX) OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- cA?: string;
- pathLenConstraint?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- /**
- * Conversion for the class to JSON object
- * @returns
- */
- toJSON(): BasicConstraintsJson;
- }
- declare const HASH_ALGORITHM$4 = "hashAlgorithm";
- declare const ISSUER_NAME_HASH = "issuerNameHash";
- declare const ISSUER_KEY_HASH = "issuerKeyHash";
- declare const SERIAL_NUMBER$1 = "serialNumber";
- interface ICertID {
- /**
- * Hash algorithm used to generate the `issuerNameHash` and `issuerKeyHash` values
- */
- hashAlgorithm: AlgorithmIdentifier;
- /**
- * Hash of the issuer's distinguished name (DN). The hash shall be calculated over the DER encoding
- * of the issuer's name field in the certificate being checked.
- */
- issuerNameHash: asn1js.OctetString;
- /**
- * Hash of the issuer's public key. The hash shall be calculated over the value (excluding tag and length)
- * of the subject public key field in the issuer's certificate.
- */
- issuerKeyHash: asn1js.OctetString;
- /**
- * Serial number of the certificate for which status is being requested
- */
- serialNumber: asn1js.Integer;
- }
- type CertIDParameters = PkiObjectParameters & Partial<ICertID>;
- type CertIDSchema = SchemaParameters<{
- hashAlgorithm?: string;
- hashAlgorithmObject?: AlgorithmIdentifierSchema;
- issuerNameHash?: string;
- issuerKeyHash?: string;
- serialNumber?: string;
- }>;
- interface CertIDJson {
- hashAlgorithm: AlgorithmIdentifierJson;
- issuerNameHash: asn1js.OctetStringJson;
- issuerKeyHash: asn1js.OctetStringJson;
- serialNumber: asn1js.IntegerJson;
- }
- interface CertIDCreateParams {
- issuerCertificate: Certificate;
- hashAlgorithm: string;
- }
- /**
- * Represents an CertID described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class CertID extends PkiObject implements ICertID {
- static CLASS_NAME: string;
- /**
- * Making OCSP certificate identifier for specific certificate
- * @param certificate Certificate making OCSP Request for
- * @param parameters Additional parameters
- * @param crypto Crypto engine
- * @returns Returns created CertID object
- */
- static create(certificate: Certificate, parameters: CertIDCreateParams, crypto?: ICryptoEngine): Promise<CertID>;
- hashAlgorithm: AlgorithmIdentifier;
- issuerNameHash: asn1js.OctetString;
- issuerKeyHash: asn1js.OctetString;
- serialNumber: asn1js.Integer;
- /**
- * Initializes a new instance of the {@link CertID} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertIDParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof HASH_ALGORITHM$4): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ISSUER_NAME_HASH): asn1js.OctetString;
- static defaultValues(memberName: typeof ISSUER_KEY_HASH): asn1js.OctetString;
- static defaultValues(memberName: typeof SERIAL_NUMBER$1): asn1js.Integer;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CertID ::= SEQUENCE {
- * hashAlgorithm AlgorithmIdentifier,
- * issuerNameHash OCTET STRING, -- Hash of issuer's DN
- * issuerKeyHash OCTET STRING, -- Hash of issuer's public key
- * serialNumber CertificateSerialNumber }
- *```
- */
- static schema(parameters?: CertIDSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): CertIDJson;
- /**
- * Checks that two "CertIDs" are equal
- * @param certificateID Identifier of the certificate to be checked
- */
- isEqual(certificateID: CertID): boolean;
- /**
- * Making OCSP certificate identifier for specific certificate
- * @param certificate Certificate making OCSP Request for
- * @param parameters Additional parameters
- * @param crypto Crypto engine
- */
- createForCertificate(certificate: Certificate, parameters: CertIDCreateParams, crypto?: ICryptoEngine): Promise<void>;
- }
- declare const CERT_ID$1 = "certID";
- declare const CERT_STATUS = "certStatus";
- declare const THIS_UPDATE = "thisUpdate";
- declare const NEXT_UPDATE = "nextUpdate";
- declare const SINGLE_EXTENSIONS = "singleExtensions";
- interface ISingleResponse {
- certID: CertID;
- certStatus: any;
- thisUpdate: Date;
- nextUpdate?: Date;
- singleExtensions?: Extension[];
- }
- type SingleResponseParameters = PkiObjectParameters & Partial<ISingleResponse>;
- type SingleResponseSchema = SchemaParameters<{
- certID?: CertIDSchema;
- certStatus?: string;
- thisUpdate?: string;
- nextUpdate?: string;
- singleExtensions?: ExtensionsSchema;
- }>;
- interface SingleResponseJson {
- certID: CertIDJson;
- certStatus: any;
- thisUpdate: Date;
- nextUpdate?: Date;
- singleExtensions?: ExtensionJson[];
- }
- /**
- * Represents an SingleResponse described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class SingleResponse extends PkiObject implements ISingleResponse {
- static CLASS_NAME: string;
- certID: CertID;
- certStatus: any;
- thisUpdate: Date;
- nextUpdate?: Date;
- singleExtensions?: Extension[];
- /**
- * Initializes a new instance of the {@link SingleResponse} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SingleResponseParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CERT_ID$1): CertID;
- static defaultValues(memberName: typeof CERT_STATUS): any;
- static defaultValues(memberName: typeof THIS_UPDATE): Date;
- static defaultValues(memberName: typeof NEXT_UPDATE): Date;
- static defaultValues(memberName: typeof SINGLE_EXTENSIONS): Extension[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SingleResponse ::= SEQUENCE {
- * certID CertID,
- * certStatus CertStatus,
- * thisUpdate GeneralizedTime,
- * nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
- * singleExtensions [1] EXPLICIT Extensions OPTIONAL }
- *
- * CertStatus ::= CHOICE {
- * good [0] IMPLICIT NULL,
- * revoked [1] IMPLICIT RevokedInfo,
- * unknown [2] IMPLICIT UnknownInfo }
- *
- * RevokedInfo ::= SEQUENCE {
- * revocationTime GeneralizedTime,
- * revocationReason [0] EXPLICIT CRLReason OPTIONAL }
- *
- * UnknownInfo ::= NULL
- *```
- */
- static schema(parameters?: SingleResponseSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SingleResponseJson;
- }
- declare const TBS$2 = "tbs";
- declare const VERSION$a = "version";
- declare const RESPONDER_ID = "responderID";
- declare const PRODUCED_AT = "producedAt";
- declare const RESPONSES = "responses";
- declare const RESPONSE_EXTENSIONS = "responseExtensions";
- interface IResponseData {
- version?: number;
- tbs: ArrayBuffer;
- responderID: any;
- producedAt: Date;
- responses: SingleResponse[];
- responseExtensions?: Extension[];
- }
- type ResponseDataParameters = PkiObjectParameters & Partial<IResponseData>;
- type ResponseDataSchema = SchemaParameters<{
- version?: string;
- responderID?: string;
- ResponseDataByName?: RelativeDistinguishedNamesSchema;
- ResponseDataByKey?: string;
- producedAt?: string;
- response?: SingleResponseSchema;
- extensions?: ExtensionsSchema;
- }>;
- interface ResponseDataJson {
- version?: number;
- tbs: string;
- responderID: any;
- producedAt: Date;
- responses: SingleResponseJson[];
- responseExtensions?: ExtensionJson[];
- }
- /**
- * Represents an ResponseData described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class ResponseData extends PkiObject implements IResponseData {
- static CLASS_NAME: string;
- version?: number;
- tbsView: Uint8Array;
- /**
- * @deprecated Since version 3.0.0
- */
- get tbs(): ArrayBuffer;
- /**
- * @deprecated Since version 3.0.0
- */
- set tbs(value: ArrayBuffer);
- responderID: any;
- producedAt: Date;
- responses: SingleResponse[];
- responseExtensions?: Extension[];
- /**
- * Initializes a new instance of the {@link ResponseData} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ResponseDataParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TBS$2): ArrayBuffer;
- static defaultValues(memberName: typeof VERSION$a): number;
- static defaultValues(memberName: typeof RESPONDER_ID): any;
- static defaultValues(memberName: typeof PRODUCED_AT): Date;
- static defaultValues(memberName: typeof RESPONSES): SingleResponse[];
- static defaultValues(memberName: typeof RESPONSE_EXTENSIONS): Extension[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ResponseData ::= SEQUENCE {
- * version [0] EXPLICIT Version DEFAULT v1,
- * responderID ResponderID,
- * producedAt GeneralizedTime,
- * responses SEQUENCE OF SingleResponse,
- * responseExtensions [1] EXPLICIT Extensions OPTIONAL }
- *```
- */
- static schema(parameters?: ResponseDataSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(encodeFlag?: boolean): SchemaType;
- toJSON(): ResponseDataJson;
- }
- declare const TBS_RESPONSE_DATA = "tbsResponseData";
- declare const SIGNATURE_ALGORITHM$4 = "signatureAlgorithm";
- declare const SIGNATURE$3 = "signature";
- declare const CERTS$2 = "certs";
- interface IBasicOCSPResponse {
- tbsResponseData: ResponseData;
- signatureAlgorithm: AlgorithmIdentifier;
- signature: asn1js.BitString;
- certs?: Certificate[];
- }
- interface CertificateStatus {
- isForCertificate: boolean;
- /**
- * 0 = good, 1 = revoked, 2 = unknown
- */
- status: number;
- }
- type BasicOCSPResponseParameters = PkiObjectParameters & Partial<IBasicOCSPResponse>;
- interface BasicOCSPResponseVerifyParams {
- trustedCerts?: Certificate[];
- }
- interface BasicOCSPResponseJson {
- tbsResponseData: ResponseDataJson;
- signatureAlgorithm: AlgorithmIdentifierJson;
- signature: asn1js.BitStringJson;
- certs?: CertificateJson[];
- }
- /**
- * Represents the BasicOCSPResponse structure described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class BasicOCSPResponse extends PkiObject implements IBasicOCSPResponse {
- static CLASS_NAME: string;
- tbsResponseData: ResponseData;
- signatureAlgorithm: AlgorithmIdentifier;
- signature: asn1js.BitString;
- certs?: Certificate[];
- /**
- * Initializes a new instance of the {@link BasicOCSPResponse} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: BasicOCSPResponseParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TBS_RESPONSE_DATA): ResponseData;
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$4): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE$3): asn1js.BitString;
- static defaultValues(memberName: typeof CERTS$2): Certificate[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * BasicOCSPResponse ::= SEQUENCE {
- * tbsResponseData ResponseData,
- * signatureAlgorithm AlgorithmIdentifier,
- * signature BIT STRING,
- * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- tbsResponseData?: ResponseDataSchema;
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signature?: string;
- certs?: CertificateSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): BasicOCSPResponseJson;
- /**
- * Get OCSP response status for specific certificate
- * @param certificate Certificate to be checked
- * @param issuerCertificate Certificate of issuer for certificate to be checked
- * @param crypto Crypto engine
- */
- getCertificateStatus(certificate: Certificate, issuerCertificate: Certificate, crypto?: ICryptoEngine): Promise<CertificateStatus>;
- /**
- * Make signature for current OCSP Basic Response
- * @param privateKey Private key for "subjectPublicKeyInfo" structure
- * @param hashAlgorithm Hashing algorithm. Default SHA-1
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Verify existing OCSP Basic Response
- * @param params Additional parameters
- * @param crypto Crypto engine
- */
- verify(params?: BasicOCSPResponseVerifyParams, crypto?: ICryptoEngine): Promise<boolean>;
- }
- declare const CERTIFICATE_INDEX = "certificateIndex";
- declare const KEY_INDEX = "keyIndex";
- interface ICAVersion {
- certificateIndex: number;
- keyIndex: number;
- }
- type CAVersionParameters = PkiObjectParameters & Partial<ICAVersion>;
- interface CAVersionJson {
- certificateIndex: number;
- keyIndex: number;
- }
- /**
- * Represents an CAVersion described in [Certification Authority Renewal](https://docs.microsoft.com/en-us/windows/desktop/seccrypto/certification-authority-renewal)
- */
- declare class CAVersion extends PkiObject implements ICAVersion {
- static CLASS_NAME: string;
- certificateIndex: number;
- keyIndex: number;
- /**
- * Initializes a new instance of the {@link CAVersion} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CAVersionParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CERTIFICATE_INDEX): number;
- static defaultValues(memberName: typeof KEY_INDEX): number;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CAVersion ::= INTEGER
- *```
- */
- static schema(): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Integer;
- toJSON(): CAVersionJson;
- }
- declare const CRL_ID = "crlId";
- declare const CRL_VALUE = "crlValue";
- declare const PARSED_VALUE$3 = "parsedValue";
- interface ICRLBag {
- crlId: string;
- crlValue: any;
- parsedValue?: any;
- certValue?: any;
- }
- interface CRLBagJson {
- crlId: string;
- crlValue: any;
- }
- type CRLBagParameters = PkiObjectParameters & Partial<ICRLBag>;
- /**
- * Represents the CRLBag structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class CRLBag extends PkiObject implements ICRLBag {
- static CLASS_NAME: string;
- crlId: string;
- crlValue: any;
- parsedValue?: any;
- certValue?: any;
- /**
- * Initializes a new instance of the {@link CRLBag} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CRLBagParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CRL_ID): string;
- static defaultValues(memberName: typeof CRL_VALUE): any;
- static defaultValues(memberName: typeof PARSED_VALUE$3): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CRLBag ::= SEQUENCE {
- * crlId BAG-TYPE.&id ({CRLTypes}),
- * crlValue [0] EXPLICIT BAG-TYPE.&Type ({CRLTypes}{@crlId})
- *}
- *```
- */
- static schema(parameters?: SchemaParameters<{
- id?: string;
- value?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): CRLBagJson;
- }
- declare const DISTRIBUTION_POINT$1 = "distributionPoint";
- declare const ONLY_CONTAINS_USER_CERTS = "onlyContainsUserCerts";
- declare const ONLY_CONTAINS_CA_CERTS = "onlyContainsCACerts";
- declare const ONLY_SOME_REASON = "onlySomeReasons";
- declare const INDIRECT_CRL = "indirectCRL";
- declare const ONLY_CONTAINS_ATTRIBUTE_CERTS = "onlyContainsAttributeCerts";
- interface IIssuingDistributionPoint {
- distributionPoint?: DistributionPointName;
- onlyContainsUserCerts: boolean;
- onlyContainsCACerts: boolean;
- onlySomeReasons?: number;
- indirectCRL: boolean;
- onlyContainsAttributeCerts: boolean;
- }
- interface IssuingDistributionPointJson {
- distributionPoint?: DistributionPointNameJson;
- onlyContainsUserCerts?: boolean;
- onlyContainsCACerts?: boolean;
- onlySomeReasons?: number;
- indirectCRL?: boolean;
- onlyContainsAttributeCerts?: boolean;
- }
- type DistributionPointName = GeneralName[] | RelativeDistinguishedNames;
- type DistributionPointNameJson = GeneralNameJson[] | RelativeDistinguishedNamesJson;
- type IssuingDistributionPointParameters = PkiObjectParameters & Partial<IIssuingDistributionPoint>;
- /**
- * Represents the IssuingDistributionPoint structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class IssuingDistributionPoint extends PkiObject implements IIssuingDistributionPoint {
- static CLASS_NAME: string;
- distributionPoint?: DistributionPointName;
- onlyContainsUserCerts: boolean;
- onlyContainsCACerts: boolean;
- onlySomeReasons?: number;
- indirectCRL: boolean;
- onlyContainsAttributeCerts: boolean;
- /**
- * Initializes a new instance of the {@link IssuingDistributionPoint} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: IssuingDistributionPointParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof DISTRIBUTION_POINT$1): DistributionPointName;
- static defaultValues(memberName: typeof ONLY_CONTAINS_USER_CERTS): boolean;
- static defaultValues(memberName: typeof ONLY_CONTAINS_CA_CERTS): boolean;
- static defaultValues(memberName: typeof ONLY_SOME_REASON): number;
- static defaultValues(memberName: typeof INDIRECT_CRL): boolean;
- static defaultValues(memberName: typeof ONLY_CONTAINS_ATTRIBUTE_CERTS): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * IssuingDistributionPoint ::= SEQUENCE {
- * distributionPoint [0] DistributionPointName OPTIONAL,
- * onlyContainsUserCerts [1] BOOLEAN DEFAULT FALSE,
- * onlyContainsCACerts [2] BOOLEAN DEFAULT FALSE,
- * onlySomeReasons [3] ReasonFlags OPTIONAL,
- * indirectCRL [4] BOOLEAN DEFAULT FALSE,
- * onlyContainsAttributeCerts [5] BOOLEAN DEFAULT FALSE }
- *
- * ReasonFlags ::= BIT STRING {
- * unused (0),
- * keyCompromise (1),
- * cACompromise (2),
- * affiliationChanged (3),
- * superseded (4),
- * cessationOfOperation (5),
- * certificateHold (6),
- * privilegeWithdrawn (7),
- * aACompromise (8) }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- distributionPoint?: string;
- distributionPointNames?: string;
- onlyContainsUserCerts?: string;
- onlyContainsCACerts?: string;
- onlySomeReasons?: string;
- indirectCRL?: string;
- onlyContainsAttributeCerts?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): IssuingDistributionPointJson;
- }
- declare const DISTRIBUTION_POINT = "distributionPoint";
- declare const REASONS = "reasons";
- declare const CRL_ISSUER = "cRLIssuer";
- interface IDistributionPoint {
- distributionPoint?: DistributionPointName;
- reasons?: asn1js.BitString;
- cRLIssuer?: GeneralName[];
- }
- interface DistributionPointJson {
- distributionPoint?: DistributionPointNameJson;
- reasons?: asn1js.BitStringJson;
- cRLIssuer?: GeneralNameJson[];
- }
- type DistributionPointParameters = PkiObjectParameters & Partial<IDistributionPoint>;
- /**
- * Represents the DistributionPoint structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class DistributionPoint extends PkiObject implements IDistributionPoint {
- static CLASS_NAME: string;
- distributionPoint?: DistributionPointName;
- reasons?: asn1js.BitString;
- cRLIssuer?: GeneralName[];
- /**
- * Initializes a new instance of the {@link DistributionPoint} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: DistributionPointParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof DISTRIBUTION_POINT): DistributionPointName;
- static defaultValues(memberName: typeof REASONS): asn1js.BitString;
- static defaultValues(memberName: typeof CRL_ISSUER): GeneralName[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * DistributionPoint ::= SEQUENCE {
- * distributionPoint [0] DistributionPointName OPTIONAL,
- * reasons [1] ReasonFlags OPTIONAL,
- * cRLIssuer [2] GeneralNames OPTIONAL }
- *
- * DistributionPointName ::= CHOICE {
- * fullName [0] GeneralNames,
- * nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
- *
- * ReasonFlags ::= BIT STRING {
- * unused (0),
- * keyCompromise (1),
- * cACompromise (2),
- * affiliationChanged (3),
- * superseded (4),
- * cessationOfOperation (5),
- * certificateHold (6),
- * privilegeWithdrawn (7),
- * aACompromise (8) }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- distributionPoint?: string;
- distributionPointNames?: string;
- reasons?: string;
- cRLIssuer?: string;
- cRLIssuerNames?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): DistributionPointJson;
- }
- interface ICRLDistributionPoints {
- distributionPoints: DistributionPoint[];
- }
- interface CRLDistributionPointsJson {
- distributionPoints: DistributionPointJson[];
- }
- type CRLDistributionPointsParameters = PkiObjectParameters & Partial<ICRLDistributionPoints>;
- /**
- * Represents the CRLDistributionPoints structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class CRLDistributionPoints extends PkiObject implements ICRLDistributionPoints {
- static CLASS_NAME: string;
- distributionPoints: DistributionPoint[];
- /**
- * Initializes a new instance of the {@link CRLDistributionPoints} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CRLDistributionPointsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: string): DistributionPoint[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
- *```
- */
- static schema(parameters?: SchemaParameters<{
- distributionPoints?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): CRLDistributionPointsJson;
- }
- declare const CERT_ID = "certId";
- declare const CERT_VALUE = "certValue";
- declare const PARSED_VALUE$2 = "parsedValue";
- interface ICertBag {
- certId: string;
- certValue: asn1js.OctetString | PkiObject;
- parsedValue: any;
- }
- type CertBagParameters = PkiObjectParameters & Partial<ICertBag>;
- interface CertBagJson {
- certId: string;
- certValue: any;
- }
- /**
- * Represents the CertBag structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class CertBag extends PkiObject implements ICertBag {
- static CLASS_NAME: string;
- certId: string;
- certValue: PkiObject | asn1js.OctetString;
- parsedValue: any;
- /**
- * Initializes a new instance of the {@link CertBag} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertBagParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CERT_ID): string;
- static defaultValues(memberName: typeof CERT_VALUE): any;
- static defaultValues(memberName: typeof PARSED_VALUE$2): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CertBag ::= SEQUENCE {
- * certId BAG-TYPE.&id ({CertTypes}),
- * certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- id?: string;
- value?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): CertBagJson;
- }
- declare const BASE = "base";
- declare const MINIMUM = "minimum";
- declare const MAXIMUM = "maximum";
- interface IGeneralSubtree {
- base: GeneralName;
- minimum: number | asn1js.Integer;
- maximum?: number | asn1js.Integer;
- }
- interface GeneralSubtreeJson {
- base: GeneralNameJson;
- minimum?: number | asn1js.IntegerJson;
- maximum?: number | asn1js.IntegerJson;
- }
- type GeneralSubtreeParameters = PkiObjectParameters & Partial<IGeneralSubtree>;
- /**
- * Represents the GeneralSubtree structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class GeneralSubtree extends PkiObject implements IGeneralSubtree {
- static CLASS_NAME: string;
- base: GeneralName;
- minimum: number | asn1js.Integer;
- maximum?: number | asn1js.Integer;
- /**
- * Initializes a new instance of the {@link GeneralSubtree} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: GeneralSubtreeParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof BASE): GeneralName;
- static defaultValues(memberName: typeof MINIMUM): number;
- static defaultValues(memberName: typeof MAXIMUM): number;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * GeneralSubtree ::= SEQUENCE {
- * base GeneralName,
- * minimum [0] BaseDistance DEFAULT 0,
- * maximum [1] BaseDistance OPTIONAL }
- *
- * BaseDistance ::= INTEGER (0..MAX)
- *```
- */
- static schema(parameters?: SchemaParameters<{
- base?: GeneralNameSchema;
- minimum?: string;
- maximum?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): GeneralSubtreeJson;
- }
- declare const TRUSTED_CERTS = "trustedCerts";
- declare const CERTS$1 = "certs";
- declare const CRLS$1 = "crls";
- declare const OCSPS$1 = "ocsps";
- declare const CHECK_DATE = "checkDate";
- declare const FIND_ORIGIN = "findOrigin";
- declare const FIND_ISSUER = "findIssuer";
- declare enum ChainValidationCode {
- unknown = -1,
- success = 0,
- noRevocation = 11,
- noPath = 60,
- noValidPath = 97
- }
- declare class ChainValidationError extends Error {
- static readonly NAME = "ChainValidationError";
- code: ChainValidationCode;
- constructor(code: ChainValidationCode, message: string);
- }
- interface CertificateChainValidationEngineVerifyResult {
- result: boolean;
- resultCode: number;
- resultMessage: string;
- error?: Error | ChainValidationError;
- authConstrPolicies?: string[];
- userConstrPolicies?: string[];
- explicitPolicyIndicator?: boolean;
- policyMappings?: string[];
- certificatePath?: Certificate[];
- }
- type FindOriginCallback = (certificate: Certificate, validationEngine: CertificateChainValidationEngine) => string;
- type FindIssuerCallback = (certificate: Certificate, validationEngine: CertificateChainValidationEngine, crypto?: ICryptoEngine) => Promise<Certificate[]>;
- interface CertificateChainValidationEngineParameters {
- trustedCerts?: Certificate[];
- certs?: Certificate[];
- crls?: CertificateRevocationList[];
- ocsps?: BasicOCSPResponse[];
- checkDate?: Date;
- findOrigin?: FindOriginCallback;
- findIssuer?: FindIssuerCallback;
- }
- interface CertificateChainValidationEngineVerifyParams {
- initialPolicySet?: string[];
- initialExplicitPolicy?: boolean;
- initialPolicyMappingInhibit?: boolean;
- initialInhibitPolicy?: boolean;
- initialPermittedSubtreesSet?: GeneralSubtree[];
- initialExcludedSubtreesSet?: GeneralSubtree[];
- initialRequiredNameForms?: GeneralSubtree[];
- passedWhenNotRevValues?: boolean;
- }
- /**
- * Represents a chain-building engine for {@link Certificate} certificates.
- *
- * @example
- * ```js The following example demonstrates how to verify certificate chain
- * const rootCa = pkijs.Certificate.fromBER(certRaw1);
- * const intermediateCa = pkijs.Certificate.fromBER(certRaw2);
- * const leafCert = pkijs.Certificate.fromBER(certRaw3);
- * const crl1 = pkijs.CertificateRevocationList.fromBER(crlRaw1);
- * const ocsp1 = pkijs.BasicOCSPResponse.fromBER(ocspRaw1);
- *
- * const chainEngine = new pkijs.CertificateChainValidationEngine({
- * certs: [rootCa, intermediateCa, leafCert],
- * crls: [crl1],
- * ocsps: [ocsp1],
- * checkDate: new Date("2015-07-13"), // optional
- * trustedCerts: [rootCa],
- * });
- *
- * const chain = await chainEngine.verify();
- * ```
- */
- declare class CertificateChainValidationEngine {
- /**
- * Array of pre-defined trusted (by user) certificates
- */
- trustedCerts: Certificate[];
- /**
- * Array with certificate chain. Could be only one end-user certificate in there!
- */
- certs: Certificate[];
- /**
- * Array of all CRLs for all certificates from certificate chain
- */
- crls: CertificateRevocationList[];
- /**
- * Array of all OCSP responses
- */
- ocsps: BasicOCSPResponse[];
- /**
- * The date at which the check would be
- */
- checkDate: Date;
- /**
- * The date at which the check would be
- */
- findOrigin: FindOriginCallback;
- /**
- * The date at which the check would be
- */
- findIssuer: FindIssuerCallback;
- /**
- * Constructor for CertificateChainValidationEngine class
- * @param parameters
- */
- constructor(parameters?: CertificateChainValidationEngineParameters);
- static defaultFindOrigin(certificate: Certificate, validationEngine: CertificateChainValidationEngine): string;
- defaultFindIssuer(certificate: Certificate, validationEngine: CertificateChainValidationEngine, crypto?: ICryptoEngine): Promise<Certificate[]>;
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- defaultValues(memberName: typeof TRUSTED_CERTS): Certificate[];
- defaultValues(memberName: typeof CERTS$1): Certificate[];
- defaultValues(memberName: typeof CRLS$1): CertificateRevocationList[];
- defaultValues(memberName: typeof OCSPS$1): BasicOCSPResponse[];
- defaultValues(memberName: typeof CHECK_DATE): Date;
- defaultValues(memberName: typeof FIND_ORIGIN): FindOriginCallback;
- defaultValues(memberName: typeof FIND_ISSUER): FindIssuerCallback;
- sort(passedWhenNotRevValues?: boolean, crypto?: ICryptoEngine): Promise<Certificate[]>;
- /**
- * Major verification function for certificate chain.
- * @param parameters
- * @param crypto Crypto engine
- * @returns
- */
- verify(parameters?: CertificateChainValidationEngineVerifyParams, crypto?: ICryptoEngine): Promise<CertificateChainValidationEngineVerifyResult>;
- }
- declare const POLICY_QUALIFIER_ID = "policyQualifierId";
- declare const QUALIFIER = "qualifier";
- interface IPolicyQualifierInfo {
- policyQualifierId: string;
- qualifier: SchemaType;
- }
- type PolicyQualifierInfoParameters = PkiObjectParameters & Partial<IPolicyQualifierInfo>;
- interface PolicyQualifierInfoJson {
- policyQualifierId: string;
- qualifier: any;
- }
- /**
- * Represents the PolicyQualifierInfo structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PolicyQualifierInfo extends PkiObject implements IPolicyQualifierInfo {
- static CLASS_NAME: string;
- policyQualifierId: string;
- qualifier: SchemaType;
- /**
- * Initializes a new instance of the {@link PolicyQualifierInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PolicyQualifierInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof POLICY_QUALIFIER_ID): string;
- static defaultValues(memberName: typeof QUALIFIER): asn1js.Any;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PolicyQualifierInfo ::= SEQUENCE {
- * policyQualifierId PolicyQualifierId,
- * qualifier ANY DEFINED BY policyQualifierId }
- *
- * id-qt OBJECT IDENTIFIER ::= { id-pkix 2 }
- * id-qt-cps OBJECT IDENTIFIER ::= { id-qt 1 }
- * id-qt-unotice OBJECT IDENTIFIER ::= { id-qt 2 }
- *
- * PolicyQualifierId ::= OBJECT IDENTIFIER ( id-qt-cps | id-qt-unotice )
- *```
- */
- static schema(parameters?: SchemaParameters<{
- policyQualifierId?: string;
- qualifier?: string;
- }>): asn1js.Sequence;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PolicyQualifierInfoJson;
- }
- declare const POLICY_IDENTIFIER = "policyIdentifier";
- declare const POLICY_QUALIFIERS = "policyQualifiers";
- interface IPolicyInformation {
- policyIdentifier: string;
- policyQualifiers?: PolicyQualifierInfo[];
- }
- type PolicyInformationParameters = PkiObjectParameters & Partial<IPolicyInformation>;
- interface PolicyInformationJson {
- policyIdentifier: string;
- policyQualifiers?: PolicyQualifierInfoJson[];
- }
- /**
- * Represents the PolicyInformation structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PolicyInformation extends PkiObject implements IPolicyInformation {
- static CLASS_NAME: string;
- policyIdentifier: string;
- policyQualifiers?: PolicyQualifierInfo[];
- /**
- * Initializes a new instance of the {@link PolicyInformation} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PolicyInformationParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof POLICY_IDENTIFIER): string;
- static defaultValues(memberName: typeof POLICY_QUALIFIERS): PolicyQualifierInfo[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PolicyInformation ::= SEQUENCE {
- * policyIdentifier CertPolicyId,
- * policyQualifiers SEQUENCE SIZE (1..MAX) OF
- * PolicyQualifierInfo OPTIONAL }
- *
- * CertPolicyId ::= OBJECT IDENTIFIER
- *```
- */
- static schema(parameters?: SchemaParameters<{
- policyIdentifier?: string;
- policyQualifiers?: string;
- }>): SchemaType;
- /**
- * Converts parsed ASN.1 object into current class
- * @param schema
- */
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PolicyInformationJson;
- }
- declare const CERTIFICATE_POLICIES = "certificatePolicies";
- interface ICertificatePolicies {
- certificatePolicies: PolicyInformation[];
- }
- type CertificatePoliciesParameters = PkiObjectParameters & Partial<ICertificatePolicies>;
- interface CertificatePoliciesJson {
- certificatePolicies: PolicyInformationJson[];
- }
- /**
- * Represents the CertificatePolicies structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class CertificatePolicies extends PkiObject implements ICertificatePolicies {
- static CLASS_NAME: string;
- certificatePolicies: PolicyInformation[];
- /**
- * Initializes a new instance of the {@link CertificatePolicies} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertificatePoliciesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof CERTIFICATE_POLICIES): PolicyInformation[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
- *```
- */
- static schema(parameters?: SchemaParameters<{
- certificatePolicies?: string;
- }>): asn1js.Sequence;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): CertificatePoliciesJson;
- }
- declare const TEMPLATE_ID = "templateID";
- declare const TEMPLATE_MAJOR_VERSION = "templateMajorVersion";
- declare const TEMPLATE_MINOR_VERSION = "templateMinorVersion";
- interface ICertificateTemplate {
- templateID: string;
- templateMajorVersion?: number;
- templateMinorVersion?: number;
- }
- interface CertificateTemplateJson {
- templateID: string;
- templateMajorVersion?: number;
- templateMinorVersion?: number;
- }
- type CertificateTemplateParameters = PkiObjectParameters & Partial<ICertificateTemplate>;
- /**
- * Class from "[MS-WCCE]: Windows Client Certificate Enrollment Protocol"
- */
- declare class CertificateTemplate extends PkiObject implements ICertificateTemplate {
- templateID: string;
- templateMajorVersion?: number;
- templateMinorVersion?: number;
- /**
- * Initializes a new instance of the {@link CertificateTemplate} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertificateTemplateParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TEMPLATE_MINOR_VERSION): number;
- static defaultValues(memberName: typeof TEMPLATE_MAJOR_VERSION): number;
- static defaultValues(memberName: typeof TEMPLATE_ID): string;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CertificateTemplateOID ::= SEQUENCE {
- * templateID OBJECT IDENTIFIER,
- * templateMajorVersion INTEGER (0..4294967295) OPTIONAL,
- * templateMinorVersion INTEGER (0..4294967295) OPTIONAL
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- templateID?: string;
- templateMajorVersion?: string;
- templateMinorVersion?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): CertificateTemplateJson;
- }
- declare const TBS$1 = "tbs";
- declare const VERSION$9 = "version";
- declare const SUBJECT = "subject";
- declare const SPKI = "subjectPublicKeyInfo";
- declare const ATTRIBUTES$2 = "attributes";
- declare const SIGNATURE_ALGORITHM$3 = "signatureAlgorithm";
- declare const SIGNATURE_VALUE = "signatureValue";
- interface ICertificationRequest {
- /**
- * Value being signed
- */
- tbs: ArrayBuffer;
- /**
- * Version number. It should be 0
- */
- version: number;
- /**
- * Distinguished name of the certificate subject
- */
- subject: RelativeDistinguishedNames;
- /**
- * Information about the public key being certified
- */
- subjectPublicKeyInfo: PublicKeyInfo;
- /**
- * Collection of attributes providing additional information about the subject of the certificate
- */
- attributes?: Attribute[];
- /**
- * signature algorithm (and any associated parameters) under which the certification-request information is signed
- */
- signatureAlgorithm: AlgorithmIdentifier;
- /**
- * result of signing the certification request information with the certification request subject's private key
- */
- signatureValue: asn1js.BitString;
- }
- /**
- * JSON representation of {@link CertificationRequest}
- */
- interface CertificationRequestJson {
- tbs: string;
- version: number;
- subject: RelativeDistinguishedNamesJson;
- subjectPublicKeyInfo: PublicKeyInfoJson | JsonWebKey;
- attributes?: AttributeJson[];
- signatureAlgorithm: AlgorithmIdentifierJson;
- signatureValue: asn1js.BitStringJson;
- }
- interface CertificationRequestInfoParameters {
- names?: {
- blockName?: string;
- CertificationRequestInfo?: string;
- CertificationRequestInfoVersion?: string;
- subject?: RelativeDistinguishedNamesSchema;
- CertificationRequestInfoAttributes?: string;
- attributes?: AttributeSchema;
- };
- }
- type CertificationRequestParameters = PkiObjectParameters & Partial<ICertificationRequest>;
- /**
- * Represents the CertificationRequest structure described in [RFC2986](https://datatracker.ietf.org/doc/html/rfc2986)
- *
- * @example The following example demonstrates how to parse PKCS#11 certification request
- * and verify its challenge password extension and signature value
- * ```js
- * const pkcs10 = pkijs.CertificationRequest.fromBER(pkcs10Raw);
- *
- * // Get and validate challenge password extension
- * if (pkcs10.attributes) {
- * const attrExtensions = pkcs10.attributes.find(o => o.type === "1.2.840.113549.1.9.14"); // pkcs-9-at-extensionRequest
- * if (attrExtensions) {
- * const extensions = new pkijs.Extensions({ schema: attrExtensions.values[0] });
- * for (const extension of extensions.extensions) {
- * if (extension.extnID === "1.2.840.113549.1.9.7") { // pkcs-9-at-challengePassword
- * const asn = asn1js.fromBER(extension.extnValue.valueBlock.valueHex);
- * if (asn.result.valueBlock.value !== "passwordChallenge") {
- * throw new Error("PKCS#11 certification request is invalid. Challenge password is incorrect");
- * }
- * }
- * }
- * }
- * }
- *
- * // Verify signature value
- * const ok = await pkcs10.verify();
- * if (!ok) {
- * throw Error("PKCS#11 certification request is invalid. Signature is wrong")
- * }
- * ```
- *
- * @example The following example demonstrates how to create PKCS#11 certification request
- * ```js
- * // Get a "crypto" extension
- * const crypto = pkijs.getCrypto(true);
- *
- * const pkcs10 = new pkijs.CertificationRequest();
- *
- * pkcs10.subject.typesAndValues.push(new pkijs.AttributeTypeAndValue({
- * type: "2.5.4.3",
- * value: new asn1js.Utf8String({ value: "Test" })
- * }));
- *
- *
- * await pkcs10.subjectPublicKeyInfo.importKey(keys.publicKey);
- *
- * pkcs10.attributes = [];
- *
- * // Subject Alternative Name
- * const altNames = new pkijs.GeneralNames({
- * names: [
- * new pkijs.GeneralName({ // email
- * type: 1,
- * value: "email@address.com"
- * }),
- * new pkijs.GeneralName({ // domain
- * type: 2,
- * value: "www.domain.com"
- * }),
- * ]
- * });
- *
- * // SubjectKeyIdentifier
- * const subjectKeyIdentifier = await crypto.digest({ name: "SHA-1" }, pkcs10.subjectPublicKeyInfo.subjectPublicKey.valueBlock.valueHex);
- *
- * pkcs10.attributes.push(new pkijs.Attribute({
- * type: "1.2.840.113549.1.9.14", // pkcs-9-at-extensionRequest
- * values: [(new pkijs.Extensions({
- * extensions: [
- * new pkijs.Extension({
- * extnID: "2.5.29.14", // id-ce-subjectKeyIdentifier
- * critical: false,
- * extnValue: (new asn1js.OctetString({ valueHex: subjectKeyIdentifier })).toBER(false)
- * }),
- * new pkijs.Extension({
- * extnID: "2.5.29.17", // id-ce-subjectAltName
- * critical: false,
- * extnValue: altNames.toSchema().toBER(false)
- * }),
- * new pkijs.Extension({
- * extnID: "1.2.840.113549.1.9.7", // pkcs-9-at-challengePassword
- * critical: false,
- * extnValue: (new asn1js.PrintableString({ value: "passwordChallenge" })).toBER(false)
- * })
- * ]
- * })).toSchema()]
- * }));
- *
- * // Signing final PKCS#10 request
- * await pkcs10.sign(keys.privateKey, "SHA-256");
- *
- * const pkcs10Raw = pkcs10.toSchema(true).toBER();
- * ```
- */
- declare class CertificationRequest extends PkiObject implements ICertificationRequest {
- static CLASS_NAME: string;
- tbsView: Uint8Array;
- /**
- * @deprecated Since version 3.0.0
- */
- get tbs(): ArrayBuffer;
- /**
- * @deprecated Since version 3.0.0
- */
- set tbs(value: ArrayBuffer);
- version: number;
- subject: RelativeDistinguishedNames;
- subjectPublicKeyInfo: PublicKeyInfo;
- attributes?: Attribute[];
- signatureAlgorithm: AlgorithmIdentifier;
- signatureValue: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link CertificationRequest} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: CertificationRequestParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TBS$1): ArrayBuffer;
- static defaultValues(memberName: typeof VERSION$9): number;
- static defaultValues(memberName: typeof SUBJECT): RelativeDistinguishedNames;
- static defaultValues(memberName: typeof SPKI): PublicKeyInfo;
- static defaultValues(memberName: typeof ATTRIBUTES$2): Attribute[];
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$3): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE_VALUE): asn1js.BitString;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * CertificationRequest ::= SEQUENCE {
- * certificationRequestInfo CertificationRequestInfo,
- * signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},
- * signature BIT STRING
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- certificationRequestInfo?: CertificationRequestInfoParameters;
- signatureAlgorithm?: string;
- signatureValue?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- /**
- * Aux function making ASN1js Sequence from current TBS
- * @returns
- */
- protected encodeTBS(): asn1js.Sequence;
- toSchema(encodeFlag?: boolean): asn1js.Sequence;
- toJSON(): CertificationRequestJson;
- /**
- * Makes signature for current certification request
- * @param privateKey WebCrypto private key
- * @param hashAlgorithm String representing current hashing algorithm
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Verify existing certification request signature
- * @param crypto Crypto engine
- * @returns Returns `true` if signature value is valid, otherwise `false`
- */
- verify(crypto?: ICryptoEngine): Promise<boolean>;
- /**
- * Importing public key for current certificate request
- * @param parameters
- * @param crypto Crypto engine
- * @returns WebCrypt public key
- */
- getPublicKey(parameters?: CryptoEnginePublicKeyParams, crypto?: ICryptoEngine): Promise<CryptoKey>;
- }
- declare abstract class AbstractCryptoEngine implements ICryptoEngine {
- name: string;
- crypto: Crypto;
- subtle: SubtleCrypto;
- /**
- * Constructor for CryptoEngine class
- * @param parameters
- */
- constructor(parameters: CryptoEngineParameters);
- abstract getOIDByAlgorithm(algorithm: Algorithm, safety?: boolean, target?: string): string;
- abstract getAlgorithmParameters(algorithmName: string, operation: CryptoEngineAlgorithmOperation): CryptoEngineAlgorithmParams;
- abstract getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety?: boolean, target?: string): object | T;
- abstract getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety: true, target?: string): T;
- abstract getAlgorithmByOID(oid: any, safety?: any, target?: any): object;
- abstract getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string;
- abstract getSignatureParameters(privateKey: CryptoKey, hashAlgorithm?: string): Promise<CryptoEngineSignatureParams>;
- abstract signWithPrivateKey(data: BufferSource, privateKey: CryptoKey, parameters: CryptoEngineSignWithPrivateKeyParams): Promise<ArrayBuffer>;
- abstract verifyWithPublicKey(data: BufferSource, signature: BitString | OctetString, publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier, shaAlgorithm?: string): Promise<boolean>;
- abstract getPublicKey(publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier, parameters?: CryptoEnginePublicKeyParams): Promise<CryptoKey>;
- abstract encryptEncryptedContentInfo(parameters: CryptoEngineEncryptParams): Promise<EncryptedContentInfo>;
- abstract decryptEncryptedContentInfo(parameters: CryptoEngineDecryptParams): Promise<ArrayBuffer>;
- abstract stampDataWithPassword(parameters: CryptoEngineStampDataWithPasswordParams): Promise<ArrayBuffer>;
- abstract verifyDataStampedWithPassword(parameters: CryptoEngineVerifyDataStampedWithPasswordParams): Promise<boolean>;
- encrypt(algorithm: globalThis.AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
- decrypt(algorithm: globalThis.AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
- sign(algorithm: globalThis.AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
- verify(algorithm: globalThis.AlgorithmIdentifier | RsaPssParams | EcdsaParams, key: CryptoKey, signature: BufferSource, data: BufferSource): Promise<boolean>;
- digest(algorithm: globalThis.AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
- generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
- generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
- generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- generateKey(algorithm: globalThis.AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
- deriveKey(algorithm: globalThis.AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: globalThis.AlgorithmIdentifier | HkdfParams | Pbkdf2Params | AesDerivedKeyParams | HmacImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- deriveKey(algorithm: globalThis.AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: globalThis.AlgorithmIdentifier | HkdfParams | Pbkdf2Params | AesDerivedKeyParams | HmacImportParams, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
- deriveBits(algorithm: globalThis.AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
- wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: globalThis.AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams): Promise<ArrayBuffer>;
- unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: globalThis.AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: globalThis.AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: globalThis.AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: globalThis.AlgorithmIdentifier | HmacImportParams | RsaHashedImportParams | EcKeyImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
- exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
- exportKey(format: "pkcs8" | "raw" | "spki", key: CryptoKey): Promise<ArrayBuffer>;
- importKey(format: "jwk", keyData: JsonWebKey, algorithm: globalThis.AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- importKey(format: "pkcs8" | "raw" | "spki", keyData: BufferSource, algorithm: globalThis.AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- importKey(format: "jwk", keyData: JsonWebKey, algorithm: globalThis.AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- importKey(format: "pkcs8" | "raw" | "spki", keyData: BufferSource, algorithm: globalThis.AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
- getRandomValues<T extends ArrayBufferView | null>(array: T): T;
- }
- /**
- * Default cryptographic engine for Web Cryptography API
- */
- declare class CryptoEngine extends AbstractCryptoEngine {
- importKey(format: KeyFormat, keyData: BufferSource | JsonWebKey, algorithm: globalThis.AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
- /**
- * Export WebCrypto keys to different formats
- * @param format
- * @param key
- */
- exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
- exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
- exportKey(format: string, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
- /**
- * Convert WebCrypto keys between different export formats
- * @param inputFormat
- * @param outputFormat
- * @param keyData
- * @param algorithm
- * @param extractable
- * @param keyUsages
- */
- convert(inputFormat: KeyFormat, outputFormat: KeyFormat, keyData: ArrayBuffer | JsonWebKey, algorithm: Algorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<ArrayBuffer | JsonWebKey>;
- /**
- * Gets WebCrypto algorithm by wel-known OID
- * @param oid algorithm identifier
- * @param safety if `true` throws exception on unknown algorithm identifier
- * @param target name of the target
- * @returns Returns WebCrypto algorithm or an empty object
- */
- getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety?: boolean, target?: string): T | object;
- /**
- * Gets WebCrypto algorithm by wel-known OID
- * @param oid algorithm identifier
- * @param safety if `true` throws exception on unknown algorithm identifier
- * @param target name of the target
- * @returns Returns WebCrypto algorithm
- * @throws Throws {@link Error} exception if unknown algorithm identifier
- */
- getAlgorithmByOID<T extends Algorithm = Algorithm>(oid: string, safety: true, target?: string): T;
- getOIDByAlgorithm(algorithm: Algorithm, safety?: boolean, target?: string): string;
- getAlgorithmParameters(algorithmName: string, operation: CryptoEngineAlgorithmOperation): CryptoEngineAlgorithmParams;
- /**
- * Getting hash algorithm by signature algorithm
- * @param signatureAlgorithm Signature algorithm
- */
- getHashAlgorithm(signatureAlgorithm: AlgorithmIdentifier): string;
- encryptEncryptedContentInfo(parameters: CryptoEngineEncryptParams): Promise<EncryptedContentInfo>;
- /**
- * Decrypt data stored in "EncryptedContentInfo" object using parameters
- * @param parameters
- */
- decryptEncryptedContentInfo(parameters: CryptoEngineDecryptParams): Promise<ArrayBuffer>;
- stampDataWithPassword(parameters: CryptoEngineStampDataWithPasswordParams): Promise<ArrayBuffer>;
- verifyDataStampedWithPassword(parameters: CryptoEngineVerifyDataStampedWithPasswordParams): Promise<boolean>;
- getSignatureParameters(privateKey: CryptoKey, hashAlgorithm?: string): Promise<CryptoEngineSignatureParams>;
- signWithPrivateKey(data: BufferSource, privateKey: CryptoKey, parameters: CryptoEngineSignWithPrivateKeyParams): Promise<ArrayBuffer>;
- fillPublicKeyParameters(publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier): CryptoEnginePublicKeyParams;
- getPublicKey(publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier, parameters?: CryptoEnginePublicKeyParams): Promise<CryptoKey>;
- verifyWithPublicKey(data: BufferSource, signature: asn1js.BitString | asn1js.OctetString, publicKeyInfo: PublicKeyInfo, signatureAlgorithm: AlgorithmIdentifier, shaAlgorithm?: string): Promise<boolean>;
- }
- declare const DIGEST_ALGORITHM$1 = "digestAlgorithm";
- declare const DIGEST = "digest";
- interface IDigestInfo {
- digestAlgorithm: AlgorithmIdentifier;
- digest: asn1js.OctetString;
- }
- interface DigestInfoJson {
- digestAlgorithm: AlgorithmIdentifierJson;
- digest: asn1js.OctetStringJson;
- }
- type DigestInfoParameters = PkiObjectParameters & Partial<IDigestInfo>;
- type DigestInfoSchema = SchemaParameters<{
- digestAlgorithm?: AlgorithmIdentifierSchema;
- digest?: string;
- }>;
- /**
- * Represents the DigestInfo structure described in [RFC3447](https://datatracker.ietf.org/doc/html/rfc3447)
- */
- declare class DigestInfo extends PkiObject implements IDigestInfo {
- static CLASS_NAME: string;
- digestAlgorithm: AlgorithmIdentifier;
- digest: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link DigestInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: DigestInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof DIGEST_ALGORITHM$1): AlgorithmIdentifier;
- static defaultValues(memberName: typeof DIGEST): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * DigestInfo ::= SEQUENCE {
- * digestAlgorithm DigestAlgorithmIdentifier,
- * digest Digest }
- *
- * Digest ::= OCTET STRING
- *```
- */
- static schema(parameters?: DigestInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): DigestInfoJson;
- }
- declare const KEY_INFO = "keyInfo";
- declare const ENTITY_U_INFO = "entityUInfo";
- declare const SUPP_PUB_INFO = "suppPubInfo";
- interface IECCCMSSharedInfo {
- keyInfo: AlgorithmIdentifier;
- entityUInfo?: asn1js.OctetString;
- suppPubInfo: asn1js.OctetString;
- }
- interface ECCCMSSharedInfoJson {
- keyInfo: AlgorithmIdentifierJson;
- entityUInfo?: asn1js.OctetStringJson;
- suppPubInfo: asn1js.OctetStringJson;
- }
- type ECCCMSSharedInfoParameters = PkiObjectParameters & Partial<IECCCMSSharedInfo>;
- /**
- * Represents the ECCCMSSharedInfo structure described in [RFC6318](https://datatracker.ietf.org/doc/html/rfc6318)
- */
- declare class ECCCMSSharedInfo extends PkiObject implements IECCCMSSharedInfo {
- static CLASS_NAME: string;
- keyInfo: AlgorithmIdentifier;
- entityUInfo?: asn1js.OctetString;
- suppPubInfo: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link ECCCMSSharedInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ECCCMSSharedInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof KEY_INFO): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENTITY_U_INFO): asn1js.OctetString;
- static defaultValues(memberName: typeof SUPP_PUB_INFO): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ECC-CMS-SharedInfo ::= SEQUENCE {
- * keyInfo AlgorithmIdentifier,
- * entityUInfo [0] EXPLICIT OCTET STRING OPTIONAL,
- * suppPubInfo [2] EXPLICIT OCTET STRING }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- keyInfo?: AlgorithmIdentifierSchema;
- entityUInfo?: string;
- suppPubInfo?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ECCCMSSharedInfoJson;
- }
- interface ECNamedCurve {
- /**
- * The curve ASN.1 object identifier
- */
- id: string;
- /**
- * The name of the curve
- */
- name: string;
- /**
- * The coordinate length in bytes
- */
- size: number;
- }
- declare class ECNamedCurves {
- static readonly namedCurves: Record<string, ECNamedCurve>;
- /**
- * Registers an ECC named curve
- * @param name The name o the curve
- * @param id The curve ASN.1 object identifier
- * @param size The coordinate length in bytes
- */
- static register(name: string, id: string, size: number): void;
- /**
- * Returns an ECC named curve object
- * @param nameOrId Name or identifier of the named curve
- * @returns
- */
- static find(nameOrId: string): ECNamedCurve | null;
- }
- declare const VERSION$8 = "version";
- declare const PRIVATE_KEY = "privateKey";
- declare const NAMED_CURVE = "namedCurve";
- declare const PUBLIC_KEY$1 = "publicKey";
- interface IECPrivateKey {
- version: number;
- privateKey: asn1js.OctetString;
- namedCurve?: string;
- publicKey?: ECPublicKey;
- }
- type ECPrivateKeyParameters = PkiObjectParameters & Partial<IECPrivateKey> & {
- json?: ECPrivateKeyJson;
- };
- interface ECPrivateKeyJson {
- crv: string;
- y?: string;
- x?: string;
- d: string;
- }
- /**
- * Represents the PrivateKeyInfo structure described in [RFC5915](https://datatracker.ietf.org/doc/html/rfc5915)
- */
- declare class ECPrivateKey extends PkiObject implements IECPrivateKey {
- static CLASS_NAME: string;
- version: number;
- privateKey: asn1js.OctetString;
- namedCurve?: string;
- publicKey?: ECPublicKey;
- /**
- * Initializes a new instance of the {@link ECPrivateKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ECPrivateKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$8): 1;
- static defaultValues(memberName: typeof PRIVATE_KEY): asn1js.OctetString;
- static defaultValues(memberName: typeof NAMED_CURVE): string;
- static defaultValues(memberName: typeof PUBLIC_KEY$1): ECPublicKey;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ECPrivateKey ::= SEQUENCE {
- * version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
- * privateKey OCTET STRING,
- * parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
- * publicKey [1] BIT STRING OPTIONAL
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- privateKey?: string;
- namedCurve?: string;
- publicKey?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ECPrivateKeyJson;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: any): void;
- }
- declare const E_CONTENT_TYPE = "eContentType";
- declare const E_CONTENT = "eContent";
- interface IEncapsulatedContentInfo {
- eContentType: string;
- eContent?: asn1js.OctetString;
- }
- interface EncapsulatedContentInfoJson {
- eContentType: string;
- eContent?: asn1js.OctetStringJson;
- }
- type EncapsulatedContentInfoParameters = PkiObjectParameters & Partial<IEncapsulatedContentInfo>;
- type EncapsulatedContentInfoSchema = SchemaParameters<{
- eContentType?: string;
- eContent?: string;
- }>;
- /**
- * Represents the EncapsulatedContentInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class EncapsulatedContentInfo extends PkiObject implements IEncapsulatedContentInfo {
- static CLASS_NAME: string;
- eContentType: string;
- eContent?: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link EncapsulatedContentInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: EncapsulatedContentInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof E_CONTENT_TYPE): string;
- static defaultValues(memberName: typeof E_CONTENT): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * EncapsulatedContentInfo ::= SEQUENCE {
- * eContentType ContentType,
- * eContent [0] EXPLICIT OCTET STRING OPTIONAL } * Changed it to ANY, as in PKCS#7
- *```
- */
- static schema(parameters?: EncapsulatedContentInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): EncapsulatedContentInfoJson;
- }
- declare const KEY_PURPOSES = "keyPurposes";
- interface IExtKeyUsage {
- keyPurposes: string[];
- }
- interface ExtKeyUsageJson {
- keyPurposes: string[];
- }
- type ExtKeyUsageParameters = PkiObjectParameters & Partial<IExtKeyUsage>;
- /**
- * Represents the ExtKeyUsage structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class ExtKeyUsage extends PkiObject implements IExtKeyUsage {
- static CLASS_NAME: string;
- keyPurposes: string[];
- /**
- * Initializes a new instance of the {@link ExtKeyUsage} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ExtKeyUsageParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof KEY_PURPOSES): string[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ExtKeyUsage ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId
- *
- * KeyPurposeId ::= OBJECT IDENTIFIER
- *```
- */
- static schema(parameters?: SchemaParameters<{
- keyPurposes?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ExtKeyUsageJson;
- }
- /**
- * String preparation function. In a future here will be realization of algorithm from RFC4518
- * @param inputString JavaScript string. As soon as for each ASN.1 string type we have a specific
- * transformation function here we will work with pure JavaScript string
- * @returns Formatted string
- */
- declare function stringPrep(inputString: string): string;
- declare const ACCESS_DESCRIPTIONS = "accessDescriptions";
- interface IInfoAccess {
- accessDescriptions: AccessDescription[];
- }
- interface InfoAccessJson {
- accessDescriptions: AccessDescriptionJson[];
- }
- type InfoAccessParameters = PkiObjectParameters & Partial<IInfoAccess>;
- /**
- * Represents the InfoAccess structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class InfoAccess extends PkiObject implements IInfoAccess {
- static CLASS_NAME: string;
- accessDescriptions: AccessDescription[];
- /**
- * Initializes a new instance of the {@link InfoAccess} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: InfoAccessParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ACCESS_DESCRIPTIONS): AccessDescription[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * AuthorityInfoAccessSyntax ::=
- * SEQUENCE SIZE (1..MAX) OF AccessDescription
- *```
- */
- static schema(parameters?: SchemaParameters<{
- accessDescriptions?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): InfoAccessJson;
- }
- declare const PRIME = "prime";
- declare const EXPONENT = "exponent";
- declare const COEFFICIENT$1 = "coefficient";
- interface IOtherPrimeInfo {
- prime: asn1js.Integer;
- exponent: asn1js.Integer;
- coefficient: asn1js.Integer;
- }
- type OtherPrimeInfoParameters = PkiObjectParameters & Partial<IOtherPrimeInfo> & {
- json?: OtherPrimeInfoJson;
- };
- interface OtherPrimeInfoJson {
- r: string;
- d: string;
- t: string;
- }
- type OtherPrimeInfoSchema = SchemaParameters<{
- prime?: string;
- exponent?: string;
- coefficient?: string;
- }>;
- /**
- * Represents the OtherPrimeInfo structure described in [RFC3447](https://datatracker.ietf.org/doc/html/rfc3447)
- */
- declare class OtherPrimeInfo extends PkiObject implements IOtherPrimeInfo {
- static CLASS_NAME: string;
- prime: asn1js.Integer;
- exponent: asn1js.Integer;
- coefficient: asn1js.Integer;
- /**
- * Initializes a new instance of the {@link OtherPrimeInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OtherPrimeInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof PRIME | typeof EXPONENT | typeof COEFFICIENT$1): asn1js.Integer;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OtherPrimeInfo ::= Sequence {
- * prime Integer, -- ri
- * exponent Integer, -- di
- * coefficient Integer -- ti
- * }
- *```
- */
- static schema(parameters?: OtherPrimeInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OtherPrimeInfoJson;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: OtherPrimeInfoJson): void;
- }
- declare const VERSION$7 = "version";
- declare const MODULUS = "modulus";
- declare const PUBLIC_EXPONENT = "publicExponent";
- declare const PRIVATE_EXPONENT = "privateExponent";
- declare const PRIME1 = "prime1";
- declare const PRIME2 = "prime2";
- declare const EXPONENT1 = "exponent1";
- declare const EXPONENT2 = "exponent2";
- declare const COEFFICIENT = "coefficient";
- declare const OTHER_PRIME_INFOS = "otherPrimeInfos";
- interface IRSAPrivateKey {
- version: number;
- modulus: asn1js.Integer;
- publicExponent: asn1js.Integer;
- privateExponent: asn1js.Integer;
- prime1: asn1js.Integer;
- prime2: asn1js.Integer;
- exponent1: asn1js.Integer;
- exponent2: asn1js.Integer;
- coefficient: asn1js.Integer;
- otherPrimeInfos?: OtherPrimeInfo[];
- }
- type RSAPrivateKeyParameters = PkiObjectParameters & Partial<IRSAPrivateKey> & {
- json?: RSAPrivateKeyJson;
- };
- interface RSAPrivateKeyJson {
- n: string;
- e: string;
- d: string;
- p: string;
- q: string;
- dp: string;
- dq: string;
- qi: string;
- oth?: OtherPrimeInfoJson[];
- }
- /**
- * Represents the PrivateKeyInfo structure described in [RFC3447](https://datatracker.ietf.org/doc/html/rfc3447)
- */
- declare class RSAPrivateKey extends PkiObject implements IRSAPrivateKey {
- static CLASS_NAME: string;
- version: number;
- modulus: asn1js.Integer;
- publicExponent: asn1js.Integer;
- privateExponent: asn1js.Integer;
- prime1: asn1js.Integer;
- prime2: asn1js.Integer;
- exponent1: asn1js.Integer;
- exponent2: asn1js.Integer;
- coefficient: asn1js.Integer;
- otherPrimeInfos?: OtherPrimeInfo[];
- /**
- * Initializes a new instance of the {@link RSAPrivateKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RSAPrivateKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$7): number;
- static defaultValues(memberName: typeof MODULUS): asn1js.Integer;
- static defaultValues(memberName: typeof PUBLIC_EXPONENT): asn1js.Integer;
- static defaultValues(memberName: typeof PRIVATE_EXPONENT): asn1js.Integer;
- static defaultValues(memberName: typeof PRIME1): asn1js.Integer;
- static defaultValues(memberName: typeof PRIME2): asn1js.Integer;
- static defaultValues(memberName: typeof EXPONENT1): asn1js.Integer;
- static defaultValues(memberName: typeof EXPONENT2): asn1js.Integer;
- static defaultValues(memberName: typeof COEFFICIENT): asn1js.Integer;
- static defaultValues(memberName: typeof OTHER_PRIME_INFOS): OtherPrimeInfo[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RSAPrivateKey ::= Sequence {
- * version Version,
- * modulus Integer, -- n
- * publicExponent Integer, -- e
- * privateExponent Integer, -- d
- * prime1 Integer, -- p
- * prime2 Integer, -- q
- * exponent1 Integer, -- d mod (p-1)
- * exponent2 Integer, -- d mod (q-1)
- * coefficient Integer, -- (inverse of q) mod p
- * otherPrimeInfos OtherPrimeInfos OPTIONAL
- * }
- *
- * OtherPrimeInfos ::= Sequence SIZE(1..MAX) OF OtherPrimeInfo
- * ```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- modulus?: string;
- publicExponent?: string;
- privateExponent?: string;
- prime1?: string;
- prime2?: string;
- exponent1?: string;
- exponent2?: string;
- coefficient?: string;
- otherPrimeInfosName?: string;
- otherPrimeInfo?: OtherPrimeInfoSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RSAPrivateKeyJson;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: any): void;
- }
- interface IPrivateKeyInfo {
- version: number;
- privateKeyAlgorithm: AlgorithmIdentifier;
- privateKey: asn1js.OctetString;
- attributes?: Attribute[];
- parsedKey?: RSAPrivateKey | ECPrivateKey;
- }
- type PrivateKeyInfoParameters = PkiObjectParameters & Partial<IPrivateKeyInfo> & {
- json?: JsonWebKey;
- };
- interface PrivateKeyInfoJson {
- version: number;
- privateKeyAlgorithm: AlgorithmIdentifierJson;
- privateKey: asn1js.OctetStringJson;
- attributes?: AttributeJson[];
- }
- /**
- * Represents the PrivateKeyInfo structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5208)
- */
- declare class PrivateKeyInfo extends PkiObject implements IPrivateKeyInfo {
- static CLASS_NAME: string;
- version: number;
- privateKeyAlgorithm: AlgorithmIdentifier;
- privateKey: asn1js.OctetString;
- attributes?: Attribute[];
- parsedKey?: RSAPrivateKey | ECPrivateKey;
- /**
- * Initializes a new instance of the {@link PrivateKeyInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PrivateKeyInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: string): any;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PrivateKeyInfo ::= SEQUENCE {
- * version Version,
- * privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
- * privateKey PrivateKey,
- * attributes [0] Attributes OPTIONAL }
- *
- * Version ::= INTEGER {v1(0)} (v1,...)
- *
- * PrivateKey ::= OCTET STRING
- *
- * Attributes ::= SET OF Attribute
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- privateKeyAlgorithm?: AlgorithmIdentifierSchema;
- privateKey?: string;
- attributes?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PrivateKeyInfoJson | JsonWebKey;
- /**
- * Converts JSON value into current object
- * @param json JSON object
- */
- fromJSON(json: any): void;
- }
- /**
- * Class from RFC5208
- */
- declare class KeyBag extends PrivateKeyInfo {
- /**
- * Constructor for Attribute class
- * @param parameters
- */
- constructor(parameters?: {});
- }
- declare const MAC = "mac";
- declare const MAC_SALT = "macSalt";
- declare const ITERATIONS = "iterations";
- interface IMacData {
- mac: DigestInfo;
- macSalt: asn1js.OctetString;
- iterations?: number;
- }
- interface MacDataJson {
- mac: DigestInfoJson;
- macSalt: asn1js.OctetStringJson;
- iterations?: number;
- }
- type MacDataParameters = PkiObjectParameters & Partial<IMacData>;
- type MacDataSchema = SchemaParameters<{
- mac?: DigestInfoSchema;
- macSalt?: string;
- iterations?: string;
- }>;
- /**
- * Represents the MacData structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class MacData extends PkiObject implements IMacData {
- static CLASS_NAME: string;
- mac: DigestInfo;
- macSalt: asn1js.OctetString;
- iterations?: number;
- /**
- * Initializes a new instance of the {@link MacData} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: MacDataParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof MAC): DigestInfo;
- static defaultValues(memberName: typeof MAC_SALT): asn1js.OctetString;
- static defaultValues(memberName: typeof ITERATIONS): number;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * MacData ::= SEQUENCE {
- * mac DigestInfo,
- * macSalt OCTET STRING,
- * iterations INTEGER DEFAULT 1
- * -- Note: The default is for historical reasons and its use is
- * -- deprecated. A higher value, like 1024 is recommended.
- * }
- *```
- */
- static schema(parameters?: MacDataSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): MacDataJson;
- }
- declare const HASH_ALGORITHM$3 = "hashAlgorithm";
- declare const HASHED_MESSAGE = "hashedMessage";
- interface IMessageImprint {
- hashAlgorithm: AlgorithmIdentifier;
- hashedMessage: asn1js.OctetString;
- }
- interface MessageImprintJson {
- hashAlgorithm: AlgorithmIdentifierJson;
- hashedMessage: asn1js.OctetStringJson;
- }
- type MessageImprintParameters = PkiObjectParameters & Partial<IMessageImprint>;
- type MessageImprintSchema = SchemaParameters<{
- hashAlgorithm?: AlgorithmIdentifierSchema;
- hashedMessage?: string;
- }>;
- /**
- * Represents the MessageImprint structure described in [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- */
- declare class MessageImprint extends PkiObject implements IMessageImprint {
- static CLASS_NAME: string;
- /**
- * Creates and fills a new instance of {@link MessageImprint}
- * @param hashAlgorithm
- * @param message
- * @param crypto Crypto engine
- * @returns New instance of {@link MessageImprint}
- */
- static create(hashAlgorithm: string, message: BufferSource, crypto?: ICryptoEngine): Promise<MessageImprint>;
- hashAlgorithm: AlgorithmIdentifier;
- hashedMessage: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link MessageImprint} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: MessageImprintParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof HASH_ALGORITHM$3): AlgorithmIdentifier;
- static defaultValues(memberName: typeof HASHED_MESSAGE): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * MessageImprint ::= SEQUENCE {
- * hashAlgorithm AlgorithmIdentifier,
- * hashedMessage OCTET STRING }
- *```
- */
- static schema(parameters?: MessageImprintSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): MessageImprintJson;
- }
- declare const PERMITTED_SUBTREES = "permittedSubtrees";
- declare const EXCLUDED_SUBTREES = "excludedSubtrees";
- interface INameConstraints {
- permittedSubtrees?: GeneralSubtree[];
- excludedSubtrees?: GeneralSubtree[];
- }
- interface NameConstraintsJson {
- permittedSubtrees?: GeneralSubtreeJson[];
- excludedSubtrees?: GeneralSubtreeJson[];
- }
- type NameConstraintsParameters = PkiObjectParameters & Partial<INameConstraints>;
- /**
- * Represents the NameConstraints structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class NameConstraints extends PkiObject implements INameConstraints {
- static CLASS_NAME: string;
- permittedSubtrees?: GeneralSubtree[];
- excludedSubtrees?: GeneralSubtree[];
- /**
- * Initializes a new instance of the {@link NameConstraints} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: NameConstraintsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof PERMITTED_SUBTREES): GeneralSubtree[];
- static defaultValues(memberName: typeof EXCLUDED_SUBTREES): GeneralSubtree[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * NameConstraints ::= SEQUENCE {
- * permittedSubtrees [0] GeneralSubtrees OPTIONAL,
- * excludedSubtrees [1] GeneralSubtrees OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- permittedSubtrees?: string;
- excludedSubtrees?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): NameConstraintsJson;
- }
- declare const REQ_CERT = "reqCert";
- declare const SINGLE_REQUEST_EXTENSIONS = "singleRequestExtensions";
- interface IRequest {
- reqCert: CertID;
- singleRequestExtensions?: Extension[];
- }
- interface RequestJson {
- reqCert: CertIDJson;
- singleRequestExtensions?: ExtensionJson[];
- }
- type RequestParameters = PkiObjectParameters & Partial<IRequest>;
- type RequestSchema = SchemaParameters<{
- reqCert?: CertIDSchema;
- extensions?: ExtensionsSchema;
- singleRequestExtensions?: string;
- }>;
- /**
- * Represents an Request described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class Request extends PkiObject implements IRequest {
- static CLASS_NAME: string;
- reqCert: CertID;
- singleRequestExtensions?: Extension[];
- /**
- * Initializes a new instance of the {@link Request} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RequestParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof REQ_CERT): CertID;
- static defaultValues(memberName: typeof SINGLE_REQUEST_EXTENSIONS): Extension[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Request ::= SEQUENCE {
- * reqCert CertID,
- * singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
- *```
- */
- static schema(parameters?: RequestSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RequestJson;
- }
- declare const TBS = "tbs";
- declare const VERSION$6 = "version";
- declare const REQUESTOR_NAME = "requestorName";
- declare const REQUEST_LIST = "requestList";
- declare const REQUEST_EXTENSIONS = "requestExtensions";
- interface ITBSRequest {
- tbs: ArrayBuffer;
- version?: number;
- requestorName?: GeneralName;
- requestList: Request[];
- requestExtensions?: Extension[];
- }
- interface TBSRequestJson {
- tbs: string;
- version?: number;
- requestorName?: GeneralNameJson;
- requestList: RequestJson[];
- requestExtensions?: ExtensionJson[];
- }
- type TBSRequestParameters = PkiObjectParameters & Partial<ITBSRequest>;
- type TBSRequestSchema = SchemaParameters<{
- TBSRequestVersion?: string;
- requestorName?: GeneralNameSchema;
- requestList?: string;
- requests?: string;
- requestNames?: RequestSchema;
- extensions?: ExtensionsSchema;
- requestExtensions?: string;
- }>;
- /**
- * Represents the TBSRequest structure described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class TBSRequest extends PkiObject implements ITBSRequest {
- static CLASS_NAME: string;
- tbsView: Uint8Array;
- /**
- * @deprecated Since version 3.0.0
- */
- get tbs(): ArrayBuffer;
- /**
- * @deprecated Since version 3.0.0
- */
- set tbs(value: ArrayBuffer);
- version?: number;
- requestorName?: GeneralName;
- requestList: Request[];
- requestExtensions?: Extension[];
- /**
- * Initializes a new instance of the {@link TBSRequest} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: TBSRequestParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TBS): ArrayBuffer;
- static defaultValues(memberName: typeof VERSION$6): number;
- static defaultValues(memberName: typeof REQUESTOR_NAME): GeneralName;
- static defaultValues(memberName: typeof REQUEST_LIST): Request[];
- static defaultValues(memberName: typeof REQUEST_EXTENSIONS): Extension[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * TBSRequest ::= SEQUENCE {
- * version [0] EXPLICIT Version DEFAULT v1,
- * requestorName [1] EXPLICIT GeneralName OPTIONAL,
- * requestList SEQUENCE OF Request,
- * requestExtensions [2] EXPLICIT Extensions OPTIONAL }
- *```
- */
- static schema(parameters?: TBSRequestSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- /**
- * Convert current object to asn1js object and set correct values
- * @param encodeFlag If param equal to false then create TBS schema via decoding stored value. In othe case create TBS schema via assembling from TBS parts.
- * @returns asn1js object
- */
- toSchema(encodeFlag?: boolean): asn1js.Sequence;
- toJSON(): TBSRequestJson;
- }
- declare const SIGNATURE_ALGORITHM$2 = "signatureAlgorithm";
- declare const SIGNATURE$2 = "signature";
- declare const CERTS = "certs";
- interface ISignature {
- signatureAlgorithm: AlgorithmIdentifier;
- signature: asn1js.BitString;
- certs?: Certificate[];
- }
- interface SignatureJson {
- signatureAlgorithm: AlgorithmIdentifierJson;
- signature: asn1js.BitStringJson;
- certs?: CertificateJson[];
- }
- type SignatureParameters = PkiObjectParameters & Partial<ISignature>;
- type SignatureSchema = SchemaParameters<{
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signature?: string;
- certs?: string;
- }>;
- /**
- * Represents the Signature structure described in [RFC6960](https://datatracker.ietf.org/doc/html/rfc6960)
- */
- declare class Signature extends PkiObject implements ISignature {
- static CLASS_NAME: string;
- signatureAlgorithm: AlgorithmIdentifier;
- signature: asn1js.BitString;
- certs?: Certificate[];
- /**
- * Initializes a new instance of the {@link Signature} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SignatureParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$2): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE$2): asn1js.BitString;
- static defaultValues(memberName: typeof CERTS): Certificate[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * Signature ::= SEQUENCE {
- * signatureAlgorithm AlgorithmIdentifier,
- * signature BIT STRING,
- * certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
- *```
- */
- static schema(parameters?: SignatureSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SignatureJson;
- }
- declare const TBS_REQUEST = "tbsRequest";
- declare const OPTIONAL_SIGNATURE = "optionalSignature";
- interface IOCSPRequest {
- tbsRequest: TBSRequest;
- optionalSignature?: Signature;
- }
- interface OCSPRequestJson {
- tbsRequest: TBSRequestJson;
- optionalSignature?: SignatureJson;
- }
- type OCSPRequestParameters = PkiObjectParameters & Partial<IOCSPRequest>;
- /**
- * Represents an OCSP request described in [RFC6960 Section 4.1](https://datatracker.ietf.org/doc/html/rfc6960#section-4.1)
- *
- * @example The following example demonstrates how to create OCSP request
- * ```js
- * // Create OCSP request
- * const ocspReq = new pkijs.OCSPRequest();
- *
- * ocspReq.tbsRequest.requestorName = new pkijs.GeneralName({
- * type: 4,
- * value: cert.subject,
- * });
- *
- * await ocspReq.createForCertificate(cert, {
- * hashAlgorithm: "SHA-256",
- * issuerCertificate: issuerCert,
- * });
- *
- * const nonce = pkijs.getRandomValues(new Uint8Array(10));
- * ocspReq.tbsRequest.requestExtensions = [
- * new pkijs.Extension({
- * extnID: "1.3.6.1.5.5.7.48.1.2", // nonce
- * extnValue: new asn1js.OctetString({ valueHex: nonce.buffer }).toBER(),
- * })
- * ];
- *
- * // Encode OCSP request
- * const ocspReqRaw = ocspReq.toSchema(true).toBER();
- * ```
- */
- declare class OCSPRequest extends PkiObject implements IOCSPRequest {
- static CLASS_NAME: string;
- tbsRequest: TBSRequest;
- optionalSignature?: Signature;
- /**
- * Initializes a new instance of the {@link OCSPRequest} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OCSPRequestParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TBS_REQUEST): TBSRequest;
- static defaultValues(memberName: typeof OPTIONAL_SIGNATURE): Signature;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- * @returns Returns `true` if `memberValue` is equal to default value for selected class member
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OCSPRequest ::= SEQUENCE {
- * tbsRequest TBSRequest,
- * optionalSignature [0] EXPLICIT Signature OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- tbsRequest?: TBSRequestSchema;
- optionalSignature?: SignatureSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(encodeFlag?: boolean): asn1js.Sequence;
- toJSON(): OCSPRequestJson;
- /**
- * Making OCSP Request for specific certificate
- * @param certificate Certificate making OCSP Request for
- * @param parameters Additional parameters
- * @param crypto Crypto engine
- */
- createForCertificate(certificate: Certificate, parameters: CertIDCreateParams, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Make signature for current OCSP Request
- * @param privateKey Private key for "subjectPublicKeyInfo" structure
- * @param hashAlgorithm Hashing algorithm. Default SHA-1
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- verify(): void;
- }
- declare const RESPONSE_TYPE = "responseType";
- declare const RESPONSE = "response";
- interface IResponseBytes {
- responseType: string;
- response: asn1js.OctetString;
- }
- interface ResponseBytesJson {
- responseType: string;
- response: asn1js.OctetStringJson;
- }
- type ResponseBytesParameters = PkiObjectParameters & Partial<IResponseBytes>;
- type ResponseBytesSchema = SchemaParameters<{
- responseType?: string;
- response?: string;
- }>;
- /**
- * Class from RFC6960
- */
- declare class ResponseBytes extends PkiObject implements IResponseBytes {
- static CLASS_NAME: string;
- responseType: string;
- response: asn1js.OctetString;
- /**
- * Initializes a new instance of the {@link Request} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: ResponseBytesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof RESPONSE_TYPE): string;
- static defaultValues(memberName: typeof RESPONSE): asn1js.OctetString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * ResponseBytes ::= SEQUENCE {
- * responseType OBJECT IDENTIFIER,
- * response OCTET STRING }
- *```
- */
- static schema(parameters?: ResponseBytesSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): ResponseBytesJson;
- }
- declare const RESPONSE_STATUS = "responseStatus";
- declare const RESPONSE_BYTES = "responseBytes";
- interface IOCSPResponse {
- responseStatus: asn1js.Enumerated;
- responseBytes?: ResponseBytes;
- }
- interface OCSPResponseJson {
- responseStatus: asn1js.EnumeratedJson;
- responseBytes?: ResponseBytesJson;
- }
- type OCSPResponseParameters = PkiObjectParameters & Partial<IOCSPResponse>;
- /**
- * Represents an OCSP response described in [RFC6960 Section 4.2](https://datatracker.ietf.org/doc/html/rfc6960#section-4.2)
- *
- * @example The following example demonstrates how to verify OCSP response
- * ```js
- * const asnOcspResp = asn1js.fromBER(ocspRespRaw);
- * const ocspResp = new pkijs.OCSPResponse({ schema: asnOcspResp.result });
- *
- * if (!ocspResp.responseBytes) {
- * throw new Error("No \"ResponseBytes\" in the OCSP Response - nothing to verify");
- * }
- *
- * const asnOcspRespBasic = asn1js.fromBER(ocspResp.responseBytes.response.valueBlock.valueHex);
- * const ocspBasicResp = new pkijs.BasicOCSPResponse({ schema: asnOcspRespBasic.result });
- * const ok = await ocspBasicResp.verify({ trustedCerts: [cert] });
- * ```
- *
- * @example The following example demonstrates how to create OCSP response
- * ```js
- * const ocspBasicResp = new pkijs.BasicOCSPResponse();
- *
- * // Create specific TST info structure to sign
- * ocspBasicResp.tbsResponseData.responderID = issuerCert.subject;
- * ocspBasicResp.tbsResponseData.producedAt = new Date();
- *
- * const certID = new pkijs.CertID();
- * await certID.createForCertificate(cert, {
- * hashAlgorithm: "SHA-256",
- * issuerCertificate: issuerCert,
- * });
- * const response = new pkijs.SingleResponse({
- * certID,
- * });
- * response.certStatus = new asn1js.Primitive({
- * idBlock: {
- * tagClass: 3, // CONTEXT-SPECIFIC
- * tagNumber: 0 // [0]
- * },
- * lenBlockLength: 1 // The length contains one byte 0x00
- * }); // status - success
- * response.thisUpdate = new Date();
- *
- * ocspBasicResp.tbsResponseData.responses.push(response);
- *
- * // Add certificates for chain OCSP response validation
- * ocspBasicResp.certs = [issuerCert];
- *
- * await ocspBasicResp.sign(keys.privateKey, "SHA-256");
- *
- * // Finally create completed OCSP response structure
- * const ocspBasicRespRaw = ocspBasicResp.toSchema().toBER(false);
- *
- * const ocspResp = new pkijs.OCSPResponse({
- * responseStatus: new asn1js.Enumerated({ value: 0 }), // success
- * responseBytes: new pkijs.ResponseBytes({
- * responseType: pkijs.id_PKIX_OCSP_Basic,
- * response: new asn1js.OctetString({ valueHex: ocspBasicRespRaw }),
- * }),
- * });
- *
- * const ocspRespRaw = ocspResp.toSchema().toBER();
- * ```
- */
- declare class OCSPResponse extends PkiObject implements IOCSPResponse {
- static CLASS_NAME: string;
- responseStatus: asn1js.Enumerated;
- responseBytes?: ResponseBytes;
- /**
- * Initializes a new instance of the {@link OCSPResponse} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OCSPResponseParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof RESPONSE_STATUS): asn1js.Enumerated;
- static defaultValues(memberName: typeof RESPONSE_BYTES): ResponseBytes;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OCSPResponse ::= SEQUENCE {
- * responseStatus OCSPResponseStatus,
- * responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
- *
- * OCSPResponseStatus ::= ENUMERATED {
- * successful (0), -- Response has valid confirmations
- * malformedRequest (1), -- Illegal confirmation request
- * internalError (2), -- Internal error in issuer
- * tryLater (3), -- Try again later
- * -- (4) is not used
- * sigRequired (5), -- Must sign the request
- * unauthorized (6) -- Request unauthorized
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- responseStatus?: string;
- responseBytes?: ResponseBytesSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OCSPResponseJson;
- /**
- * Get OCSP response status for specific certificate
- * @param certificate
- * @param issuerCertificate
- * @param crypto Crypto engine
- */
- getCertificateStatus(certificate: Certificate, issuerCertificate: Certificate, crypto?: ICryptoEngine): Promise<{
- isForCertificate: boolean;
- status: number;
- }>;
- /**
- * Make a signature for current OCSP Response
- * @param privateKey Private key for "subjectPublicKeyInfo" structure
- * @param hashAlgorithm Hashing algorithm. Default SHA-1
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Verify current OCSP Response
- * @param issuerCertificate In order to decrease size of resp issuer cert could be omitted. In such case you need manually provide it.
- * @param crypto Crypto engine
- */
- verify(issuerCertificate?: Certificate | null, crypto?: ICryptoEngine): Promise<boolean>;
- }
- declare const id_SubjectDirectoryAttributes = "2.5.29.9";
- declare const id_SubjectKeyIdentifier = "2.5.29.14";
- declare const id_KeyUsage = "2.5.29.15";
- declare const id_PrivateKeyUsagePeriod = "2.5.29.16";
- declare const id_SubjectAltName = "2.5.29.17";
- declare const id_IssuerAltName = "2.5.29.18";
- declare const id_BasicConstraints = "2.5.29.19";
- declare const id_CRLNumber = "2.5.29.20";
- declare const id_BaseCRLNumber = "2.5.29.27";
- declare const id_CRLReason = "2.5.29.21";
- declare const id_InvalidityDate = "2.5.29.24";
- declare const id_IssuingDistributionPoint = "2.5.29.28";
- declare const id_CertificateIssuer = "2.5.29.29";
- declare const id_NameConstraints = "2.5.29.30";
- declare const id_CRLDistributionPoints = "2.5.29.31";
- declare const id_FreshestCRL = "2.5.29.46";
- declare const id_CertificatePolicies = "2.5.29.32";
- declare const id_AnyPolicy = "2.5.29.32.0";
- declare const id_MicrosoftAppPolicies = "1.3.6.1.4.1.311.21.10";
- declare const id_PolicyMappings = "2.5.29.33";
- declare const id_AuthorityKeyIdentifier = "2.5.29.35";
- declare const id_PolicyConstraints = "2.5.29.36";
- declare const id_ExtKeyUsage = "2.5.29.37";
- declare const id_InhibitAnyPolicy = "2.5.29.54";
- declare const id_AuthorityInfoAccess = "1.3.6.1.5.5.7.1.1";
- declare const id_SubjectInfoAccess = "1.3.6.1.5.5.7.1.11";
- declare const id_SignedCertificateTimestampList = "1.3.6.1.4.1.11129.2.4.2";
- declare const id_MicrosoftCertTemplateV1 = "1.3.6.1.4.1.311.20.2";
- declare const id_MicrosoftPrevCaCertHash = "1.3.6.1.4.1.311.21.2";
- declare const id_MicrosoftCertTemplateV2 = "1.3.6.1.4.1.311.21.7";
- declare const id_MicrosoftCaVersion = "1.3.6.1.4.1.311.21.1";
- declare const id_QCStatements = "1.3.6.1.5.5.7.1.3";
- declare const id_ContentType_Data = "1.2.840.113549.1.7.1";
- declare const id_ContentType_SignedData = "1.2.840.113549.1.7.2";
- declare const id_ContentType_EnvelopedData = "1.2.840.113549.1.7.3";
- declare const id_ContentType_EncryptedData = "1.2.840.113549.1.7.6";
- declare const id_eContentType_TSTInfo = "1.2.840.113549.1.9.16.1.4";
- declare const id_CertBag_X509Certificate = "1.2.840.113549.1.9.22.1";
- declare const id_CertBag_SDSICertificate = "1.2.840.113549.1.9.22.2";
- declare const id_CertBag_AttributeCertificate = "1.2.840.113549.1.9.22.3";
- declare const id_CRLBag_X509CRL = "1.2.840.113549.1.9.23.1";
- declare const id_pkix = "1.3.6.1.5.5.7";
- declare const id_ad = "1.3.6.1.5.5.7.48";
- declare const id_PKIX_OCSP_Basic = "1.3.6.1.5.5.7.48.1.1";
- declare const id_ad_caIssuers = "1.3.6.1.5.5.7.48.2";
- declare const id_ad_ocsp = "1.3.6.1.5.5.7.48.1";
- declare const id_sha1 = "1.3.14.3.2.26";
- declare const id_sha256 = "2.16.840.1.101.3.4.2.1";
- declare const id_sha384 = "2.16.840.1.101.3.4.2.2";
- declare const id_sha512 = "2.16.840.1.101.3.4.2.3";
- declare const ALGORITHM = "algorithm";
- declare const PUBLIC_KEY = "publicKey";
- interface IOriginatorPublicKey {
- algorithm: AlgorithmIdentifier;
- publicKey: asn1js.BitString;
- }
- interface OriginatorPublicKeyJson {
- algorithm: AlgorithmIdentifierJson;
- publicKey: asn1js.BitStringJson;
- }
- type OriginatorPublicKeyParameters = PkiObjectParameters & Partial<IOriginatorPublicKey>;
- /**
- * Represents the OriginatorPublicKey structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class OriginatorPublicKey extends PkiObject implements IOriginatorPublicKey {
- static CLASS_NAME: string;
- algorithm: AlgorithmIdentifier;
- publicKey: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link OriginatorPublicKey} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: OriginatorPublicKeyParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof PUBLIC_KEY): asn1js.BitString;
- static defaultValues(memberName: string): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault<T extends {
- isEqual(data: any): boolean;
- }>(memberName: string, memberValue: T): memberValue is T;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * OriginatorPublicKey ::= SEQUENCE {
- * algorithm AlgorithmIdentifier,
- * publicKey BIT STRING }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- algorithm?: AlgorithmIdentifierSchema;
- publicKey?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): OriginatorPublicKeyJson;
- }
- declare const KEY_DERIVATION_FUNC = "keyDerivationFunc";
- declare const ENCRYPTION_SCHEME = "encryptionScheme";
- interface IPBES2Params {
- keyDerivationFunc: AlgorithmIdentifier;
- encryptionScheme: AlgorithmIdentifier;
- }
- interface PBES2ParamsJson {
- keyDerivationFunc: AlgorithmIdentifierJson;
- encryptionScheme: AlgorithmIdentifierJson;
- }
- type PBES2ParamsParameters = PkiObjectParameters & Partial<IPBES2Params>;
- /**
- * Represents the PBES2Params structure described in [RFC2898](https://www.ietf.org/rfc/rfc2898.txt)
- */
- declare class PBES2Params extends PkiObject implements IPBES2Params {
- static CLASS_NAME: string;
- keyDerivationFunc: AlgorithmIdentifier;
- encryptionScheme: AlgorithmIdentifier;
- /**
- * Initializes a new instance of the {@link PBES2Params} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PBES2ParamsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof KEY_DERIVATION_FUNC): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENCRYPTION_SCHEME): AlgorithmIdentifier;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PBES2-params ::= SEQUENCE {
- * keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}},
- * encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- keyDerivationFunc?: AlgorithmIdentifierSchema;
- encryptionScheme?: AlgorithmIdentifierSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PBES2ParamsJson;
- }
- declare const SALT = "salt";
- declare const ITERATION_COUNT = "iterationCount";
- declare const KEY_LENGTH = "keyLength";
- declare const PRF = "prf";
- interface IPBKDF2Params {
- salt: any;
- iterationCount: number;
- keyLength?: number;
- prf?: AlgorithmIdentifier;
- }
- interface PBKDF2ParamsJson {
- salt: any;
- iterationCount: number;
- keyLength?: number;
- prf?: AlgorithmIdentifierJson;
- }
- type PBKDF2ParamsParameters = PkiObjectParameters & Partial<IPBKDF2Params>;
- /**
- * Represents the PBKDF2Params structure described in [RFC2898](https://www.ietf.org/rfc/rfc2898.txt)
- */
- declare class PBKDF2Params extends PkiObject implements IPBKDF2Params {
- static CLASS_NAME: string;
- salt: any;
- iterationCount: number;
- keyLength?: number;
- prf?: AlgorithmIdentifier;
- /**
- * Initializes a new instance of the {@link PBKDF2Params} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PBKDF2ParamsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SALT): any;
- static defaultValues(memberName: typeof ITERATION_COUNT): number;
- static defaultValues(memberName: typeof KEY_LENGTH): number;
- static defaultValues(memberName: typeof PRF): AlgorithmIdentifier;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PBKDF2-params ::= SEQUENCE {
- * salt CHOICE {
- * specified OCTET STRING,
- * otherSource AlgorithmIdentifier },
- * iterationCount INTEGER (1..MAX),
- * keyLength INTEGER (1..MAX) OPTIONAL,
- * prf AlgorithmIdentifier
- * DEFAULT { algorithm hMAC-SHA1, parameters NULL } }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- saltPrimitive?: string;
- saltConstructed?: AlgorithmIdentifierSchema;
- iterationCount?: string;
- keyLength?: string;
- prf?: AlgorithmIdentifierSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PBKDF2ParamsJson;
- }
- declare const VERSION$5 = "version";
- declare const AUTH_SAFE = "authSafe";
- declare const MAC_DATA = "macData";
- declare const PARSED_VALUE$1 = "parsedValue";
- interface IPFX {
- version: number;
- authSafe: ContentInfo;
- macData?: MacData;
- parsedValue?: PFXParsedValue;
- }
- interface PFXJson {
- version: number;
- authSafe: ContentInfoJson;
- macData?: MacDataJson;
- }
- type PFXParameters = PkiObjectParameters & Partial<IPFX>;
- interface PFXParsedValue {
- authenticatedSafe?: AuthenticatedSafe;
- integrityMode?: number;
- }
- type MakeInternalValuesParams = object | {
- iterations: number;
- pbkdf2HashAlgorithm: Algorithm;
- hmacHashAlgorithm: string;
- password: ArrayBuffer;
- } | {
- signingCertificate: Certificate;
- privateKey: CryptoKey;
- hashAlgorithm: string;
- };
- /**
- * Represents the PFX structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class PFX extends PkiObject implements IPFX {
- static CLASS_NAME: string;
- version: number;
- authSafe: ContentInfo;
- macData?: MacData;
- parsedValue?: PFXParsedValue;
- /**
- * Initializes a new instance of the {@link PFX} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PFXParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$5): number;
- static defaultValues(memberName: typeof AUTH_SAFE): ContentInfo;
- static defaultValues(memberName: typeof MAC_DATA): MacData;
- static defaultValues(memberName: typeof PARSED_VALUE$1): PFXParsedValue;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PFX ::= SEQUENCE {
- * version INTEGER {v3(3)}(v3,...),
- * authSafe ContentInfo,
- * macData MacData OPTIONAL
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- authSafe?: ContentInfoSchema;
- macData?: MacDataSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PFXJson;
- /**
- * Making ContentInfo from PARSED_VALUE object
- * @param parameters Parameters, specific to each "integrity mode"
- * @param crypto Crypto engine
- */
- makeInternalValues(parameters?: MakeInternalValuesParams, crypto?: ICryptoEngine): Promise<void>;
- parseInternalValues(parameters: {
- checkIntegrity?: boolean;
- password?: ArrayBuffer;
- }, crypto?: ICryptoEngine): Promise<void>;
- }
- declare const ENCRYPTION_ALGORITHM = "encryptionAlgorithm";
- declare const ENCRYPTED_DATA = "encryptedData";
- declare const PARSED_VALUE = "parsedValue";
- interface IPKCS8ShroudedKeyBag {
- encryptionAlgorithm: AlgorithmIdentifier;
- encryptedData: asn1js.OctetString;
- parsedValue?: PrivateKeyInfo;
- }
- type PKCS8ShroudedKeyBagParameters = PkiObjectParameters & Partial<IPKCS8ShroudedKeyBag>;
- interface PKCS8ShroudedKeyBagJson {
- encryptionAlgorithm: AlgorithmIdentifierJson;
- encryptedData: asn1js.OctetStringJson;
- }
- type PKCS8ShroudedKeyBagMakeInternalValuesParams = Omit<EncryptedDataEncryptParams, "contentToEncrypt">;
- /**
- * Represents the PKCS8ShroudedKeyBag structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class PKCS8ShroudedKeyBag extends PkiObject implements IPKCS8ShroudedKeyBag {
- static CLASS_NAME: string;
- encryptionAlgorithm: AlgorithmIdentifier;
- encryptedData: asn1js.OctetString;
- parsedValue?: PrivateKeyInfo;
- /**
- * Initializes a new instance of the {@link PKCS8ShroudedKeyBag} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PKCS8ShroudedKeyBagParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ENCRYPTION_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof ENCRYPTED_DATA): asn1js.OctetString;
- static defaultValues(memberName: typeof PARSED_VALUE): PrivateKeyInfo;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PKCS8ShroudedKeyBag ::= EncryptedPrivateKeyInfo
- *
- * EncryptedPrivateKeyInfo ::= SEQUENCE {
- * encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
- * encryptedData EncryptedData
- * }
- *
- * EncryptedData ::= OCTET STRING
- *```
- */
- static schema(parameters?: SchemaParameters<{
- encryptionAlgorithm?: AlgorithmIdentifierSchema;
- encryptedData?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PKCS8ShroudedKeyBagJson;
- protected parseInternalValues(parameters: {
- password: ArrayBuffer;
- }, crypto?: ICryptoEngine): Promise<void>;
- makeInternalValues(parameters: PKCS8ShroudedKeyBagMakeInternalValuesParams, crypto?: ICryptoEngine): Promise<void>;
- }
- declare const STATUS$1 = "status";
- declare const STATUS_STRINGS = "statusStrings";
- declare const FAIL_INFO = "failInfo";
- interface IPKIStatusInfo {
- status: PKIStatus;
- statusStrings?: asn1js.Utf8String[];
- failInfo?: asn1js.BitString;
- }
- interface PKIStatusInfoJson {
- status: PKIStatus;
- statusStrings?: asn1js.Utf8StringJson[];
- failInfo?: asn1js.BitStringJson;
- }
- type PKIStatusInfoParameters = PkiObjectParameters & Partial<IPKIStatusInfo>;
- type PKIStatusInfoSchema = SchemaParameters<{
- status?: string;
- statusStrings?: string;
- failInfo?: string;
- }>;
- declare enum PKIStatus {
- granted = 0,
- grantedWithMods = 1,
- rejection = 2,
- waiting = 3,
- revocationWarning = 4,
- revocationNotification = 5
- }
- /**
- * Represents the PKIStatusInfo structure described in [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- */
- declare class PKIStatusInfo extends PkiObject implements IPKIStatusInfo {
- static CLASS_NAME: string;
- status: PKIStatus;
- statusStrings?: asn1js.Utf8String[];
- failInfo?: asn1js.BitString;
- /**
- * Initializes a new instance of the {@link PBKDF2Params} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PKIStatusInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof STATUS$1): number;
- static defaultValues(memberName: typeof STATUS_STRINGS): asn1js.Utf8String[];
- static defaultValues(memberName: typeof FAIL_INFO): asn1js.BitString;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PKIStatusInfo ::= SEQUENCE {
- * status PKIStatus,
- * statusString PKIFreeText OPTIONAL,
- * failInfo PKIFailureInfo OPTIONAL }
- *```
- */
- static schema(parameters?: PKIStatusInfoSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PKIStatusInfoJson;
- }
- declare const REQUIRE_EXPLICIT_POLICY = "requireExplicitPolicy";
- declare const INHIBIT_POLICY_MAPPING = "inhibitPolicyMapping";
- interface IPolicyConstraints {
- requireExplicitPolicy?: number;
- inhibitPolicyMapping?: number;
- }
- interface PolicyConstraintsJson {
- requireExplicitPolicy?: number;
- inhibitPolicyMapping?: number;
- }
- type PolicyConstraintsParameters = PkiObjectParameters & Partial<IPolicyConstraints>;
- /**
- * Represents the PolicyConstraints structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PolicyConstraints extends PkiObject implements IPolicyConstraints {
- static CLASS_NAME: string;
- requireExplicitPolicy?: number;
- inhibitPolicyMapping?: number;
- /**
- * Initializes a new instance of the {@link PolicyConstraints} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PolicyConstraintsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof REQUIRE_EXPLICIT_POLICY): number;
- static defaultValues(memberName: typeof INHIBIT_POLICY_MAPPING): number;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PolicyConstraints ::= SEQUENCE {
- * requireExplicitPolicy [0] SkipCerts OPTIONAL,
- * inhibitPolicyMapping [1] SkipCerts OPTIONAL }
- *
- * SkipCerts ::= INTEGER (0..MAX)
- *```
- */
- static schema(parameters?: SchemaParameters<{
- requireExplicitPolicy?: string;
- inhibitPolicyMapping?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PolicyConstraintsJson;
- }
- declare const ISSUER_DOMAIN_POLICY = "issuerDomainPolicy";
- declare const SUBJECT_DOMAIN_POLICY = "subjectDomainPolicy";
- interface IPolicyMapping {
- issuerDomainPolicy: string;
- subjectDomainPolicy: string;
- }
- interface PolicyMappingJson {
- issuerDomainPolicy: string;
- subjectDomainPolicy: string;
- }
- type PolicyMappingParameters = PkiObjectParameters & Partial<IPolicyMapping>;
- /**
- * Represents the PolicyMapping structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PolicyMapping extends PkiObject implements IPolicyMapping {
- static CLASS_NAME: string;
- issuerDomainPolicy: string;
- subjectDomainPolicy: string;
- /**
- * Initializes a new instance of the {@link PolicyMapping} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PolicyMappingParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ISSUER_DOMAIN_POLICY): string;
- static defaultValues(memberName: typeof SUBJECT_DOMAIN_POLICY): string;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PolicyMapping ::= SEQUENCE {
- * issuerDomainPolicy CertPolicyId,
- * subjectDomainPolicy CertPolicyId }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- issuerDomainPolicy?: string;
- subjectDomainPolicy?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PolicyMappingJson;
- }
- interface IPolicyMappings {
- mappings: PolicyMapping[];
- }
- interface PolicyMappingsJson {
- mappings: PolicyMappingJson[];
- }
- type PolicyMappingsParameters = PkiObjectParameters & Partial<IPolicyMappings>;
- /**
- * Represents the PolicyMappings structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PolicyMappings extends PkiObject implements IPolicyMappings {
- static CLASS_NAME: string;
- mappings: PolicyMapping[];
- /**
- * Initializes a new instance of the {@link PolicyMappings} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PolicyMappingsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: string): PolicyMapping[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PolicyMappings ::= SEQUENCE SIZE (1..MAX) OF PolicyMapping
- *```
- */
- static schema(parameters?: SchemaParameters<{
- mappings?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PolicyMappingsJson;
- }
- declare const NOT_BEFORE = "notBefore";
- declare const NOT_AFTER = "notAfter";
- interface IPrivateKeyUsagePeriod {
- notBefore?: Date;
- notAfter?: Date;
- }
- interface PrivateKeyUsagePeriodJson {
- notBefore?: Date;
- notAfter?: Date;
- }
- type PrivateKeyUsagePeriodParameters = PkiObjectParameters & Partial<IPrivateKeyUsagePeriod>;
- /**
- * Represents the PrivateKeyUsagePeriod structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class PrivateKeyUsagePeriod extends PkiObject implements IPrivateKeyUsagePeriod {
- static CLASS_NAME: string;
- notBefore?: Date;
- notAfter?: Date;
- /**
- * Initializes a new instance of the {@link PrivateKeyUsagePeriod} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: PrivateKeyUsagePeriodParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof NOT_BEFORE): Date;
- static defaultValues(memberName: typeof NOT_AFTER): Date;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * PrivateKeyUsagePeriod OID ::= 2.5.29.16
- *
- * PrivateKeyUsagePeriod ::= SEQUENCE {
- * notBefore [0] GeneralizedTime OPTIONAL,
- * notAfter [1] GeneralizedTime OPTIONAL }
- * -- either notBefore or notAfter MUST be present
- *```
- */
- static schema(parameters?: SchemaParameters<{
- notBefore?: string;
- notAfter?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): PrivateKeyUsagePeriodJson;
- }
- declare const ID = "id";
- declare const TYPE$1 = "type";
- declare const VALUES = "values";
- interface IQCStatement {
- id: string;
- type?: any;
- }
- interface QCStatementJson {
- id: string;
- type?: any;
- }
- type QCStatementParameters = PkiObjectParameters & Partial<IQCStatement>;
- type QCStatementSchema = SchemaParameters<{
- id?: string;
- type?: string;
- }>;
- /**
- * Represents the QCStatement structure described in [RFC3739](https://datatracker.ietf.org/doc/html/rfc3739)
- */
- declare class QCStatement extends PkiObject implements IQCStatement {
- static CLASS_NAME: string;
- id: string;
- type?: any;
- /**
- * Initializes a new instance of the {@link QCStatement} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: QCStatementParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ID): string;
- static defaultValues(memberName: typeof TYPE$1): any;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * QCStatement ::= SEQUENCE {
- * statementId QC-STATEMENT.&id({SupportedStatements}),
- * statementInfo QC-STATEMENT.&Type({SupportedStatements}{@statementId}) OPTIONAL
- * }
- *```
- */
- static schema(parameters?: QCStatementSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): QCStatementJson;
- }
- interface IQCStatements {
- values: QCStatement[];
- }
- interface QCStatementsJson {
- values: QCStatementJson[];
- }
- type QCStatementsParameters = PkiObjectParameters & Partial<IQCStatements>;
- /**
- * Represents the QCStatements structure described in [RFC3739](https://datatracker.ietf.org/doc/html/rfc3739)
- */
- declare class QCStatements extends PkiObject implements IQCStatements {
- static CLASS_NAME: string;
- values: QCStatement[];
- /**
- * Initializes a new instance of the {@link QCStatement} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: QCStatementParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VALUES): QCStatement[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * QCStatements ::= SEQUENCE OF QCStatement
- *```
- */
- static schema(parameters?: SchemaParameters<{
- values?: string;
- value?: QCStatementSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): QCStatementsJson;
- }
- declare const HASH_ALGORITHM$2 = "hashAlgorithm";
- declare const MASK_GEN_ALGORITHM$1 = "maskGenAlgorithm";
- declare const P_SOURCE_ALGORITHM = "pSourceAlgorithm";
- interface IRSAESOAEPParams {
- hashAlgorithm: AlgorithmIdentifier;
- maskGenAlgorithm: AlgorithmIdentifier;
- pSourceAlgorithm: AlgorithmIdentifier;
- }
- interface RSAESOAEPParamsJson {
- hashAlgorithm?: AlgorithmIdentifierJson;
- maskGenAlgorithm?: AlgorithmIdentifierJson;
- pSourceAlgorithm?: AlgorithmIdentifierJson;
- }
- type RSAESOAEPParamsParameters = PkiObjectParameters & Partial<IRSAESOAEPParams>;
- /**
- * Class from RFC3447
- */
- declare class RSAESOAEPParams extends PkiObject implements IRSAESOAEPParams {
- static CLASS_NAME: string;
- hashAlgorithm: AlgorithmIdentifier;
- maskGenAlgorithm: AlgorithmIdentifier;
- pSourceAlgorithm: AlgorithmIdentifier;
- /**
- * Initializes a new instance of the {@link RSAESOAEPParams} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RSAESOAEPParamsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof HASH_ALGORITHM$2): AlgorithmIdentifier;
- static defaultValues(memberName: typeof MASK_GEN_ALGORITHM$1): AlgorithmIdentifier;
- static defaultValues(memberName: typeof P_SOURCE_ALGORITHM): AlgorithmIdentifier;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RSAES-OAEP-params ::= SEQUENCE {
- * hashAlgorithm [0] HashAlgorithm DEFAULT sha1,
- * maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
- * pSourceAlgorithm [2] PSourceAlgorithm DEFAULT pSpecifiedEmpty
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- hashAlgorithm?: AlgorithmIdentifierSchema;
- maskGenAlgorithm?: AlgorithmIdentifierSchema;
- pSourceAlgorithm?: AlgorithmIdentifierSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RSAESOAEPParamsJson;
- }
- declare const HASH_ALGORITHM$1 = "hashAlgorithm";
- declare const MASK_GEN_ALGORITHM = "maskGenAlgorithm";
- declare const SALT_LENGTH = "saltLength";
- declare const TRAILER_FIELD = "trailerField";
- interface IRSASSAPSSParams {
- /**
- * Algorithms of hashing (DEFAULT sha1)
- */
- hashAlgorithm: AlgorithmIdentifier;
- /**
- * Salt length (DEFAULT 20)
- */
- maskGenAlgorithm: AlgorithmIdentifier;
- /**
- * Salt length (DEFAULT 20)
- */
- saltLength: number;
- /**
- * (DEFAULT 1)
- */
- trailerField: number;
- }
- interface RSASSAPSSParamsJson {
- hashAlgorithm?: AlgorithmIdentifierJson;
- maskGenAlgorithm?: AlgorithmIdentifierJson;
- saltLength?: number;
- trailerField?: number;
- }
- type RSASSAPSSParamsParameters = PkiObjectParameters & Partial<IRSASSAPSSParams>;
- /**
- * Represents the RSASSAPSSParams structure described in [RFC4055](https://datatracker.ietf.org/doc/html/rfc4055)
- */
- declare class RSASSAPSSParams extends PkiObject implements IRSASSAPSSParams {
- static CLASS_NAME: string;
- hashAlgorithm: AlgorithmIdentifier;
- maskGenAlgorithm: AlgorithmIdentifier;
- saltLength: number;
- trailerField: number;
- /**
- * Initializes a new instance of the {@link RSASSAPSSParams} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: RSASSAPSSParamsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof HASH_ALGORITHM$1): AlgorithmIdentifier;
- static defaultValues(memberName: typeof MASK_GEN_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SALT_LENGTH): number;
- static defaultValues(memberName: typeof TRAILER_FIELD): number;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * RSASSA-PSS-params ::= Sequence {
- * hashAlgorithm [0] HashAlgorithm DEFAULT sha1Identifier,
- * maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1Identifier,
- * saltLength [2] Integer DEFAULT 20,
- * trailerField [3] Integer DEFAULT 1 }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- hashAlgorithm?: AlgorithmIdentifierSchema;
- maskGenAlgorithm?: AlgorithmIdentifierSchema;
- saltLength?: string;
- trailerField?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): RSASSAPSSParamsJson;
- }
- declare const SAFE_BUGS = "safeBags";
- interface ISafeContents {
- safeBags: SafeBag[];
- }
- type SafeContentsParameters = PkiObjectParameters & Partial<ISafeContents>;
- interface SafeContentsJson {
- safeBags: SafeBagJson[];
- }
- /**
- * Represents the SafeContents structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class SafeContents extends PkiObject implements ISafeContents {
- static CLASS_NAME: string;
- safeBags: SafeBag[];
- /**
- * Initializes a new instance of the {@link SafeContents} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SafeContentsParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SAFE_BUGS): SafeBag[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SafeContents ::= SEQUENCE OF SafeBag
- *```
- */
- static schema(parameters?: SchemaParameters<{
- safeBags?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SafeContentsJson;
- }
- declare const SECRET_TYPE_ID = "secretTypeId";
- declare const SECRET_VALUE = "secretValue";
- interface ISecretBag {
- secretTypeId: string;
- secretValue: SchemaCompatible;
- }
- interface SecretBagJson {
- secretTypeId: string;
- secretValue: asn1js.BaseBlockJson;
- }
- type SecretBagParameters = PkiObjectParameters & Partial<ISecretBag>;
- /**
- * Represents the SecretBag structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class SecretBag extends PkiObject implements ISecretBag {
- static CLASS_NAME: string;
- secretTypeId: string;
- secretValue: SchemaCompatible;
- /**
- * Initializes a new instance of the {@link SecretBag} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SecretBagParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof SECRET_TYPE_ID): string;
- static defaultValues(memberName: typeof SECRET_VALUE): SchemaCompatible;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SecretBag ::= SEQUENCE {
- * secretTypeId BAG-TYPE.&id ({SecretTypes}),
- * secretValue [0] EXPLICIT BAG-TYPE.&Type ({SecretTypes}{@secretTypeId})
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- id?: string;
- value?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SecretBagJson;
- }
- type BagType = PrivateKeyInfo | PKCS8ShroudedKeyBag | CertBag | CRLBag | SecretBag | SafeContents;
- type BagTypeJson = PrivateKeyInfoJson | JsonWebKey | PKCS8ShroudedKeyBagJson | CertBagJson | CRLBagJson | SecretBagJson | SafeContentsJson;
- interface BagTypeConstructor<T extends BagType> {
- new (params: {
- schema: any;
- }): T;
- }
- declare class SafeBagValueFactory {
- private static items?;
- private static getItems;
- static register<T extends BagType = BagType>(id: string, type: BagTypeConstructor<T>): void;
- static find(id: string): BagTypeConstructor<BagType> | null;
- }
- declare const BAG_ID = "bagId";
- declare const BAG_VALUE = "bagValue";
- declare const BAG_ATTRIBUTES = "bagAttributes";
- interface ISafeBag<T extends BagType = BagType> {
- bagId: string;
- bagValue: T;
- bagAttributes?: Attribute[];
- }
- type SafeBagParameters<T extends BagType = BagType> = PkiObjectParameters & Partial<ISafeBag<T>>;
- interface SafeBagJson {
- bagId: string;
- bagValue: BagTypeJson;
- bagAttributes?: AttributeJson[];
- }
- /**
- * Represents the SafeBag structure described in [RFC7292](https://datatracker.ietf.org/doc/html/rfc7292)
- */
- declare class SafeBag<T extends BagType = BagType> extends PkiObject implements ISafeBag<T> {
- static CLASS_NAME: string;
- bagId: string;
- bagValue: T;
- bagAttributes?: Attribute[];
- /**
- * Initializes a new instance of the {@link SafeBag} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SafeBagParameters<T>);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof BAG_ID): string;
- static defaultValues(memberName: typeof BAG_VALUE): BagType;
- static defaultValues(memberName: typeof BAG_ATTRIBUTES): Attribute[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SafeBag ::= SEQUENCE {
- * bagId BAG-TYPE.&id ({PKCS12BagSet}),
- * bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}),
- * bagAttributes SET OF PKCS12Attribute OPTIONAL
- * }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- bagId?: string;
- bagValue?: string;
- bagAttributes?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SafeBagJson;
- }
- declare const TYPE = "type";
- declare const ATTRIBUTES$1 = "attributes";
- declare const ENCODED_VALUE = "encodedValue";
- interface ISignedAndUnsignedAttributes {
- type: number;
- attributes: Attribute[];
- /**
- * Need to have it in order to successfully process with signature verification
- */
- encodedValue: ArrayBuffer;
- }
- interface SignedAndUnsignedAttributesJson {
- type: number;
- attributes: AttributeJson[];
- }
- type SignedAndUnsignedAttributesParameters = PkiObjectParameters & Partial<ISignedAndUnsignedAttributes>;
- type SignedAndUnsignedAttributesSchema = SchemaParameters<{
- tagNumber?: number;
- attributes?: string;
- }>;
- /**
- * Represents the SignedAndUnsignedAttributes structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class SignedAndUnsignedAttributes extends PkiObject implements ISignedAndUnsignedAttributes {
- static CLASS_NAME: string;
- type: number;
- attributes: Attribute[];
- encodedValue: ArrayBuffer;
- /**
- * Initializes a new instance of the {@link SignedAndUnsignedAttributes} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SignedAndUnsignedAttributesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TYPE): number;
- static defaultValues(memberName: typeof ATTRIBUTES$1): Attribute[];
- static defaultValues(memberName: typeof ENCODED_VALUE): ArrayBuffer;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SignedAttributes ::= SET SIZE (1..MAX) OF Attribute
- *
- * UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute
- *```
- */
- static schema(parameters?: SignedAndUnsignedAttributesSchema): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SignedAndUnsignedAttributesJson;
- }
- declare const VERSION$4 = "version";
- declare const LOG_ID = "logID";
- declare const EXTENSIONS$2 = "extensions";
- declare const TIMESTAMP = "timestamp";
- declare const HASH_ALGORITHM = "hashAlgorithm";
- declare const SIGNATURE_ALGORITHM$1 = "signatureAlgorithm";
- declare const SIGNATURE$1 = "signature";
- interface ISignedCertificateTimestamp {
- version: number;
- logID: ArrayBuffer;
- timestamp: Date;
- extensions: ArrayBuffer;
- hashAlgorithm: string;
- signatureAlgorithm: string;
- signature: ArrayBuffer;
- }
- interface SignedCertificateTimestampJson {
- version: number;
- logID: string;
- timestamp: Date;
- extensions: string;
- hashAlgorithm: string;
- signatureAlgorithm: string;
- signature: string;
- }
- type SignedCertificateTimestampParameters = PkiObjectParameters & Partial<ISignedCertificateTimestamp> & {
- stream?: bs.SeqStream;
- };
- declare class SignedCertificateTimestamp extends PkiObject implements ISignedCertificateTimestamp {
- static CLASS_NAME: string;
- version: number;
- logID: ArrayBuffer;
- timestamp: Date;
- extensions: ArrayBuffer;
- hashAlgorithm: string;
- signatureAlgorithm: string;
- signature: ArrayBuffer;
- /**
- * Initializes a new instance of the {@link SignedCertificateTimestamp} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SignedCertificateTimestampParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$4): number;
- static defaultValues(memberName: typeof LOG_ID): ArrayBuffer;
- static defaultValues(memberName: typeof EXTENSIONS$2): ArrayBuffer;
- static defaultValues(memberName: typeof TIMESTAMP): Date;
- static defaultValues(memberName: typeof HASH_ALGORITHM): string;
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM$1): string;
- static defaultValues(memberName: typeof SIGNATURE$1): ArrayBuffer;
- fromSchema(schema: SchemaType): void;
- /**
- * Converts SeqStream data into current class
- * @param stream
- */
- fromStream(stream: bs.SeqStream): void;
- toSchema(): asn1js.RawData;
- /**
- * Converts current object to SeqStream data
- * @returns SeqStream object
- */
- toStream(): bs.SeqStream;
- toJSON(): SignedCertificateTimestampJson;
- /**
- * Verify SignedCertificateTimestamp for specific input data
- * @param logs Array of objects with information about each CT Log (like here: https://ct.grahamedgecombe.com/logs.json)
- * @param data Data to verify signature against. Could be encoded Certificate or encoded PreCert
- * @param dataType Type = 0 (data is encoded Certificate), type = 1 (data is encoded PreCert)
- * @param crypto Crypto engine
- */
- verify(logs: Log[], data: ArrayBuffer, dataType?: number, crypto?: ICryptoEngine): Promise<boolean>;
- }
- interface Log {
- /**
- * Identifier of the CT Log encoded in BASE-64 format
- */
- log_id: string;
- /**
- * Public key of the CT Log encoded in BASE-64 format
- */
- key: string;
- }
- interface Log {
- /**
- * Identifier of the CT Log encoded in BASE-64 format
- */
- log_id: string;
- /**
- * Public key of the CT Log encoded in BASE-64 format
- */
- key: string;
- }
- /**
- * Verify SignedCertificateTimestamp for specific certificate content
- * @param certificate Certificate for which verification would be performed
- * @param issuerCertificate Certificate of the issuer of target certificate
- * @param logs Array of objects with information about each CT Log (like here: https://ct.grahamedgecombe.com/logs.json)
- * @param index Index of SignedCertificateTimestamp inside SignedCertificateTimestampList (for -1 would verify all)
- * @param crypto Crypto engine
- * @return Array of verification results
- */
- declare function verifySCTsForCertificate(certificate: Certificate, issuerCertificate: Certificate, logs: Log[], index?: number, crypto?: ICryptoEngine): Promise<boolean[]>;
- declare const TIMESTAMPS = "timestamps";
- interface ISignedCertificateTimestampList {
- timestamps: SignedCertificateTimestamp[];
- }
- interface SignedCertificateTimestampListJson {
- timestamps: SignedCertificateTimestampJson[];
- }
- type SignedCertificateTimestampListParameters = PkiObjectParameters & Partial<ISignedCertificateTimestampList>;
- /**
- * Represents the SignedCertificateTimestampList structure described in [RFC6962](https://datatracker.ietf.org/doc/html/rfc6962)
- */
- declare class SignedCertificateTimestampList extends PkiObject implements ISignedCertificateTimestampList {
- static CLASS_NAME: string;
- timestamps: SignedCertificateTimestamp[];
- /**
- * Initializes a new instance of the {@link SignedCertificateTimestampList} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SignedCertificateTimestampListParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof TIMESTAMPS): SignedCertificateTimestamp[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SignedCertificateTimestampList ::= OCTET STRING
- *```
- */
- static schema(parameters?: SchemaParameters): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.OctetString;
- toJSON(): SignedCertificateTimestampListJson;
- }
- declare const VERSION$3 = "version";
- declare const SID = "sid";
- declare const DIGEST_ALGORITHM = "digestAlgorithm";
- declare const SIGNED_ATTRS = "signedAttrs";
- declare const SIGNATURE_ALGORITHM = "signatureAlgorithm";
- declare const SIGNATURE = "signature";
- declare const UNSIGNED_ATTRS = "unsignedAttrs";
- interface ISignerInfo {
- version: number;
- sid: SchemaType;
- digestAlgorithm: AlgorithmIdentifier;
- signedAttrs?: SignedAndUnsignedAttributes;
- signatureAlgorithm: AlgorithmIdentifier;
- signature: asn1js.OctetString;
- unsignedAttrs?: SignedAndUnsignedAttributes;
- }
- interface SignerInfoJson {
- version: number;
- sid?: SchemaType;
- digestAlgorithm: AlgorithmIdentifierJson;
- signedAttrs?: SignedAndUnsignedAttributesJson;
- signatureAlgorithm: AlgorithmIdentifierJson;
- signature: asn1js.OctetStringJson;
- unsignedAttrs?: SignedAndUnsignedAttributesJson;
- }
- type SignerInfoParameters = PkiObjectParameters & Partial<ISignerInfo>;
- /**
- * Represents the SignerInfo structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- */
- declare class SignerInfo extends PkiObject implements ISignerInfo {
- static CLASS_NAME: string;
- version: number;
- sid: SchemaType;
- digestAlgorithm: AlgorithmIdentifier;
- signedAttrs?: SignedAndUnsignedAttributes;
- signatureAlgorithm: AlgorithmIdentifier;
- signature: asn1js.OctetString;
- unsignedAttrs?: SignedAndUnsignedAttributes;
- /**
- * Initializes a new instance of the {@link SignerInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SignerInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$3): number;
- static defaultValues(memberName: typeof SID): SchemaType;
- static defaultValues(memberName: typeof DIGEST_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNED_ATTRS): SignedAndUnsignedAttributes;
- static defaultValues(memberName: typeof SIGNATURE_ALGORITHM): AlgorithmIdentifier;
- static defaultValues(memberName: typeof SIGNATURE): asn1js.OctetString;
- static defaultValues(memberName: typeof UNSIGNED_ATTRS): SignedAndUnsignedAttributes;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SignerInfo ::= SEQUENCE {
- * version CMSVersion,
- * sid SignerIdentifier,
- * digestAlgorithm DigestAlgorithmIdentifier,
- * signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
- * signatureAlgorithm SignatureAlgorithmIdentifier,
- * signature SignatureValue,
- * unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
- *
- * SignerIdentifier ::= CHOICE {
- * issuerAndSerialNumber IssuerAndSerialNumber,
- * subjectKeyIdentifier [0] SubjectKeyIdentifier }
- *
- * SubjectKeyIdentifier ::= OCTET STRING
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- sidSchema?: IssuerAndSerialNumberSchema;
- sid?: string;
- digestAlgorithm?: AlgorithmIdentifierSchema;
- signedAttrs?: SignedAndUnsignedAttributesSchema;
- signatureAlgorithm?: AlgorithmIdentifierSchema;
- signature?: string;
- unsignedAttrs?: SignedAndUnsignedAttributesSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SignerInfoJson;
- }
- type SignedDataCRL = CertificateRevocationList | OtherRevocationInfoFormat;
- type SignedDataCRLJson = CertificateRevocationListJson | OtherRevocationInfoFormatJson;
- declare const VERSION$2 = "version";
- declare const DIGEST_ALGORITHMS = "digestAlgorithms";
- declare const ENCAP_CONTENT_INFO = "encapContentInfo";
- declare const CERTIFICATES = "certificates";
- declare const CRLS = "crls";
- declare const SIGNER_INFOS = "signerInfos";
- declare const OCSPS = "ocsps";
- interface ISignedData {
- version: number;
- digestAlgorithms: AlgorithmIdentifier[];
- encapContentInfo: EncapsulatedContentInfo;
- certificates?: CertificateSetItem[];
- crls?: SignedDataCRL[];
- ocsps?: BasicOCSPResponse[];
- signerInfos: SignerInfo[];
- }
- interface SignedDataJson {
- version: number;
- digestAlgorithms: AlgorithmIdentifierJson[];
- encapContentInfo: EncapsulatedContentInfoJson;
- certificates?: CertificateSetItemJson[];
- crls?: SignedDataCRLJson[];
- ocsps?: BasicOCSPResponseJson[];
- signerInfos: SignerInfoJson[];
- }
- type SignedDataParameters = PkiObjectParameters & Partial<ISignedData>;
- interface SignedDataVerifyParams {
- signer?: number;
- data?: ArrayBuffer;
- trustedCerts?: Certificate[];
- checkDate?: Date;
- checkChain?: boolean;
- passedWhenNotRevValues?: boolean;
- extendedMode?: boolean;
- findOrigin?: FindOriginCallback | null;
- findIssuer?: FindIssuerCallback | null;
- }
- interface SignedDataVerifyErrorParams {
- message: string;
- date?: Date;
- code?: number;
- timestampSerial?: ArrayBuffer | null;
- signatureVerified?: boolean | null;
- signerCertificate?: Certificate | null;
- signerCertificateVerified?: boolean | null;
- certificatePath?: Certificate[];
- }
- interface SignedDataVerifyResult {
- message: string;
- date?: Date;
- code?: number;
- timestampSerial?: ArrayBuffer | null;
- signatureVerified?: boolean | null;
- signerCertificate?: Certificate | null;
- signerCertificateVerified?: boolean | null;
- certificatePath: Certificate[];
- }
- declare class SignedDataVerifyError extends Error implements SignedDataVerifyResult {
- date: Date;
- code: number;
- signatureVerified: boolean | null;
- signerCertificate: Certificate | null;
- signerCertificateVerified: boolean | null;
- timestampSerial: ArrayBuffer | null;
- certificatePath: Certificate[];
- constructor({ message, code, date, signatureVerified, signerCertificate, signerCertificateVerified, timestampSerial, certificatePath, }: SignedDataVerifyErrorParams);
- }
- /**
- * Represents the SignedData structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
- *
- * @example The following example demonstrates how to create and sign CMS Signed Data
- * ```js
- * // Create a new CMS Signed Data
- * const cmsSigned = new pkijs.SignedData({
- * encapContentInfo: new pkijs.EncapsulatedContentInfo({
- * eContentType: pkijs.ContentInfo.DATA,, // "data" content type
- * eContent: new asn1js.OctetString({ valueHex: buffer })
- * }),
- * signerInfos: [
- * new pkijs.SignerInfo({
- * sid: new pkijs.IssuerAndSerialNumber({
- * issuer: cert.issuer,
- * serialNumber: cert.serialNumber
- * })
- * })
- * ],
- * // Signer certificate for chain validation
- * certificates: [cert]
- * });
- *
- * await cmsSigned.sign(keys.privateKey, 0, "SHA-256");
- *
- * // Add Signed Data to Content Info
- * const cms = new pkijs.ContentInfo({
- * contentType: pkijs.ContentInfo.SIGNED_DATA,,
- * content: cmsSigned.toSchema(true),
- * });
- *
- * // Encode CMS to ASN.1
- * const cmsRaw = cms.toSchema().toBER();
- * ```
- *
- * @example The following example demonstrates how to verify CMS Signed Data
- * ```js
- * // Parse CMS and detect it's Signed Data
- * const cms = pkijs.ContentInfo.fromBER(cmsRaw);
- * if (cms.contentType !== pkijs.ContentInfo.SIGNED_DATA) {
- * throw new Error("CMS is not Signed Data");
- * }
- *
- * // Read Signed Data
- * const signedData = new pkijs.SignedData({ schema: cms.content });
- *
- * // Verify Signed Data signature
- * const ok = await signedData.verify({
- * signer: 0,
- * checkChain: true,
- * trustedCerts: [trustedCert],
- * });
- *
- * if (!ok) {
- * throw new Error("CMS signature is invalid")
- * }
- * ```
- */
- declare class SignedData extends PkiObject implements ISignedData {
- static CLASS_NAME: string;
- static ID_DATA: typeof id_ContentType_Data;
- version: number;
- digestAlgorithms: AlgorithmIdentifier[];
- encapContentInfo: EncapsulatedContentInfo;
- certificates?: CertificateSetItem[];
- crls?: SignedDataCRL[];
- ocsps?: BasicOCSPResponse[];
- signerInfos: SignerInfo[];
- /**
- * Initializes a new instance of the {@link SignedData} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SignedDataParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$2): number;
- static defaultValues(memberName: typeof DIGEST_ALGORITHMS): AlgorithmIdentifier[];
- static defaultValues(memberName: typeof ENCAP_CONTENT_INFO): EncapsulatedContentInfo;
- static defaultValues(memberName: typeof CERTIFICATES): CertificateSetItem[];
- static defaultValues(memberName: typeof CRLS): SignedDataCRL[];
- static defaultValues(memberName: typeof OCSPS): BasicOCSPResponse[];
- static defaultValues(memberName: typeof SIGNER_INFOS): SignerInfo[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SignedData ::= SEQUENCE {
- * version CMSVersion,
- * digestAlgorithms DigestAlgorithmIdentifiers,
- * encapContentInfo EncapsulatedContentInfo,
- * certificates [0] IMPLICIT CertificateSet OPTIONAL,
- * crls [1] IMPLICIT RevocationInfoChoices OPTIONAL,
- * signerInfos SignerInfos }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- digestAlgorithms?: string;
- encapContentInfo?: EncapsulatedContentInfoSchema;
- certificates?: string;
- crls?: RevocationInfoChoicesSchema;
- signerInfos?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(encodeFlag?: boolean): SchemaType;
- toJSON(): SignedDataJson;
- verify(params?: SignedDataVerifyParams & {
- extendedMode?: false;
- }, crypto?: ICryptoEngine): Promise<boolean>;
- verify(params: SignedDataVerifyParams & {
- extendedMode: true;
- }, crypto?: ICryptoEngine): Promise<SignedDataVerifyResult>;
- /**
- * Signing current SignedData
- * @param privateKey Private key for "subjectPublicKeyInfo" structure
- * @param signerIndex Index number (starting from 0) of signer index to make signature for
- * @param hashAlgorithm Hashing algorithm. Default SHA-1
- * @param data Detached data
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, signerIndex: number, hashAlgorithm?: string, data?: BufferSource, crypto?: ICryptoEngine): Promise<void>;
- }
- declare const ATTRIBUTES = "attributes";
- interface ISubjectDirectoryAttributes {
- attributes: Attribute[];
- }
- interface SubjectDirectoryAttributesJson {
- attributes: AttributeJson[];
- }
- type SubjectDirectoryAttributesParameters = PkiObjectParameters & Partial<ISubjectDirectoryAttributes>;
- /**
- * Represents the SubjectDirectoryAttributes structure described in [RFC5280](https://datatracker.ietf.org/doc/html/rfc5280)
- */
- declare class SubjectDirectoryAttributes extends PkiObject implements ISubjectDirectoryAttributes {
- static CLASS_NAME: string;
- attributes: Attribute[];
- /**
- * Initializes a new instance of the {@link SubjectDirectoryAttributes} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: SubjectDirectoryAttributesParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof ATTRIBUTES): Attribute[];
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * SubjectDirectoryAttributes ::= SEQUENCE SIZE (1..MAX) OF Attribute
- *```
- */
- static schema(parameters?: SchemaParameters<{
- attributes?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): SubjectDirectoryAttributesJson;
- }
- declare const VERSION$1 = "version";
- declare const POLICY = "policy";
- declare const MESSAGE_IMPRINT$1 = "messageImprint";
- declare const SERIAL_NUMBER = "serialNumber";
- declare const GEN_TIME = "genTime";
- declare const ORDERING = "ordering";
- declare const NONCE$1 = "nonce";
- declare const ACCURACY = "accuracy";
- declare const TSA = "tsa";
- declare const EXTENSIONS$1 = "extensions";
- interface ITSTInfo {
- /**
- * Version of the time-stamp token.
- *
- * Conforming time-stamping servers MUST be able to provide version 1 time-stamp tokens.
- */
- version: number;
- /**
- * TSA's policy under which the response was produced.
- *
- * If a similar field was present in the TimeStampReq, then it MUST have the same value,
- * otherwise an error (unacceptedPolicy) MUST be returned
- */
- policy: string;
- /**
- * The messageImprint MUST have the same value as the similar field in
- * TimeStampReq, provided that the size of the hash value matches the
- * expected size of the hash algorithm identified in hashAlgorithm.
- */
- messageImprint: MessageImprint;
- /**
- * Integer assigned by the TSA to each TimeStampToken.
- *
- * It MUST be unique for each TimeStampToken issued by a given TSA.
- */
- serialNumber: asn1js.Integer;
- /**
- * Time at which the time-stamp token has been created by the TSA
- */
- genTime: Date;
- /**
- * Represents the time deviation around the UTC time contained in GeneralizedTime
- */
- accuracy?: Accuracy;
- /**
- * If the ordering field is missing, or if the ordering field is present
- * and set to false, then the genTime field only indicates the time at
- * which the time-stamp token has been created by the TSA.In such a
- * case, the ordering of time-stamp tokens issued by the same TSA or
- * different TSAs is only possible when the difference between the
- * genTime of the first time-stamp token and the genTime of the second
- * time-stamp token is greater than the sum of the accuracies of the
- * genTime for each time-stamp token.
- *
- * If the ordering field is present and set to true, every time-stamp
- * token from the same TSA can always be ordered based on the genTime
- * field, regardless of the genTime accuracy.
- */
- ordering?: boolean;
- /**
- * Field MUST be present if it was present in the TimeStampReq.
- * In such a case it MUST equal the value provided in the TimeStampReq structure.
- */
- nonce?: asn1js.Integer;
- /**
- * `tsa` field is to give a hint in identifying the name of the TSA.
- * If present, it MUST correspond to one of the subject names included
- * in the certificate that is to be used to verify the token.
- */
- tsa?: GeneralName;
- /**
- * Additional information in the future. Extensions is defined in [RFC2459](https://datatracker.ietf.org/doc/html/rfc2459)
- */
- extensions?: Extension[];
- }
- interface TSTInfoJson {
- version: number;
- policy: string;
- messageImprint: MessageImprintJson;
- serialNumber: asn1js.IntegerJson;
- genTime: Date;
- accuracy?: AccuracyJson;
- ordering?: boolean;
- nonce?: asn1js.IntegerJson;
- tsa?: GeneralNameJson;
- extensions?: ExtensionJson[];
- }
- type TSTInfoParameters = PkiObjectParameters & Partial<ITSTInfo>;
- interface TSTInfoVerifyParams {
- data: ArrayBuffer;
- notBefore?: Date;
- notAfter?: Date;
- }
- /**
- * Represents the TSTInfo structure described in [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- */
- declare class TSTInfo extends PkiObject implements ITSTInfo {
- static CLASS_NAME: string;
- version: number;
- policy: string;
- messageImprint: MessageImprint;
- serialNumber: asn1js.Integer;
- genTime: Date;
- accuracy?: Accuracy;
- ordering?: boolean;
- nonce?: asn1js.Integer;
- tsa?: GeneralName;
- extensions?: Extension[];
- /**
- * Initializes a new instance of the {@link TSTInfo} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: TSTInfoParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION$1): number;
- static defaultValues(memberName: typeof POLICY): string;
- static defaultValues(memberName: typeof MESSAGE_IMPRINT$1): MessageImprint;
- static defaultValues(memberName: typeof SERIAL_NUMBER): asn1js.Integer;
- static defaultValues(memberName: typeof GEN_TIME): Date;
- static defaultValues(memberName: typeof ACCURACY): Accuracy;
- static defaultValues(memberName: typeof ORDERING): boolean;
- static defaultValues(memberName: typeof NONCE$1): asn1js.Integer;
- static defaultValues(memberName: typeof TSA): GeneralName;
- static defaultValues(memberName: typeof EXTENSIONS$1): Extension[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * TSTInfo ::= SEQUENCE {
- * version INTEGER { v1(1) },
- * policy TSAPolicyId,
- * messageImprint MessageImprint,
- * serialNumber INTEGER,
- * genTime GeneralizedTime,
- * accuracy Accuracy OPTIONAL,
- * ordering BOOLEAN DEFAULT FALSE,
- * nonce INTEGER OPTIONAL,
- * tsa [0] GeneralName OPTIONAL,
- * extensions [1] IMPLICIT Extensions OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- policy?: string;
- messageImprint?: MessageImprintSchema;
- serialNumber?: string;
- genTime?: string;
- accuracy?: AccuracySchema;
- ordering?: string;
- nonce?: string;
- tsa?: GeneralNameSchema;
- extensions?: string;
- extension?: ExtensionSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): TSTInfoJson;
- /**
- * Verify current TST Info value
- * @param params Input parameters
- * @param crypto Crypto engine
- */
- verify(params: TSTInfoVerifyParams, crypto?: ICryptoEngine): Promise<boolean>;
- }
- declare const VERSION = "version";
- declare const MESSAGE_IMPRINT = "messageImprint";
- declare const REQ_POLICY = "reqPolicy";
- declare const NONCE = "nonce";
- declare const CERT_REQ = "certReq";
- declare const EXTENSIONS = "extensions";
- interface ITimeStampReq {
- /**
- * Version of the Time-Stamp request. Should be version 1.
- */
- version: number;
- /**
- * Contains the hash of the datum to be time-stamped
- */
- messageImprint: MessageImprint;
- /**
- * Indicates the TSA policy under which the TimeStampToken SHOULD be provided.
- */
- reqPolicy?: string;
- /**
- * The nonce, if included, allows the client to verify the timeliness of
- * the response when no local clock is available. The nonce is a large
- * random number with a high probability that the client generates it
- * only once.
- */
- nonce?: asn1js.Integer;
- /**
- * If the certReq field is present and set to true, the TSA's public key
- * certificate that is referenced by the ESSCertID identifier inside a
- * SigningCertificate attribute in the response MUST be provided by the
- * TSA in the certificates field from the SignedData structure in that
- * response. That field may also contain other certificates.
- *
- * If the certReq field is missing or if the certReq field is present
- * and set to false then the certificates field from the SignedData
- * structure MUST not be present in the response.
- */
- certReq?: boolean;
- /**
- * The extensions field is a generic way to add additional information
- * to the request in the future.
- */
- extensions?: Extension[];
- }
- interface TimeStampReqJson {
- version: number;
- messageImprint: MessageImprintJson;
- reqPolicy?: string;
- nonce?: asn1js.IntegerJson;
- certReq?: boolean;
- extensions?: ExtensionJson[];
- }
- type TimeStampReqParameters = PkiObjectParameters & Partial<ITimeStampReq>;
- /**
- * Represents the TimeStampReq structure described in [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- *
- * @example The following example demonstrates how to create Time-Stamp Request
- * ```js
- * const nonce = pkijs.getRandomValues(new Uint8Array(10)).buffer;
- *
- * const tspReq = new pkijs.TimeStampReq({
- * version: 1,
- * messageImprint: await pkijs.MessageImprint.create("SHA-256", message),
- * reqPolicy: "1.2.3.4.5.6",
- * certReq: true,
- * nonce: new asn1js.Integer({ valueHex: nonce }),
- * });
- *
- * const tspReqRaw = tspReq.toSchema().toBER();
- * ```
- */
- declare class TimeStampReq extends PkiObject implements ITimeStampReq {
- static CLASS_NAME: string;
- version: number;
- messageImprint: MessageImprint;
- reqPolicy?: string;
- nonce?: asn1js.Integer;
- certReq?: boolean;
- extensions?: Extension[];
- /**
- * Initializes a new instance of the {@link TimeStampReq} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: TimeStampReqParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof VERSION): number;
- static defaultValues(memberName: typeof MESSAGE_IMPRINT): MessageImprint;
- static defaultValues(memberName: typeof REQ_POLICY): string;
- static defaultValues(memberName: typeof NONCE): asn1js.Integer;
- static defaultValues(memberName: typeof CERT_REQ): boolean;
- static defaultValues(memberName: typeof EXTENSIONS): Extension[];
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * TimeStampReq ::= SEQUENCE {
- * version INTEGER { v1(1) },
- * messageImprint MessageImprint,
- * reqPolicy TSAPolicyId OPTIONAL,
- * nonce INTEGER OPTIONAL,
- * certReq BOOLEAN DEFAULT FALSE,
- * extensions [0] IMPLICIT Extensions OPTIONAL }
- *
- * TSAPolicyId ::= OBJECT IDENTIFIER
- *```
- */
- static schema(parameters?: SchemaParameters<{
- version?: string;
- messageImprint?: MessageImprintSchema;
- reqPolicy?: string;
- nonce?: string;
- certReq?: string;
- extensions?: string;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): TimeStampReqJson;
- }
- declare const STATUS = "status";
- declare const TIME_STAMP_TOKEN = "timeStampToken";
- interface ITimeStampResp {
- /**
- * Time-Stamp status
- */
- status: PKIStatusInfo;
- /**
- * Time-Stamp token
- */
- timeStampToken?: ContentInfo;
- }
- interface TimeStampRespJson {
- status: PKIStatusInfoJson;
- timeStampToken?: ContentInfoJson;
- }
- interface TimeStampRespVerifyParams {
- signer?: number;
- trustedCerts?: Certificate[];
- data?: ArrayBuffer;
- }
- type TimeStampRespParameters = PkiObjectParameters & Partial<ITimeStampResp>;
- /**
- * Represents the TimeStampResp structure described in [RFC3161](https://www.ietf.org/rfc/rfc3161.txt)
- *
- * @example The following example demonstrates how to create and sign Time-Stamp Response
- * ```js
- * // Generate random serial number
- * const serialNumber = pkijs.getRandomValues(new Uint8Array(10)).buffer;
- *
- * // Create specific TST info structure to sign
- * const tstInfo = new pkijs.TSTInfo({
- * version: 1,
- * policy: tspReq.reqPolicy,
- * messageImprint: tspReq.messageImprint,
- * serialNumber: new asn1js.Integer({ valueHex: serialNumber }),
- * genTime: new Date(),
- * ordering: true,
- * accuracy: new pkijs.Accuracy({
- * seconds: 1,
- * millis: 1,
- * micros: 10
- * }),
- * nonce: tspReq.nonce,
- * });
- *
- * // Create and sign CMS Signed Data with TSTInfo
- * const cmsSigned = new pkijs.SignedData({
- * version: 3,
- * encapContentInfo: new pkijs.EncapsulatedContentInfo({
- * eContentType: "1.2.840.113549.1.9.16.1.4", // "tSTInfo" content type
- * eContent: new asn1js.OctetString({ valueHex: tstInfo.toSchema().toBER() }),
- * }),
- * signerInfos: [
- * new pkijs.SignerInfo({
- * version: 1,
- * sid: new pkijs.IssuerAndSerialNumber({
- * issuer: cert.issuer,
- * serialNumber: cert.serialNumber
- * })
- * })
- * ],
- * certificates: [cert]
- * });
- *
- * await cmsSigned.sign(keys.privateKey, 0, "SHA-256");
- *
- * // Create CMS Content Info
- * const cmsContent = new pkijs.ContentInfo({
- * contentType: pkijs.ContentInfo.SIGNED_DATA,
- * content: cmsSigned.toSchema(true)
- * });
- *
- * // Finally create completed TSP response structure
- * const tspResp = new pkijs.TimeStampResp({
- * status: new pkijs.PKIStatusInfo({ status: pkijs.PKIStatus.granted }),
- * timeStampToken: new pkijs.ContentInfo({ schema: cmsContent.toSchema() })
- * });
- *
- * const tspRespRaw = tspResp.toSchema().toBER();
- * ```
- */
- declare class TimeStampResp extends PkiObject implements ITimeStampResp {
- static CLASS_NAME: string;
- status: PKIStatusInfo;
- timeStampToken?: ContentInfo;
- /**
- * Initializes a new instance of the {@link TimeStampResp} class
- * @param parameters Initialization parameters
- */
- constructor(parameters?: TimeStampRespParameters);
- /**
- * Returns default values for all class members
- * @param memberName String name for a class member
- * @returns Default value
- */
- static defaultValues(memberName: typeof STATUS): PKIStatusInfo;
- static defaultValues(memberName: typeof TIME_STAMP_TOKEN): ContentInfo;
- /**
- * Compare values with default values for all class members
- * @param memberName String name for a class member
- * @param memberValue Value to compare with default value
- */
- static compareWithDefault(memberName: string, memberValue: any): boolean;
- /**
- * @inheritdoc
- * @asn ASN.1 schema
- * ```asn
- * TimeStampResp ::= SEQUENCE {
- * status PKIStatusInfo,
- * timeStampToken TimeStampToken OPTIONAL }
- *```
- */
- static schema(parameters?: SchemaParameters<{
- status?: PKIStatusInfoSchema;
- timeStampToken?: ContentInfoSchema;
- }>): SchemaType;
- fromSchema(schema: SchemaType): void;
- toSchema(): asn1js.Sequence;
- toJSON(): TimeStampRespJson;
- /**
- * Sign current TSP Response
- * @param privateKey Private key for "subjectPublicKeyInfo" structure
- * @param hashAlgorithm Hashing algorithm. Default SHA-1
- * @param crypto Crypto engine
- */
- sign(privateKey: CryptoKey, hashAlgorithm?: string, crypto?: ICryptoEngine): Promise<void>;
- /**
- * Verify current TSP Response
- * @param verificationParameters Input parameters for verification
- * @param crypto Crypto engine
- */
- verify(verificationParameters?: TimeStampRespVerifyParams, crypto?: ICryptoEngine): Promise<boolean>;
- private assertContentType;
- }
- declare class ParameterError extends TypeError {
- static readonly NAME = "ParameterError";
- static assert(target: string, params: any, ...fields: string[]): void;
- static assert(params: any, ...fields: string[]): void;
- static assertEmpty(value: unknown, name: string, target?: string): asserts value;
- name: typeof ParameterError.NAME;
- field: string;
- target?: string;
- constructor(field: string, target?: string | null, message?: string);
- }
- interface AnyConstructor {
- new (args: any): any;
- }
- type ArgumentType = "undefined" | "null" | "boolean" | "number" | "string" | "object" | "Array" | "ArrayBuffer" | "ArrayBufferView" | AnyConstructor;
- declare class ArgumentError extends TypeError {
- static readonly NAME = "ArgumentError";
- static isType(value: any, type: "undefined"): value is undefined;
- static isType(value: any, type: "null"): value is null;
- static isType(value: any, type: "boolean"): value is boolean;
- static isType(value: any, type: "number"): value is number;
- static isType(value: any, type: "object"): value is object;
- static isType(value: any, type: "string"): value is string;
- static isType(value: any, type: "Array"): value is any[];
- static isType(value: any, type: "ArrayBuffer"): value is ArrayBuffer;
- static isType(value: any, type: "ArrayBufferView"): value is ArrayBufferView;
- static isType<T>(value: any, type: new (...args: any[]) => T): value is T;
- static isType(value: any, type: ArgumentType): boolean;
- static assert(value: any, name: string, type: "undefined"): asserts value is undefined;
- static assert(value: any, name: string, type: "null"): asserts value is null;
- static assert(value: any, name: string, type: "boolean"): asserts value is boolean;
- static assert(value: any, name: string, type: "number"): asserts value is number;
- static assert(value: any, name: string, type: "object"): asserts value is {
- [key: string]: any;
- };
- static assert(value: any, name: string, type: "string"): asserts value is string;
- static assert(value: any, name: string, type: "Array"): asserts value is any[];
- static assert(value: any, name: string, type: "ArrayBuffer"): asserts value is ArrayBuffer;
- static assert(value: any, name: string, type: "ArrayBufferView"): asserts value is ArrayBufferView;
- static assert<T>(value: any, name: string, type: new (...args: any[]) => T): asserts value is T;
- static assert(value: any, name: string, type: ArgumentType, ...types: ArgumentType[]): void;
- name: typeof ArgumentError.NAME;
- }
- interface AsnFromBerResult {
- offset: number;
- result: any;
- }
- interface AsnCompareSchemaResult {
- verified: boolean;
- result?: any;
- }
- declare class AsnError extends Error {
- static assertSchema(asn1: AsnCompareSchemaResult, target: string): asserts asn1 is {
- verified: true;
- result: any;
- };
- static assert(asn: AsnFromBerResult, target: string): void;
- constructor(message: string);
- }
- export { AbstractCryptoEngine, AccessDescription, Accuracy, AlgorithmIdentifier, AltName, ArgumentError, AsnError, AttCertValidityPeriod, Attribute, AttributeCertificateInfoV1, AttributeCertificateInfoV2, AttributeCertificateV1, AttributeCertificateV2, AttributeTypeAndValue, AuthenticatedSafe, AuthorityKeyIdentifier, BasicConstraints, BasicOCSPResponse, CAVersion, CRLBag, CRLDistributionPoints, CertBag, CertID, Certificate, CertificateChainValidationEngine, CertificatePolicies, CertificateRevocationList, CertificateSet, CertificateTemplate, CertificationRequest, ChainValidationCode, ChainValidationError, ContentInfo, CryptoEngine, DigestInfo, DistributionPoint, ECCCMSSharedInfo, ECNamedCurves, ECPrivateKey, ECPublicKey, EncapsulatedContentInfo, EncryptedContentInfo, EncryptedData, EnvelopedData, ExtKeyUsage, Extension, ExtensionValueFactory, Extensions, GeneralName, GeneralNames, GeneralSubtree, HASHED_MESSAGE, HASH_ALGORITHM$3 as HASH_ALGORITHM, Holder, InfoAccess, IssuerAndSerialNumber, IssuerSerial, IssuingDistributionPoint, KEKIdentifier, KEKRecipientInfo, KeyAgreeRecipientIdentifier, KeyAgreeRecipientInfo, KeyBag, KeyTransRecipientInfo, MICROS, MILLIS, MacData, MessageImprint, NameConstraints, OCSPRequest, OCSPResponse, ObjectDigestInfo, OriginatorIdentifierOrKey, OriginatorInfo, OriginatorPublicKey, OtherCertificateFormat, OtherKeyAttribute, OtherPrimeInfo, OtherRecipientInfo, OtherRevocationInfoFormat, PBES2Params, PBKDF2Params, PFX, PKCS8ShroudedKeyBag, PKIStatus, PKIStatusInfo, POLICY_IDENTIFIER, POLICY_QUALIFIERS, ParameterError, PasswordRecipientinfo, PkiObject, PolicyConstraints, PolicyInformation, PolicyMapping, PolicyMappings, PolicyQualifierInfo, PrivateKeyInfo, PrivateKeyUsagePeriod, PublicKeyInfo, QCStatement, QCStatements, RDN, RSAESOAEPParams, RSAPrivateKey, RSAPublicKey, RSASSAPSSParams, RecipientEncryptedKey, RecipientEncryptedKeys, RecipientIdentifier, RecipientInfo, RecipientKeyIdentifier, RelativeDistinguishedNames, Request, ResponseBytes, ResponseData, RevocationInfoChoices, RevokedCertificate, SECONDS, SafeBag, SafeBagValueFactory, SafeContents, SecretBag, Signature, SignedAndUnsignedAttributes, SignedCertificateTimestamp, SignedCertificateTimestampList, SignedData, SignedDataVerifyError, SignerInfo, SingleResponse, SubjectDirectoryAttributes, TBSRequest, TSTInfo, TYPE$5 as TYPE, TYPE_AND_VALUES, Time, TimeStampReq, TimeStampResp, TimeType, V2Form, VALUE$6 as VALUE, VALUE_BEFORE_DECODE, checkCA, createCMSECDSASignature, createECDSASignatureFromCMS, engine, getAlgorithmByOID, getAlgorithmParameters, getCrypto, getEngine, getHashAlgorithm, getOIDByAlgorithm, getRandomValues, id_AnyPolicy, id_AuthorityInfoAccess, id_AuthorityKeyIdentifier, id_BaseCRLNumber, id_BasicConstraints, id_CRLBag_X509CRL, id_CRLDistributionPoints, id_CRLNumber, id_CRLReason, id_CertBag_AttributeCertificate, id_CertBag_SDSICertificate, id_CertBag_X509Certificate, id_CertificateIssuer, id_CertificatePolicies, id_ContentType_Data, id_ContentType_EncryptedData, id_ContentType_EnvelopedData, id_ContentType_SignedData, id_ExtKeyUsage, id_FreshestCRL, id_InhibitAnyPolicy, id_InvalidityDate, id_IssuerAltName, id_IssuingDistributionPoint, id_KeyUsage, id_MicrosoftAppPolicies, id_MicrosoftCaVersion, id_MicrosoftCertTemplateV1, id_MicrosoftCertTemplateV2, id_MicrosoftPrevCaCertHash, id_NameConstraints, id_PKIX_OCSP_Basic, id_PolicyConstraints, id_PolicyMappings, id_PrivateKeyUsagePeriod, id_QCStatements, id_SignedCertificateTimestampList, id_SubjectAltName, id_SubjectDirectoryAttributes, id_SubjectInfoAccess, id_SubjectKeyIdentifier, id_ad, id_ad_caIssuers, id_ad_ocsp, id_eContentType_TSTInfo, id_pkix, id_sha1, id_sha256, id_sha384, id_sha512, kdf, setEngine, stringPrep, verifySCTsForCertificate };
- export type { AccessDescriptionJson, AccessDescriptionParameters, AccuracyJson, AccuracyParameters, AccuracySchema, AlgorithmIdentifierJson, AlgorithmIdentifierParameters, AlgorithmIdentifierSchema, AltNameJson, AltNameParameters, AnyConstructor, ArgumentType, AsnCompareSchemaResult, AsnFromBerResult, AttCertValidityPeriodJson, AttCertValidityPeriodParameters, AttCertValidityPeriodSchema, AttributeCertificateInfoV1Json, AttributeCertificateInfoV1Parameters, AttributeCertificateInfoV1Schema, AttributeCertificateInfoV2Json, AttributeCertificateInfoV2Parameters, AttributeCertificateInfoV2Schema, AttributeCertificateV1Json, AttributeCertificateV1Parameters, AttributeCertificateV2Json, AttributeCertificateV2Parameters, AttributeJson, AttributeParameters, AttributeSchema, AttributeTypeAndValueJson, AttributeTypeAndValueParameters, AttributeValueType, AuthenticatedSafeJson, AuthenticatedSafeParameters, AuthorityKeyIdentifierJson, AuthorityKeyIdentifierParameters, BagType, BagTypeConstructor, BagTypeJson, BasicConstraintsJson, BasicConstraintsParameters, BasicOCSPResponseJson, BasicOCSPResponseParameters, BasicOCSPResponseVerifyParams, CAVersionJson, CAVersionParameters, CRLBagJson, CRLBagParameters, CRLDistributionPointsJson, CRLDistributionPointsParameters, CertBagJson, CertBagParameters, CertIDCreateParams, CertIDJson, CertIDParameters, CertIDSchema, CertificateChainValidationEngineParameters, CertificateChainValidationEngineVerifyParams, CertificateChainValidationEngineVerifyResult, CertificateJson, CertificateParameters, CertificatePoliciesJson, CertificatePoliciesParameters, CertificateRevocationListJson, CertificateRevocationListParameters, CertificateRevocationListVerifyParams, CertificateSchema, CertificateSetItem, CertificateSetItemJson, CertificateSetJson, CertificateSetParameters, CertificateStatus, CertificateTemplateJson, CertificateTemplateParameters, CertificationRequestInfoParameters, CertificationRequestJson, CertificationRequestParameters, ContentEncryptionAesCbcParams, ContentEncryptionAesGcmParams, ContentEncryptionAlgorithm, ContentInfoJson, ContentInfoParameters, ContentInfoSchema, CryptoEngineAlgorithmOperation, CryptoEngineAlgorithmParams, CryptoEngineConstructor, CryptoEngineDecryptParams, CryptoEngineEncryptParams, CryptoEngineParameters, CryptoEnginePublicKeyParams, CryptoEngineSignWithPrivateKeyParams, CryptoEngineSignatureParams, CryptoEngineStampDataWithPasswordParams, CryptoEngineVerifyDataStampedWithPasswordParams, DigestInfoJson, DigestInfoParameters, DigestInfoSchema, DistributionPointJson, DistributionPointName, DistributionPointNameJson, DistributionPointParameters, ECCCMSSharedInfoJson, ECCCMSSharedInfoParameters, ECNamedCurve, ECPrivateKeyJson, ECPrivateKeyParameters, ECPublicKeyJson, ECPublicKeyParameters, EncapsulatedContentInfoJson, EncapsulatedContentInfoParameters, EncapsulatedContentInfoSchema, EncryptedContentInfoJson, EncryptedContentInfoSchema, EncryptedContentInfoSplit, EncryptedContentParameters, EncryptedDataEncryptParams, EncryptedDataJson, EncryptedDataParameters, EnvelopedDataDecryptBaseParams, EnvelopedDataDecryptBufferParams, EnvelopedDataDecryptKeyParams, EnvelopedDataDecryptParams, EnvelopedDataEncryptionParams, EnvelopedDataJson, EnvelopedDataParameters, ExtKeyUsageJson, ExtKeyUsageParameters, ExtensionConstructorParameters, ExtensionJson, ExtensionParameters, ExtensionParsedValue, ExtensionSchema, ExtensionValueConstructor, ExtensionValueType, ExtensionsJson, ExtensionsParameters, ExtensionsSchema, FindIssuerCallback, FindOriginCallback, GeneralNameJson, GeneralNameParameters, GeneralNameSchema, GeneralNamesJson, GeneralNamesParameters, GeneralNamesSchema, GeneralSubtreeJson, GeneralSubtreeParameters, GlobalCryptoEngine, HolderJson, HolderParameters, HolderSchema, IAccessDescription, IAccuracy, IAlgorithmIdentifier, IAltName, IAttCertValidityPeriod, IAttribute, IAttributeCertificateInfoV1, IAttributeCertificateInfoV2, IAttributeCertificateV1, IAttributeCertificateV2, IAttributeTypeAndValue, IAuthenticatedSafe, IAuthorityKeyIdentifier, IBasicConstraints, IBasicOCSPResponse, ICAVersion, ICRLBag, ICRLDistributionPoints, ICertBag, ICertID, ICertificate, ICertificatePolicies, ICertificateRevocationList, ICertificateSet, ICertificateTemplate, ICertificationRequest, IContentInfo, ICryptoEngine, IDigestInfo, IDistributionPoint, IECCCMSSharedInfo, IECPrivateKey, IECPublicKey, IEncapsulatedContentInfo, IEncryptedContentInfo, IEncryptedData, IEnvelopedData, IExtKeyUsage, IExtension, IExtensions, IGeneralName, IGeneralNames, IGeneralSubtree, IHolder, IInfoAccess, IIssuerAndSerialNumber, IIssuerSerial, IIssuingDistributionPoint, IKEKIdentifier, IKEKRecipientInfo, IKeyAgreeRecipientIdentifier, IKeyAgreeRecipientInfo, IKeyTransRecipientInfo, IMacData, IMessageImprint, INameConstraints, IOCSPRequest, IOCSPResponse, IObjectDigestInfo, IOriginatorIdentifierOrKey, IOriginatorInfo, IOriginatorPublicKey, IOtherCertificateFormat, IOtherKeyAttribute, IOtherPrimeInfo, IOtherRecipientInfo, IOtherRevocationInfoFormat, IPBES2Params, IPBKDF2Params, IPFX, IPKCS8ShroudedKeyBag, IPKIStatusInfo, IPasswordRecipientInfo, IPolicyConstraints, IPolicyInformation, IPolicyMapping, IPolicyMappings, IPolicyQualifierInfo, IPrivateKeyInfo, IPrivateKeyUsagePeriod, IPublicKeyInfo, IQCStatement, IQCStatements, IRSAESOAEPParams, IRSAPrivateKey, IRSAPublicKey, IRSASSAPSSParams, IRecipientEncryptedKey, IRecipientEncryptedKeys, IRecipientIdentifier, IRecipientInfo, IRecipientKeyIdentifier, IRelativeDistinguishedNames, IRequest, IResponseBytes, IResponseData, IRevocationInfoChoices, IRevokedCertificate, ISafeBag, ISafeContents, ISecretBag, ISignature, ISignedAndUnsignedAttributes, ISignedCertificateTimestamp, ISignedCertificateTimestampList, ISignedData, ISignerInfo, ISingleResponse, ISubjectDirectoryAttributes, ITBSRequest, ITSTInfo, ITime, ITimeStampReq, ITimeStampResp, IV2Form, InfoAccessJson, InfoAccessParameters, IssuerAndSerialNumberJson, IssuerAndSerialNumberParameters, IssuerAndSerialNumberSchema, IssuerSerialJson, IssuerSerialParameters, IssuingDistributionPointJson, IssuingDistributionPointParameters, KEKIdentifierJson, KEKIdentifierParameters, KEKIdentifierSchema, KEKRecipientInfoJson, KEKRecipientInfoParameters, KeyAgreeRecipientIdentifierJson, KeyAgreeRecipientIdentifierParameters, KeyAgreeRecipientIdentifierSchema, KeyAgreeRecipientInfoJson, KeyAgreeRecipientInfoParameters, KeyTransRecipientInfoJson, KeyTransRecipientInfoParameters, Log, MacDataJson, MacDataParameters, MacDataSchema, MakeInternalValuesParams, MessageImprintJson, MessageImprintParameters, MessageImprintSchema, NameConstraintsJson, NameConstraintsParameters, OCSPRequestJson, OCSPRequestParameters, OCSPResponseJson, OCSPResponseParameters, ObjectDigestInfoJson, ObjectDigestInfoParameters, OriginatorIdentifierOrKeyJson, OriginatorIdentifierOrKeyParameters, OriginatorIdentifierOrKeySchema, OriginatorInfoJson, OriginatorInfoParameters, OriginatorPublicKeyJson, OriginatorPublicKeyParameters, OtherCertificateFormatJson, OtherCertificateFormatParameters, OtherKeyAttributeJson, OtherKeyAttributeParameters, OtherKeyAttributeSchema, OtherPrimeInfoJson, OtherPrimeInfoParameters, OtherPrimeInfoSchema, OtherRecipientInfoJson, OtherRecipientInfoParameters, OtherRevocationInfoFormatJson, OtherRevocationInfoFormatParameters, PBES2ParamsJson, PBES2ParamsParameters, PBKDF2ParamsJson, PBKDF2ParamsParameters, PFXJson, PFXParameters, PFXParsedValue, PKCS8ShroudedKeyBagJson, PKCS8ShroudedKeyBagParameters, PKIStatusInfoJson, PKIStatusInfoParameters, PKIStatusInfoSchema, PasswordRecipientInfoJson, PasswordRecipientinfoParameters, PkiObjectParameters, PolicyConstraintsJson, PolicyConstraintsParameters, PolicyInformationJson, PolicyInformationParameters, PolicyMappingJson, PolicyMappingParameters, PolicyMappingsJson, PolicyMappingsParameters, PolicyQualifierInfoJson, PolicyQualifierInfoParameters, PrivateKeyInfoJson, PrivateKeyInfoParameters, PrivateKeyUsagePeriodJson, PrivateKeyUsagePeriodParameters, PublicKeyInfoJson, PublicKeyInfoParameters, PublicKeyInfoSchema, QCStatementJson, QCStatementParameters, QCStatementSchema, QCStatementsJson, QCStatementsParameters, RSAESOAEPParamsJson, RSAESOAEPParamsParameters, RSAPrivateKeyJson, RSAPrivateKeyParameters, RSAPublicKeyJson, RSAPublicKeyParameters, RSASSAPSSParamsJson, RSASSAPSSParamsParameters, RecipientEncryptedKeyJson, RecipientEncryptedKeyParameters, RecipientEncryptedKeysJson, RecipientEncryptedKeysParameters, RecipientEncryptedKeysSchema, RecipientIdentifierJson, RecipientIdentifierMixedJson, RecipientIdentifierParameters, RecipientIdentifierSchema, RecipientIdentifierType, RecipientInfoJson, RecipientInfoParameters, RecipientInfoValue, RecipientInfoValueJson, RecipientKeyIdentifierJson, RecipientKeyIdentifierParameters, RecipientKeyIdentifierSchema, RelativeDistinguishedNamesJson, RelativeDistinguishedNamesParameters, RelativeDistinguishedNamesSchema, RequestJson, RequestParameters, RequestSchema, ResponseBytesJson, ResponseBytesParameters, ResponseBytesSchema, ResponseDataJson, ResponseDataParameters, ResponseDataSchema, RevocationInfoChoicesJson, RevocationInfoChoicesParameters, RevocationInfoChoicesSchema, RevokedCertificateJson, RevokedCertificateParameters, SafeBagJson, SafeBagParameters, SafeContent, SafeContentsJson, SafeContentsParameters, SchemaCompatible, SchemaConstructor, SchemaNames, SchemaParameters, SchemaType, SecretBagJson, SecretBagParameters, SignatureJson, SignatureParameters, SignatureSchema, SignedAndUnsignedAttributesJson, SignedAndUnsignedAttributesParameters, SignedAndUnsignedAttributesSchema, SignedCertificateTimestampJson, SignedCertificateTimestampListJson, SignedCertificateTimestampListParameters, SignedCertificateTimestampParameters, SignedDataCRL, SignedDataCRLJson, SignedDataJson, SignedDataParameters, SignedDataVerifyErrorParams, SignedDataVerifyParams, SignedDataVerifyResult, SignerInfoJson, SignerInfoParameters, SingleResponseJson, SingleResponseParameters, SingleResponseSchema, SubjectDirectoryAttributesJson, SubjectDirectoryAttributesParameters, TBSCertListSchema, TBSCertificateSchema, TBSRequestJson, TBSRequestParameters, TBSRequestSchema, TSTInfoJson, TSTInfoParameters, TSTInfoVerifyParams, TimeJson, TimeParameters, TimeSchema, TimeStampReqJson, TimeStampReqParameters, TimeStampRespJson, TimeStampRespParameters, TimeStampRespVerifyParams, V2FormJson, V2FormParameters };
|