/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/secrets-manager-signature-tools@1.0.7/dist/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},__generator=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};exports.__esModule=!0;var crypto_1=__importDefault(require("./crypto")),aws_secrets_manager_1=__importDefault(require("./services/aws-secrets-manager")),SimpleSignEngine=function(){function t(t){this.config=t,this.keyMap=new Map,this.asmClient=new aws_secrets_manager_1.default(this.config.asmClientConfig),this.cryptoClient=new crypto_1.default(this.config.cryptoConfig)}return t.prototype.getSign=function(t,e,n){return void 0===n&&(n=!1),__awaiter(this,void 0,void 0,(function(){var r,i;return __generator(this,(function(o){switch(o.label){case 0:return(r=this.keyMap.get(e))?[2,this.cryptoClient.sign(r,t)]:[3,1];case 1:return[4,this.asmClient.getSecret({SecretId:e})];case 2:return i=o.sent(),n&&this.keyMap.set(e,i),[2,this.cryptoClient.sign(i,t)]}}))}))},t.prototype.verifySign=function(t,e,n,r){return void 0===r&&(r=!1),__awaiter(this,void 0,void 0,(function(){var i,o;return __generator(this,(function(a){switch(a.label){case 0:return(i=this.keyMap.get(n))?[2,this.cryptoClient.verify(i,e,t)]:[3,1];case 1:return[4,this.asmClient.getSecret({SecretId:n})];case 2:return o=a.sent(),r&&this.keyMap.set(n,o),[2,this.cryptoClient.verify(o,e,t)]}}))}))},t}();exports.default=SimpleSignEngine;
//# sourceMappingURL=/sm/b0518e2030499ec4c8c4f46d4d828b88ac9d464dbb2e16df7a3c6dd8cd79ed09.map