UNPKG

@redocly/graphql-docs

Version:

Redocly GraphQL docs

2 lines (1 loc) 1.27 kB
var y=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var v=(t,n)=>{for(var i in n)y(t,i,{get:n[i],enumerable:!0})},_=(t,n,i,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of w(n))!b.call(t,o)&&o!==i&&y(t,o,{get:()=>n[o],enumerable:!(e=l(n,o))||e.enumerable});return t};var x=t=>_(y({},"__esModule",{value:!0}),t);var C={};v(C,{algorithm:()=>h,verify:()=>m});module.exports=x(C);var A=function(t,n,i,e){function o(c){return c instanceof i?c:new i(function(u){u(c)})}return new(i||(i=Promise))(function(c,u){function d(r){try{f(e.next(r))}catch(a){u(a)}}function p(r){try{f(e.throw(r))}catch(a){u(a)}}function f(r){r.done?c(r.value):o(r.value).then(d,p)}f((e=e.apply(t,n||[])).next())})};const h={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"};function s(t){const n=new ArrayBuffer(t.length),i=new Uint8Array(n);for(let e=0,o=t.length;e<o;e++)i[e]=t.charCodeAt(e);return n}function K(){const t=s(atob(REDOCLY_PUBLIC_KEY));return crypto.subtle.importKey("spki",t,h,!0,["verify"])}function S(t){return new TextEncoder().encode(t)}function m(t,n){return A(this,void 0,void 0,function*(){return crypto.subtle.verify(h,yield K(),s(atob(n)),S(t))})}0&&(module.exports={algorithm,verify});