{"version":3,"file":"ModernBrowserCrypto.js","sources":["../../src/crypto/ModernBrowserCrypto.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { KEY_FORMAT_JWK } from \"../utils/BrowserConstants\";\nimport { ISubtleCrypto } from \"./ISubtleCrypto\";\n\nexport class ModernBrowserCrypto implements ISubtleCrypto {\n getRandomValues(dataBuffer: Uint8Array): Uint8Array {\n return window.crypto.getRandomValues(dataBuffer);\n }\n\n async generateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise {\n return window.crypto.subtle.generateKey(algorithm, extractable, keyUsages) as Promise;\n }\n\n async exportKey(key: CryptoKey): Promise {\n return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key) as Promise;\n }\n\n async importKey(keyData: JsonWebKey, algorithm: RsaHashedImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise {\n return window.crypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages) as Promise;\n }\n\n async sign(algorithm: AlgorithmIdentifier, key: CryptoKey, data: ArrayBuffer): Promise {\n return window.crypto.subtle.sign(algorithm, key, data) as Promise;\n }\n\n async digest(algorithm: AlgorithmIdentifier, data: Uint8Array): Promise {\n return window.crypto.subtle.digest(algorithm, data) as Promise;\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAQA;KAwBC;IAvBG,6CAAe,GAAf,UAAgB,UAAsB;QAClC,OAAO,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;KACpD;IAEK,yCAAW,GAAjB,UAAkB,SAAgC,EAAE,WAAoB,EAAE,SAAqB;;;gBAC3F,sBAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,CAA2B,EAAC;;;KACxG;IAEK,uCAAS,GAAf,UAAgB,GAAc;;;gBAC1B,sBAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,GAAG,CAAwB,EAAC;;;KACrF;IAEK,uCAAS,GAAf,UAAgB,OAAmB,EAAE,SAAgC,EAAE,WAAoB,EAAE,SAAqB;;;gBAC9G,sBAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,CAAuB,EAAC;;;KAC3H;IAEK,kCAAI,GAAV,UAAW,SAA8B,EAAE,GAAc,EAAE,IAAiB;;;gBACxE,sBAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAyB,EAAC;;;KAClF;IAEK,oCAAM,GAAZ,UAAa,SAA8B,EAAE,IAAgB;;;gBACzD,sBAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAyB,EAAC;;;KAC/E;IACL,0BAAC;AAAD,CAAC;;;;"}