{"version":3,"sources":["webpack://cryptoPro/webpack/universalModuleDefinition","webpack://cryptoPro/webpack/bootstrap","webpack://cryptoPro/./helpers/_afterPluginsLoaded.ts","webpack://cryptoPro/./helpers/_extractMeaningfulErrorMessage.ts","webpack://cryptoPro/./helpers/_generateCadesFn.ts","webpack://cryptoPro/./constants/index.ts","webpack://cryptoPro/./helpers/_getCadesCert.ts","webpack://cryptoPro/./helpers/_getDateObj.ts","webpack://cryptoPro/../node_modules/buffer/index.js","webpack://cryptoPro/./api/getUserCertificates.ts","webpack://cryptoPro/./api/certificate/index.ts","webpack://cryptoPro/./api/certificate/getCadesProp.ts","webpack://cryptoPro/./api/getSystemInfo.ts","webpack://cryptoPro/./crypto-pro.ts","webpack://cryptoPro/./api/index.ts","webpack://cryptoPro/./api/getCertificate.ts","webpack://cryptoPro/./vendor/cadesplugin_api.js","webpack://cryptoPro/./api/certificate/certificate.ts","webpack://cryptoPro/./constants/cades-constants.ts","webpack://cryptoPro/./constants/issuer-tags-translations.ts","webpack://cryptoPro/./constants/oids-dictionary.ts","webpack://cryptoPro/./constants/subject-tags-translations.ts","webpack://cryptoPro/./api/certificate/exportBase64.ts","webpack://cryptoPro/./api/certificate/getAlgorithm.ts","webpack://cryptoPro/./api/certificate/getDecodedExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getInfo.ts","webpack://cryptoPro/./helpers/_parseCertInfo.ts","webpack://cryptoPro/./api/certificate/hasExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/isValid.ts","webpack://cryptoPro/./helpers/_extractCommonName.ts","webpack://cryptoPro/./api/isValidSystemSetup.ts","webpack://cryptoPro/./helpers/_isSupportedCadesVersion.ts","webpack://cryptoPro/./helpers/_isSupportedCSPVersion.ts","webpack://cryptoPro/./api/createSignature.ts","webpack://cryptoPro/./api/createXMLSignature.ts","webpack://cryptoPro/./api/createDetachedSignature.ts","webpack://cryptoPro/./api/addDetachedSignature.ts","webpack://cryptoPro/./api/createAttachedSignature.ts","webpack://cryptoPro/../node_modules/webpack/buildin/global.js","webpack://cryptoPro/../node_modules/base64-js/index.js","webpack://cryptoPro/../node_modules/ieee754/index.js","webpack://cryptoPro/../node_modules/isarray/index.js","webpack://cryptoPro/./api/addAttachedSignature.ts","webpack://cryptoPro/./api/createHash.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isSetLogLevel","isPluginLoaded","_afterPluginsLoaded","fn","canPromise","Boolean","Promise","error","console","Error","_extractMeaningfulErrorMessage","cadesplugin","set_log_level","LOG_LEVEL_ERROR","apply","this","args","errorContainer","getLastError","message","test","searchResult","match","__cadesAsyncToken__","__createCadesPluginObject__","_generateCadesFn","callback","cadesGeneratorsAPI","CreateObjectAsync","callbackName","callbackLiteral","String","callbackArguments","callbackBody","replace","crossEnvCallbackLiteral","Function","join","_getCadesCert","thumbprint","eval","cadesStore","cadesCertificateList","certificatesCount","cadesCertificate","Open","CAPICOM_CURRENT_USER_STORE","CAPICOM_MY_STORE","CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED","Certificates","Count","Find","CAPICOM_CERTIFICATE_FIND_SHA1_HASH","Item","Close","_getDateObj","dateObj","getVarDate","base64","ieee754","isArray","kMaxLength","Buffer","TYPED_ARRAY_SUPPORT","createBuffer","that","length","RangeError","Uint8Array","__proto__","arg","encodingOrOffset","allocUnsafe","from","TypeError","ArrayBuffer","array","byteOffset","byteLength","undefined","fromArrayLike","fromArrayBuffer","string","encoding","isEncoding","actual","write","slice","fromString","obj","isBuffer","len","checked","copy","buffer","val","type","data","fromObject","assertSize","size","toString","isView","loweredCase","utf8ToBytes","base64ToBytes","toLowerCase","slowToString","start","end","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","b","bidirectionalIndexOf","dir","isNaN","arrayIndexOf","indexOf","lastIndexOf","arr","indexSize","arrLength","valLength","read","buf","readUInt16BE","foundIndex","found","j","hexWrite","offset","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","str","byteArray","push","charCodeAt","asciiToBytes","latin1Write","base64Write","ucs2Write","units","hi","lo","utf16leToBytes","fromByteArray","Math","min","res","secondByte","thirdByte","fourthByte","tempCodePoint","firstByte","codePoint","bytesPerSequence","codePoints","fromCharCode","decodeCodePointsArray","SlowBuffer","alloc","INSPECT_MAX_BYTES","global","foo","subarray","e","typedArraySupport","poolSize","_augment","species","configurable","fill","allocUnsafeSlow","_isBuffer","compare","a","x","y","concat","list","pos","swap16","swap32","swap64","arguments","equals","inspect","max","target","thisStart","thisEnd","thisCopy","targetCopy","includes","isFinite","toJSON","Array","_arr","ret","out","toHex","bytes","checkOffset","ext","checkInt","objectWriteUInt16","littleEndian","objectWriteUInt32","checkIEEE754","writeFloat","noAssert","writeDouble","newBuf","sliceLen","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","pow","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","floor","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","set","code","INVALID_BASE64_RE","Infinity","leadSurrogate","toByteArray","trim","stringtrim","base64clean","src","dst","certificatesCache","getUserCertificates","resetCache","cadesCertificates","cadesCertificatesCount","CAPICOM_CERTIFICATE_FIND_TIME_VALID","CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY","CAPICOM_PROPID_KEY_PROV_INFO","certificateList","Certificate","_extractCommonName","SubjectName","IssuerName","Thumbprint","ValidFromDate","ValidToDate","getCadesProp","propName","_cadesCertificate","propertyValue","getSystemInfo","sysInfo","cadesVersion","cspVersion","cadesAbout","PluginVersion","CSPVersion","Version","getCertificate","availableCertificates","foundCertificate","find","cert","pluginObject","plugin_resolved","plugin_reject","plugin_resolve","isOpera","isFireFox","isEdge","isSafari","failed_extensions","resolve","reject","browserSpecs","check_browser","ru_cryptopro_npcades_10_native_bridge","callbacksCount","callbacks","resultForCallback","callbackId","resultArray","functionName","hasCallback","iframe","document","createElement","arrObjs","setAttribute","encodeURIComponent","JSON","stringify","alert","documentElement","appendChild","parentNode","removeChild","JSModuleVersion","async_spawn","set_pluginObject","is_capilite_enabled","isNativeMessageSupported","ReleasePluginObjects","CreateObject","cadesplugin_load_timeout","setTimeout","check_load_timeout","set_constantValues","current_log_level","check_plugin_working","tem","ua","navigator","userAgent","M","version","exec","appName","appVersion","splice","cpcsp_console_log","level","msg","LOG_LEVEL_DEBUG","log","LOG_LEVEL_INFO","info","postMessage","CAPICOM_LOCAL_MACHINE_STORE","CADESCOM_LOCAL_MACHINE_STORE","CADESCOM_CURRENT_USER_STORE","CADESCOM_CONTAINER_STORE","CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME","CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED","CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING","CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE","XmlDsigGost3410UrlObsolete","XmlDsigGost3411UrlObsolete","XmlDsigGost3410Url","XmlDsigGost3411Url","CADESCOM_CADES_DEFAULT","CADESCOM_CADES_BES","CADESCOM_CADES_T","CADESCOM_CADES_X_LONG_TYPE_1","CADESCOM_PKCS7_TYPE","CADESCOM_ENCODE_BASE64","CADESCOM_ENCODE_BINARY","CADESCOM_ENCODE_ANY","CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT","CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN","CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY","CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME","CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME","CAPICOM_CERTIFICATE_FIND_ISSUER_NAME","CAPICOM_CERTIFICATE_FIND_ROOT_NAME","CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME","CAPICOM_CERTIFICATE_FIND_EXTENSION","CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY","CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY","CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID","CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED","CAPICOM_CERTIFICATE_FIND_KEY_USAGE","CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE","CAPICOM_PROPID_ENHKEY_USAGE","CAPICOM_OID_OTHER","CAPICOM_OID_KEY_USAGE_EXTENSION","CAPICOM_EKU_CLIENT_AUTH","CAPICOM_EKU_SMARTCARD_LOGON","CAPICOM_EKU_OTHER","CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME","CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME","CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION","CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME","CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME","CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION","CADESCOM_ATTRIBUTE_OTHER","CADESCOM_STRING_TO_UCS2LE","CADESCOM_BASE64_TO_BINARY","CADESCOM_DISPLAY_DATA_NONE","CADESCOM_DISPLAY_DATA_CONTENT","CADESCOM_DISPLAY_DATA_ATTRIBUTE","CADESCOM_ENCRYPTION_ALGORITHM_RC2","CADESCOM_ENCRYPTION_ALGORITHM_RC4","CADESCOM_ENCRYPTION_ALGORITHM_DES","CADESCOM_ENCRYPTION_ALGORITHM_3DES","CADESCOM_ENCRYPTION_ALGORITHM_AES","CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89","CADESCOM_HASH_ALGORITHM_SHA1","CADESCOM_HASH_ALGORITHM_MD2","CADESCOM_HASH_ALGORITHM_MD4","CADESCOM_HASH_ALGORITHM_MD5","CADESCOM_HASH_ALGORITHM_SHA_256","CADESCOM_HASH_ALGORITHM_SHA_384","CADESCOM_HASH_ALGORITHM_SHA_512","CADESCOM_HASH_ALGORITHM_CP_GOST_3411","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC","CADESCOM_AllowNone","CADESCOM_AllowNoOutstandingRequest","CADESCOM_AllowUntrustedCertificate","CADESCOM_AllowUntrustedRoot","CADESCOM_SkipInstallToStore","generatorFunc","continuer","verb","result","generator","err","done","then","onFulfilled","onRejected","isIE","isIOS","call_ru_cryptopro_npcades_10_native_bridge","getElementById","ActiveXObject","decimalToHexString","number","toUpperCase","GetMessageFromException","exception","cpcsp_chrome_nmcades","tmpobj","ex","response","show_firefox_missing_extension_dialog","cadesplugin_skip_extension_install","ovr","id","style","innerHTML","getElementsByTagName","addEventListener","plugin_loaded_error","visibility","install_opera_extension","event","opr","addons","installExtension","location","reload","stopPropagation","firefox_or_edge_nmcades_onload","check_chrome_plugin","plugin_loaded","nmcades_api_onload","url","substring","fileref","onerror","onload","load_extension","load_npapi_plugin","elem","elem1","elem2","createPromise","check_npapi_plugin","display","mimetype","mimeTypes","enabledPlugin","div","readyState","EnableInternalCSP","issuerName","subjectName","validFrom","validTo","getOwnerInfo","getInfo","SUBJECT_TAGS_TRANSLATIONS","getIssuerInfo","ISSUER_TAGS_TRANSLATIONS","getExtendedKeyUsage","getDecodedExtendedKeyUsage","getAlgorithm","isValid","exportBase64","hasExtendedKeyUsage","oids","CAPICOM_ACTIVE_DIRECTORY_USER_STORE","CAPICOM_MEMORY_STORE","CAPICOM_PROPID_ACCESS_STATE","CAPICOM_PROPID_ARCHIVED","CAPICOM_PROPID_ARCHIVED_KEY_HASH","CAPICOM_PROPID_AUTO_ENROLL","CAPICOM_PROPID_CROSS_CERT_DIST_POINTS","CAPICOM_PROPID_CTL_USAGE","CAPICOM_PROPID_DATE_STAMP","CAPICOM_PROPID_DESCRIPTION","CAPICOM_PROPID_EFS","CAPICOM_PROPID_ENROLLMENT","CAPICOM_PROPID_EXTENDED_ERROR_INFO","CAPICOM_PROPID_FIRST_RESERVED","CAPICOM_PROPID_FIRST_USER","CAPICOM_PROPID_FORTEZZA_DATA","CAPICOM_PROPID_FRIENDLY_NAME","CAPICOM_PROPID_HASH_PROP","CAPICOM_PROPID_IE30_RESERVED","CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH","CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH","CAPICOM_PROPID_KEY_CONTEXT","CAPICOM_PROPID_KEY_IDENTIFIER","CAPICOM_PROPID_KEY_PROV_HANDLE","CAPICOM_PROPID_KEY_SPEC","CAPICOM_PROPID_LAST_RESERVED","CAPICOM_PROPID_LAST_USER","CAPICOM_PROPID_MD5_HASH","CAPICOM_PROPID_NEXT_UPDATE_LOCATION","CAPICOM_PROPID_PUBKEY_ALG_PARA","CAPICOM_PROPID_PUBKEY_HASH_RESERVED","CAPICOM_PROPID_PVK_FILE","CAPICOM_PROPID_RENEWAL","CAPICOM_PROPID_SHA1_HASH","CAPICOM_PROPID_SIGNATURE_HASH","CAPICOM_PROPID_SMART_CARD_DATA","CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH","CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH","CAPICOM_PROPID_UNKNOWN","CAPICOM_SMART_CARD_USER_STORE","CAPICOM_STORE_OPEN_EXISTING_ONLY","CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED","CAPICOM_STORE_OPEN_READ_ONLY","CAPICOM_STORE_OPEN_READ_WRITE","CHECK_NONE","CHECK_OFFLINE_REVOCATION_STATUS","CHECK_ONLINE_REVOCATION_STATUS","CHECK_SIGNATURE_VALIDITY","CHECK_TIME_VALIDITY","CHECK_TRUSTED_ROOT","TRUST_CTL_IS_NOT_SIGNATURE_VALID","TRUST_CTL_IS_NOT_TIME_VALID","TRUST_CTL_IS_NOT_VALID_FOR_USAGE","TRUST_IS_CYCLIC","TRUST_IS_NOT_SIGNATURE_VALID","TRUST_IS_NOT_TIME_NESTED","TRUST_IS_NOT_TIME_VALID","TRUST_IS_NOT_VALID_FOR_USAGE","TRUST_IS_PARTIAL_CHAIN","TRUST_IS_REVOKED","TRUST_IS_UNTRUSTED_ROOT","TRUST_REVOCATION_STATUS_UNKNOWN","possibleNames","translation","OIDS_DICTIONARY","Export","cadesPublicKey","algorithmInfo","algorithm","oid","PublicKey","Algorithm","FriendlyName","Value","reduce","decodedOids","oidCode","count","OIDS","ExtendedKeyUsage","EKUs","cadesExtendedKeyUsage","OID","tags","entitiesPath","entities","_parseCertInfo","tagsTranslations","rawInfo","extractedEntities","map","group","segmentsMatch","title","description","oidIdentifierMatch","oidIdentifier","isTranslated","oidTranslation","tagTranslation","tag","certOids","every","oidToCheck","some","certOid","IsValid","Result","isValidSystemSetup","systemInfo","_isSupportedCadesVersion","_isSupportedCSPVersion","major","patch","createSignature","messageHash","detachedSignature","warn","cadesAttrs","cadesSignedData","cadesSigner","cadesAuthAttrs","signature","currentTime","Date","propset_Name","propset_Value","propset_Certificate","AuthenticatedAttributes2","Add","propset_ContentEncoding","propset_Content","propset_Options","SignCades","createXMLSignature","unencryptedMessage","cadesSignedXML","propset_CheckCertificate","propset_SignatureType","propset_SignatureMethod","propset_DigestMethod","Sign","createDetachedSignature","cadesHashedData","propset_Algorithm","SetHashValue","SignHash","addDetachedSignature","signedMessage","VerifyHash","CoSignHash","createAttachedSignature","messageBase64","g","b64","lens","getLens","validLen","placeHoldersLen","tmp","Arr","_byteLength","curByte","revLookup","uint8","extraBytes","parts","len2","encodeChunk","lookup","num","output","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","NaN","rt","abs","LN2","addAttachedSignature","VerifyCades","CoSignCades","createHash","hash","propset_DataEncoding","Hash"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,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Y,yCACpE,MAAOtY,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,iCAAAC,+BAA+BH,IAAU,0CAK3D,IACQ,mBAAAgB,oBAAsBsnB,EAAgBiE,YAAYpC,cAAe/pB,YAAY6X,qBACnFwQ,EAAY,mBAAAznB,oBAAsBsnB,EAAgBkE,YAAYjE,EAAanoB,YAAY6X,qBACvF,MAAOjY,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,iCAAAC,+BAA+BH,IAAU,gCAG3D,OAAOyoB,mB,8jDClFf,iDACA,wDACA,0CAUa,QAAAgE,WAAa,sBAAA9sB,qBACxB,SAAO2pB,oBAAwC,kD,sDAG7C,OAFQlpB,YAAgB/C,OAAM,YAEvB,CAAP,EAAO4E,KACL,mBAAAf,kBAAiB,WACf,IACIqpB,EACAmC,EAFE5C,EAAkB,mBAAA9oB,oBAAsB,mBAAAC,4BAA4B,uBAI1E,IACEspB,EAAgBhnB,OAAOW,KAAKolB,oBAAoBxjB,SAAS,UACzD,MAAO9F,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,gDAGlB,IAEI,mBAAAc,oBACA8oB,EAAgBC,kBAAkB3pB,YAAYgb,+CAE1C,mBAAApa,oBAAsB8oB,EAAgB6C,qBAAqBvsB,YAAY8Z,2BACvE,mBAAAlZ,oBAAsB8oB,EAAgB8C,KAAKrC,GACjD,MAAOvqB,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,iCAAAC,+BAA+BH,IAAU,wCAG3D,IACE0sB,EAAO,mBAAA1rB,oBAAsB8oB,EAAgBtE,MAC7C,MAAOxlB,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,iCAAAC,+BAA+BH,IAAU,4BAG3D,OAAO0sB,kB","file":"crypto-pro.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cryptoPro\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cryptoPro\"] = factory();\n\telse\n\t\troot[\"cryptoPro\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","import { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\n\ntype Unpromisify = T extends Promise ? R : T;\n\nlet isSetLogLevel = false;\nlet isPluginLoaded = false;\n\nexport const _afterPluginsLoaded = any>(\n fn: T,\n): ((...args: Parameters) => Promise>>) => {\n const canPromise = Boolean(window.Promise);\n\n return async function (...args: Parameters): Promise>> {\n if (!isPluginLoaded) {\n try {\n require('../vendor/cadesplugin_api');\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при подключении модуля для работы с Cades plugin',\n );\n }\n\n isPluginLoaded = true;\n }\n\n const { cadesplugin } = window;\n\n if (!canPromise) {\n throw new Error('Необходим полифилл для Promise');\n }\n\n if (!cadesplugin) {\n throw new Error('Не подключен модуль для работы с Cades plugin');\n }\n\n if (!isSetLogLevel) {\n cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR);\n\n isSetLogLevel = true;\n }\n\n try {\n await cadesplugin;\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации модуля для работы с Cades plugin',\n );\n }\n\n return await fn.apply(this, args);\n };\n};\n","export const _extractMeaningfulErrorMessage = (error: Error): string | null => {\n let errorContainer = window.cadesplugin?.getLastError && window.cadesplugin.getLastError(error);\n\n if (!errorContainer?.message) {\n if (!error.message) {\n return null;\n }\n\n errorContainer = error;\n }\n\n const containsRussianLetters = /[а-яА-Я]/.test(errorContainer.message);\n\n if (!containsRussianLetters) {\n return null;\n }\n\n const searchResult = errorContainer.message.match(/^(.*?)(?:(?:\\.?\\s?\\(?0x)|(?:\\.?$))/);\n\n return searchResult ? searchResult[1] : null;\n};\n","// синтетические переменные, которые подменяются в рантайме\nexport const __cadesAsyncToken__ = {};\nexport const __createCadesPluginObject__ = (...args): any => ({});\n\nfunction getGeneratorConstructor(): GeneratorFunction {\n return new Function('', 'return Object.getPrototypeOf(function*(){}).constructor')();\n}\n\nexport const _generateCadesFn = (callback: Function): string => {\n const { cadesplugin } = window;\n const cadesGeneratorsAPI = Boolean(cadesplugin.CreateObjectAsync);\n const callbackName = callback.name || 'dynamicFn';\n const callbackLiteral = String(callback);\n const callbackArguments = callbackLiteral.match(/^function[\\s\\w]*?\\((.*?)\\)/)?.[1] || '';\n const callbackBody = callbackLiteral.replace(/^.*?{([\\s\\S]*?)}$/, '$1');\n let crossEnvCallbackLiteral = String(\n new (cadesGeneratorsAPI ? getGeneratorConstructor() : Function)(callbackArguments, callbackBody),\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__createCadesPluginObject__(\\([\\s\\S]*?\\))/gm,\n `cadesplugin.CreateObject${cadesGeneratorsAPI ? 'Async' : ''}$1`,\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__cadesAsyncToken__\\s*?\\+\\s*?\\b/gm,\n cadesGeneratorsAPI ? 'yield ' : '',\n );\n\n if (!cadesGeneratorsAPI) {\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/propset_(.*?)\\((.*?)\\)/gm, '$1 = $2');\n }\n\n return [\n cadesGeneratorsAPI ? `cadesplugin.async_spawn(${crossEnvCallbackLiteral});` : `(${crossEnvCallbackLiteral})();`,\n `//# sourceURL=crypto-pro_${callbackName}.js`,\n ].join('');\n};\n","export * from './cades-constants';\nexport * from './issuer-tags-translations';\nexport * from './oids-dictionary';\nexport * from './subject-tags-translations';\n","import { CadesCertificate } from '../api/certificate';\nimport { _afterPluginsLoaded } from './_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from './_generateCadesFn';\n\n/**\n * Возвращает сертификат в формате Cades по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат в формате Cades\n */\nexport const _getCadesCert = _afterPluginsLoaded(\n (thumbprint: string): CadesCertificate => {\n const { cadesplugin } = window;\n\n return eval(\n _generateCadesFn(function _getCadesCert() {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n if (!cadesStore) {\n throw new Error('Не удалось получить доступ к хранилищу сертификатов');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificateList;\n let certificatesCount;\n\n try {\n cadesCertificateList = __cadesAsyncToken__ + cadesStore.Certificates;\n certificatesCount = __cadesAsyncToken__ + cadesCertificateList.Count;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!certificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n let cadesCertificate: CadesCertificate;\n\n try {\n cadesCertificateList =\n __cadesAsyncToken__ + cadesCertificateList.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint);\n\n const count = __cadesAsyncToken__ + cadesCertificateList.Count;\n\n if (!count) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n cadesCertificate = __cadesAsyncToken__ + cadesCertificateList.Item(1);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата');\n }\n\n cadesStore.Close();\n\n return cadesCertificate;\n }),\n );\n },\n);\n","/**\n * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера.\n *\n * В IE необходимо использовать специфичный формат \"VT_DATE\"\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate\n */\nexport const _getDateObj = (dateObj): Date => (dateObj.getVarDate ? dateObj.getVarDate() : dateObj);\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","import { CadesCertificate, Certificate } from './certificate';\nimport { CAPICOM_PROPID_KEY_PROV_INFO } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractCommonName } from '../helpers/_extractCommonName';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nlet certificatesCache: Certificate[];\n\n/**\n * Возвращает список сертификатов, доступных пользователю в системе\n *\n * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов\n * @returns список сертификатов\n */\nexport const getUserCertificates = _afterPluginsLoaded((resetCache: boolean = false): Certificate[] => {\n const { cadesplugin } = window;\n\n if (!resetCache && certificatesCache) {\n return certificatesCache;\n }\n\n return eval(\n _generateCadesFn(function getUserCertificates(): Certificate[] {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificates;\n let cadesCertificatesCount;\n\n try {\n cadesCertificates = __cadesAsyncToken__ + cadesStore.Certificates;\n\n if (cadesCertificates) {\n cadesCertificates =\n __cadesAsyncToken__ + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n */\n cadesCertificates =\n __cadesAsyncToken__ +\n cadesCertificates.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n CAPICOM_PROPID_KEY_PROV_INFO,\n );\n\n cadesCertificatesCount = __cadesAsyncToken__ + cadesCertificates.Count;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!cadesCertificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n const certificateList: Certificate[] = [];\n\n try {\n while (cadesCertificatesCount) {\n const cadesCertificate: CadesCertificate =\n __cadesAsyncToken__ + cadesCertificates.Item(cadesCertificatesCount);\n\n certificateList.push(\n new Certificate(\n cadesCertificate,\n _extractCommonName(__cadesAsyncToken__ + cadesCertificate.SubjectName),\n __cadesAsyncToken__ + cadesCertificate.IssuerName,\n __cadesAsyncToken__ + cadesCertificate.SubjectName,\n __cadesAsyncToken__ + cadesCertificate.Thumbprint,\n __cadesAsyncToken__ + cadesCertificate.ValidFromDate,\n __cadesAsyncToken__ + cadesCertificate.ValidToDate,\n ),\n );\n\n cadesCertificatesCount--;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка обработки сертификатов');\n }\n\n cadesStore.Close();\n\n certificatesCache = certificateList;\n\n return certificatesCache;\n }),\n );\n});\n","export * from './certificate';\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает указанное внутренее свойство у сертификата в формате Cades\n *\n * @param propName = наименование свойства\n * @returns значение запрошенного свойства\n */\nexport const getCadesProp = _afterPluginsLoaded(function (propName: string): any {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getCadesProp() {\n let propertyValue;\n\n try {\n propertyValue = __cadesAsyncToken__ + cadesCertificate[propName];\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при обращении к свойству сертификата');\n }\n\n return propertyValue;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nexport interface SystemInfo {\n cadesVersion: string;\n cspVersion: string;\n}\n\n/**\n * Предоставляет информацию о системе\n *\n * @returns информацию о CSP и плагине\n */\nexport const getSystemInfo = _afterPluginsLoaded(\n (): SystemInfo => {\n const sysInfo = {\n cadesVersion: null,\n cspVersion: null,\n };\n\n return eval(\n _generateCadesFn(function getSystemInfo(): SystemInfo {\n let cadesAbout;\n\n try {\n cadesAbout = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.About');\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.PluginVersion;\n sysInfo.cspVersion = __cadesAsyncToken__ + cadesAbout.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.Version;\n }\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = __cadesAsyncToken__ + sysInfo.cspVersion.toString();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении информации о системе');\n }\n\n return sysInfo;\n }),\n );\n },\n);\n","export * from './api';\n","export * from './getCertificate';\nexport * from './getUserCertificates';\nexport * from './getSystemInfo';\nexport * from './isValidSystemSetup';\nexport * from './createSignature';\nexport * from './createXMLSignature';\nexport * from './createDetachedSignature';\nexport * from './addDetachedSignature';\nexport * from './createAttachedSignature';\nexport * from './addAttachedSignature';\nexport * from './createHash';\nexport * from './certificate';\n","import { Certificate } from './certificate';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { getUserCertificates } from './getUserCertificates';\n\n/**\n * Возвращает сертификат по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат\n */\nexport const getCertificate = _afterPluginsLoaded(\n async (thumbprint: string): Promise => {\n if (!thumbprint) {\n throw new Error('Отпечаток не указан');\n }\n\n const availableCertificates: Certificate[] = await getUserCertificates();\n const foundCertificate: Certificate = availableCertificates.find((cert) => cert.thumbprint === thumbprint);\n\n if (!foundCertificate) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n return foundCertificate;\n },\n);\n",";(function () {\n //already loaded\n if(window.cadesplugin)\n return;\n\n var pluginObject;\n var plugin_resolved = 0;\n var plugin_reject;\n var plugin_resolve;\n var isOpera = 0;\n var isFireFox = 0;\n var isEdge = 0;\n var isSafari = 0;\n var failed_extensions = 0;\n\n var canPromise = !!window.Promise;\n var cadesplugin;\n\n if(canPromise)\n {\n cadesplugin = new Promise(function(resolve, reject)\n {\n plugin_resolve = resolve;\n plugin_reject = reject;\n });\n } else\n {\n cadesplugin = {};\n }\n\n function check_browser() {\n var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem= /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1] || '')};\n }\n if(M[1]=== 'Chrome'){\n tem= ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem!= null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]};\n }\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n return {name:M[0],version:M[1]};\n }\n var browserSpecs = check_browser();\n\n function cpcsp_console_log(level, msg){\n //IE9 не может писать в консоль если не открыта вкладка developer tools\n if(typeof(console) === 'undefined')\n return;\n if (level <= cadesplugin.current_log_level ){\n if (level === cadesplugin.LOG_LEVEL_DEBUG)\n console.log(\"DEBUG: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_INFO)\n console.info(\"INFO: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_ERROR)\n console.error(\"ERROR: %s\", msg);\n return;\n }\n }\n\n function set_log_level(level){\n if (!((level === cadesplugin.LOG_LEVEL_DEBUG) ||\n (level === cadesplugin.LOG_LEVEL_INFO) ||\n (level === cadesplugin.LOG_LEVEL_ERROR))){\n cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR, \"cadesplugin_api.js: Incorrect log_level: \" + level);\n return;\n }\n cadesplugin.current_log_level = level;\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = DEBUG\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = INFO\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = ERROR\");\n if(isNativeMessageSupported())\n {\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n window.postMessage(\"set_log_level=debug\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n window.postMessage(\"set_log_level=info\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n window.postMessage(\"set_log_level=error\", \"*\");\n }\n }\n\n function set_constantValues()\n {\n cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CAPICOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CADESCOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_CONTAINER_STORE = 100;\n\n cadesplugin.CAPICOM_MY_STORE = \"My\";\n\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\n\n cadesplugin.XmlDsigGost3410UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr3411\";\n cadesplugin.XmlDsigGost3410Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411\";\n\n cadesplugin.CADESCOM_CADES_DEFAULT = 0;\n cadesplugin.CADESCOM_CADES_BES = 1;\n cadesplugin.CADESCOM_CADES_T = 0x5;\n cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\n cadesplugin.CADESCOM_PKCS7_TYPE = 0xffff;\n\n cadesplugin.CADESCOM_ENCODE_BASE64 = 0;\n cadesplugin.CADESCOM_ENCODE_BINARY = 1;\n cadesplugin.CADESCOM_ENCODE_ANY = -1;\n\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\n\n cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\n cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\n\n cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\n\n cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE = 9;\n\n cadesplugin.CAPICOM_OID_OTHER = 0;\n cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\n\n cadesplugin.CAPICOM_EKU_CLIENT_AUTH = 2;\n cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON = 5;\n cadesplugin.CAPICOM_EKU_OTHER = 0;\n\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_ATTRIBUTE_OTHER = -1;\n\n cadesplugin.CADESCOM_STRING_TO_UCS2LE = 0;\n cadesplugin.CADESCOM_BASE64_TO_BINARY = 1;\n\n cadesplugin.CADESCOM_DISPLAY_DATA_NONE = 0;\n cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT = 1;\n cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\n\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\n\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1 = 0;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD2 = 1;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD4 = 2;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD5 = 3;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\n\n cadesplugin.LOG_LEVEL_DEBUG = 4;\n cadesplugin.LOG_LEVEL_INFO = 2;\n cadesplugin.LOG_LEVEL_ERROR = 1;\n\n cadesplugin.CADESCOM_AllowNone = 0;\n cadesplugin.CADESCOM_AllowNoOutstandingRequest = 0x1;\n cadesplugin.CADESCOM_AllowUntrustedCertificate = 0x2;\n cadesplugin.CADESCOM_AllowUntrustedRoot = 0x4;\n cadesplugin.CADESCOM_SkipInstallToStore = 0x10000000;\n }\n\n function async_spawn(generatorFunc) {\n function continuer(verb, arg) {\n var result;\n try {\n result = generator[verb](arg);\n } catch (err) {\n return Promise.reject(err);\n }\n if (result.done) {\n return result.value;\n } else {\n return Promise.resolve(result.value).then(onFulfilled, onRejected);\n }\n }\n var generator = generatorFunc(Array.prototype.slice.call(arguments, 1));\n var onFulfilled = continuer.bind(continuer, \"next\");\n var onRejected = continuer.bind(continuer, \"throw\");\n return onFulfilled();\n }\n\n function isIE() {\n // var retVal = ((\"Microsoft Internet Explorer\" == navigator.appName) || // IE < 11\n // navigator.userAgent.match(/Trident\\/./i)); // IE 11\n return (browserSpecs.name === 'IE' || browserSpecs.name === 'MSIE');\n }\n\n function isIOS() {\n return (navigator.userAgent.match(/ipod/i) ||\n navigator.userAgent.match(/ipad/i) ||\n navigator.userAgent.match(/iphone/i));\n }\n\n function isNativeMessageSupported()\n {\n // В IE работаем через NPAPI\n if(isIE())\n return false;\n // В Edge работаем через NativeMessage\n if(browserSpecs.name === 'Edge') {\n isEdge = true;\n return true;\n }\n // В Chrome, Firefox, Safari и Opera работаем через асинхронную версию в зависимости от версии\n if(browserSpecs.name === 'Opera') {\n isOpera = true;\n if(browserSpecs.version >= 33){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Firefox') {\n isFireFox = true;\n if(browserSpecs.version >= 52){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Chrome') {\n if(browserSpecs.version >= 42){\n return true;\n }\n else{\n return false;\n }\n }\n //В Сафари начиная с 12 версии нет NPAPI\n if(browserSpecs.name === 'Safari') {\n isSafari = true;\n if(browserSpecs.version >= 12) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n // Функция активации объектов КриптоПро ЭЦП Browser plug-in\n function CreateObject(name) {\n if (isIOS()) {\n // На iOS для создания объектов используется функция\n // call_ru_cryptopro_npcades_10_native_bridge, определенная в IOS_npcades_supp.js\n return call_ru_cryptopro_npcades_10_native_bridge(\"CreateObject\", [name]);\n }\n if (isIE()) {\n // В Internet Explorer создаются COM-объекты\n if (name.match(/X509Enrollment/i)) {\n try {\n // Объекты CertEnroll пробуем создавать через нашу фабрику,\n // если не получилось то через CX509EnrollmentWebClassFactory\n var objCertEnrollClassFactory = document.getElementById(\"webClassFactory\");\n return objCertEnrollClassFactory.CreateObject(name);\n }\n catch (e) {\n try {\n var objWebClassFactory = document.getElementById(\"certEnrollClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (err) {\n throw (\"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS\");\n }\n }\n }\n // Объекты CAPICOM и CAdESCOM создаются через CAdESCOM.WebClassFactory\n try {\n var objWebClassFactory = document.getElementById(\"webClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (e) {\n // Для версий плагина ниже 2.0.12538\n return new ActiveXObject(name);\n }\n }\n // создаются объекты NPAPI\n return pluginObject.CreateObject(name);\n }\n\n function decimalToHexString(number) {\n if (number < 0) {\n number = 0xFFFFFFFF + number + 1;\n }\n\n return number.toString(16).toUpperCase();\n }\n\n function GetMessageFromException(e) {\n var err = e.message;\n if (!err) {\n err = e;\n } else if (e.number) {\n err += \" (0x\" + decimalToHexString(e.number) + \")\";\n }\n return err;\n }\n\n function getLastError(exception) {\n if(isNativeMessageSupported() || isIE() || isIOS() ) {\n return GetMessageFromException(exception);\n }\n\n try {\n return pluginObject.getLastError();\n } catch(e) {\n return GetMessageFromException(exception);\n }\n }\n\n // Функция для удаления созданных объектов\n function ReleasePluginObjects() {\n return cpcsp_chrome_nmcades.ReleasePluginObjects();\n }\n\n // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in\n function CreateObjectAsync(name) {\n return pluginObject.CreateObjectAsync(name);\n }\n\n //Функции для IOS\n var ru_cryptopro_npcades_10_native_bridge = {\n callbacksCount : 1,\n callbacks : {},\n\n // Automatically called by native layer when a result is available\n resultForCallback : function resultForCallback(callbackId, resultArray) {\n var callback = ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId];\n if (!callback) return;\n callback.apply(null,resultArray);\n },\n\n // Use this in javascript to request native objective-c code\n // functionName : string (I think the name is explicit :p)\n // args : array of arguments\n // callback : function with n-arguments that is going to be called when the native code returned\n call : function call(functionName, args, callback) {\n var hasCallback = callback && typeof callback === \"function\";\n var callbackId = hasCallback ? ru_cryptopro_npcades_10_native_bridge.callbacksCount++ : 0;\n\n if (hasCallback)\n ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId] = callback;\n\n var iframe = document.createElement(\"IFRAME\");\n var arrObjs = new Array(\"_CPNP_handle\");\n try{\n iframe.setAttribute(\"src\", \"cpnp-js-call:\" + functionName + \":\" + callbackId+ \":\" + encodeURIComponent(JSON.stringify(args, arrObjs)));\n } catch(e){\n alert(e);\n }\n document.documentElement.appendChild(iframe);\n iframe.parentNode.removeChild(iframe);\n iframe = null;\n }\n };\n\n function call_ru_cryptopro_npcades_10_native_bridge(functionName, array){\n var tmpobj;\n var ex;\n ru_cryptopro_npcades_10_native_bridge.call(functionName, array, function(e, response){\n ex = e;\n var str='tmpobj='+response;\n eval(str);\n if (typeof (tmpobj) === \"string\"){\n tmpobj = tmpobj.replace(/\\\\\\n/gm, \"\\n\");\n tmpobj = tmpobj.replace(/\\\\\\r/gm, \"\\r\");\n }\n });\n if(ex)\n throw ex;\n return tmpobj;\n }\n\n function show_firefox_missing_extension_dialog()\n {\n if (!window.cadesplugin_skip_extension_install)\n {\n var ovr = document.createElement('div');\n ovr.id = \"cadesplugin_ovr\";\n ovr.style = \"visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)\";\n ovr.innerHTML = \"
\" +\n \"\" +\n \"

Для работы КриптоПро ЭЦП Browser plugin на данном сайте необходимо расширение для браузера. Убедитесь, что оно у Вас включено или установите его.\" +\n \"

Скачать расширение

\" +\n \"
\";\n document.getElementsByTagName(\"Body\")[0].appendChild(ovr);\n document.getElementById(\"cadesplugin_close_install\").addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n\n ovr.addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n ovr.style.visibility=\"visible\";\n }\n }\n\n\n //Выводим окно поверх других с предложением установить расширение для Opera.\n //Если установленна переменная cadesplugin_skip_extension_install - не предлагаем установить расширение\n function install_opera_extension()\n {\n if (!window.cadesplugin_skip_extension_install)\n {\n document.addEventListener('DOMContentLoaded', function() {\n var ovr = document.createElement('div');\n ovr.id = \"cadesplugin_ovr\";\n ovr.style = \"visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)\";\n ovr.innerHTML = \"
\" +\n \"\" +\n \"

Для работы КриптоПро ЭЦП Browser plugin на данном сайте необходимо установить расширение из каталога дополнений Opera.\" +\n \"

\" +\n \"
\";\n document.getElementsByTagName(\"Body\")[0].appendChild(ovr);\n var btn_install = document.getElementById(\"cadesplugin_install\");\n btn_install.addEventListener('click', function(event) {\n opr.addons.installExtension(\"epebfcehmdedogndhlcacafjaacknbcm\",\n function()\n {\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n location.reload();\n },\n function(){})\n });\n document.getElementById(\"cadesplugin_close_install\").addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n\n ovr.addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n ovr.style.visibility=\"visible\";\n document.getElementById(\"cadesplugin_ovr_item\").addEventListener('click',function(e){\n e.stopPropagation();\n });\n });\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n\n function firefox_or_edge_nmcades_onload() {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n\n function nmcades_api_onload () {\n window.postMessage(\"cadesplugin_echo_request\", \"*\");\n window.addEventListener(\"message\", function (event){\n if (typeof(event.data) !== \"string\" || !event.data.match(\"cadesplugin_loaded\"))\n return;\n if(isFireFox || isEdge || isSafari)\n {\n // Для Firefox, Сафари, Edge вместе с сообщением cadesplugin_loaded прилетает url для загрузки nmcades_plugin_api.js\n var url = event.data.substring(event.data.indexOf(\"url:\") + 4);\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", url);\n fileref.onerror = plugin_loaded_error;\n fileref.onload = firefox_or_edge_nmcades_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n // Для Firefox, Safari и Edge у нас только по одному расширению.\n failed_extensions++;\n }else {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n }, false);\n }\n\n //Загружаем расширения для Chrome, Opera, YaBrowser, FireFox, Edge, Safari\n function load_extension()\n {\n\n if(isFireFox || isEdge || isSafari){\n // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера.\n nmcades_api_onload();\n } else {\n // в асинхронном варианте для chrome и opera подключаем оба расширения\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n }\n }\n\n //Загружаем плагин для NPAPI\n function load_npapi_plugin()\n {\n var elem = document.createElement('object');\n elem.setAttribute(\"id\", \"cadesplugin_object\");\n elem.setAttribute(\"type\", \"application/x-cades\");\n elem.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem);\n pluginObject = document.getElementById(\"cadesplugin_object\");\n if(isIE())\n {\n var elem1 = document.createElement('object');\n elem1.setAttribute(\"id\", \"certEnrollClassFactory\");\n elem1.setAttribute(\"classid\", \"clsid:884e2049-217d-11da-b2a4-000e7bbb2b09\");\n elem1.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem1);\n var elem2 = document.createElement('object');\n elem2.setAttribute(\"id\", \"webClassFactory\");\n elem2.setAttribute(\"classid\", \"clsid:B04C8637-10BD-484E-B0DA-B8A039F60024\");\n elem2.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem2);\n }\n }\n\n //Отправляем событие что все ок.\n function plugin_loaded()\n {\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_resolve();\n }else {\n window.postMessage(\"cadesplugin_loaded\", \"*\");\n }\n }\n\n //Отправляем событие что сломались.\n function plugin_loaded_error(msg)\n {\n if(isNativeMessageSupported())\n {\n //в асинхронном варианте подключаем оба расширения, если сломались оба пробуем установить для Opera\n failed_extensions++;\n if(failed_extensions<2)\n return;\n if(isOpera && (typeof(msg) === 'undefined'|| typeof(msg) === 'object'))\n {\n install_opera_extension();\n return;\n }\n }\n if(typeof(msg) === 'undefined' || typeof(msg) === 'object')\n msg = \"Плагин недоступен\";\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(msg);\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n }\n\n //проверяем что у нас хоть какое то событие ушло, и если не уходило кидаем еще раз ошибку\n function check_load_timeout()\n {\n if(plugin_resolved === 1)\n return;\n if(isFireFox)\n {\n show_firefox_missing_extension_dialog();\n }\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(\"Истекло время ожидания загрузки плагина\");\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n\n }\n\n //Вспомогательная функция для NPAPI\n function createPromise(arg)\n {\n return new Promise(arg);\n }\n\n function check_npapi_plugin (){\n try {\n var oAbout = CreateObject(\"CAdESCOM.About\");\n plugin_loaded();\n }\n catch (err) {\n document.getElementById(\"cadesplugin_object\").style.display = 'none';\n // Объект создать не удалось, проверим, установлен ли\n // вообще плагин. Такая возможность есть не во всех браузерах\n var mimetype = navigator.mimeTypes[\"application/x-cades\"];\n if (mimetype) {\n var plugin = mimetype.enabledPlugin;\n if (plugin) {\n plugin_loaded_error(\"Плагин загружен, но не создаются обьекты\");\n }else\n {\n plugin_loaded_error(\"Ошибка при загрузке плагина\");\n }\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n }\n\n //Проверяем работает ли плагин\n function check_plugin_working()\n {\n var div = document.createElement(\"div\");\n div.innerHTML = \"\";\n var isIeLessThan9 = (div.getElementsByTagName(\"i\").length === 1);\n if (isIeLessThan9) {\n plugin_loaded_error(\"Internet Explorer версии 8 и ниже не поддерживается\");\n return;\n }\n\n if(isNativeMessageSupported())\n {\n load_extension();\n }else if(!canPromise) {\n window.addEventListener(\"message\", function (event){\n if (event.data !== \"cadesplugin_echo_request\")\n return;\n load_npapi_plugin();\n check_npapi_plugin();\n },\n false);\n }else\n {\n if(document.readyState === \"complete\"){\n load_npapi_plugin();\n check_npapi_plugin();\n } else {\n window.addEventListener(\"load\", function (event) {\n load_npapi_plugin();\n check_npapi_plugin();\n }, false);\n }\n }\n }\n\n function set_pluginObject(obj)\n {\n pluginObject = obj;\n }\n\n function is_capilite_enabled()\n {\n if ((typeof (cadesplugin.EnableInternalCSP) !== 'undefined') && cadesplugin.EnableInternalCSP)\n return true;\n return false;\n };\n\n //Export\n cadesplugin.JSModuleVersion = \"2.1.2\";\n cadesplugin.async_spawn = async_spawn;\n cadesplugin.set = set_pluginObject;\n cadesplugin.set_log_level = set_log_level;\n cadesplugin.getLastError = getLastError;\n cadesplugin.is_capilite_enabled = is_capilite_enabled;\n\n if(isNativeMessageSupported())\n {\n cadesplugin.CreateObjectAsync = CreateObjectAsync;\n cadesplugin.ReleasePluginObjects = ReleasePluginObjects;\n }\n\n if(!isNativeMessageSupported())\n {\n cadesplugin.CreateObject = CreateObject;\n }\n\n if(window.cadesplugin_load_timeout)\n {\n setTimeout(check_load_timeout, window.cadesplugin_load_timeout);\n }\n else\n {\n setTimeout(check_load_timeout, 20000);\n }\n\n set_constantValues();\n\n cadesplugin.current_log_level = cadesplugin.LOG_LEVEL_ERROR;\n window.cadesplugin = cadesplugin;\n check_plugin_working();\n}());\n","import { ISSUER_TAGS_TRANSLATIONS, SUBJECT_TAGS_TRANSLATIONS } from '../../constants';\nimport { TagTranslation } from '../../helpers/_parseCertInfo';\nimport { exportBase64 } from './exportBase64';\nimport { getAlgorithm } from './getAlgorithm';\nimport { getCadesProp } from './getCadesProp';\nimport { getDecodedExtendedKeyUsage, ExtendedKeysTranslations } from './getDecodedExtendedKeyUsage';\nimport { getExtendedKeyUsage } from './getExtendedKeyUsage';\nimport { getInfo } from './getInfo';\nimport { hasExtendedKeyUsage } from './hasExtendedKeyUsage';\nimport { isValid } from './isValid';\n\nexport type CadesCertificate = any;\n\nexport class Certificate {\n constructor(\n public _cadesCertificate: CadesCertificate,\n public name: string,\n public issuerName: string,\n public subjectName: string,\n public thumbprint: string,\n public validFrom: string,\n public validTo: string,\n ) {}\n\n public getOwnerInfo(): Promise {\n return getInfo.call(this, SUBJECT_TAGS_TRANSLATIONS, 'SubjectName');\n }\n\n public getIssuerInfo(): Promise {\n return getInfo.call(this, ISSUER_TAGS_TRANSLATIONS, 'IssuerName');\n }\n\n public getExtendedKeyUsage(): Promise {\n return getExtendedKeyUsage.call(this);\n }\n\n public getDecodedExtendedKeyUsage(): Promise {\n return getDecodedExtendedKeyUsage.call(this);\n }\n\n public getAlgorithm(): Promise {\n return getAlgorithm.call(this);\n }\n\n public getCadesProp(propName): Promise {\n return getCadesProp.call(this, propName);\n }\n\n public isValid(): Promise {\n return isValid.call(this);\n }\n\n public exportBase64(): Promise {\n return exportBase64.call(this);\n }\n\n public hasExtendedKeyUsage(oids): Promise {\n return hasExtendedKeyUsage.call(this, oids);\n }\n}\n","export const CADESCOM_ATTRIBUTE_OTHER = -1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CADESCOM_AllowNoOutstandingRequest = 1;\nexport const CADESCOM_AllowNone = 0;\nexport const CADESCOM_AllowUntrustedCertificate = 2;\nexport const CADESCOM_AllowUntrustedRoot = 4;\nexport const CADESCOM_BASE64_TO_BINARY = 0x01;\nexport const CADESCOM_CADES_BES = 1;\nexport const CADESCOM_CADES_DEFAULT = 0;\nexport const CADESCOM_CADES_T = 5;\nexport const CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\nexport const CADESCOM_CONTAINER_STORE = 100;\nexport const CADESCOM_CURRENT_USER_STORE = 2;\nexport const CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\nexport const CADESCOM_DISPLAY_DATA_CONTENT = 1;\nexport const CADESCOM_DISPLAY_DATA_NONE = 0;\nexport const CADESCOM_ENCODE_ANY = -1;\nexport const CADESCOM_ENCODE_BASE64 = 0;\nexport const CADESCOM_ENCODE_BINARY = 1;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\nexport const CADESCOM_HASH_ALGORITHM_MD2 = 1;\nexport const CADESCOM_HASH_ALGORITHM_MD4 = 2;\nexport const CADESCOM_HASH_ALGORITHM_MD5 = 3;\nexport const CADESCOM_HASH_ALGORITHM_SHA1 = 0;\nexport const CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\nexport const CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\nexport const CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\nexport const CADESCOM_LOCAL_MACHINE_STORE = 1;\nexport const CADESCOM_PKCS7_TYPE = 65535;\nexport const CADESCOM_STRING_TO_UCS2LE = 0x00;\nexport const CADESCOM_SkipInstallToStore = 268435456;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\nexport const CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\nexport const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\nexport const CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\nexport const CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\nexport const CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\nexport const CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\nexport const CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\nexport const CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\nexport const CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\nexport const CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\nexport const CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\nexport const CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\nexport const CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\nexport const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\nexport const CAPICOM_CURRENT_USER_STORE = 2;\nexport const CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\nexport const CAPICOM_EKU_CLIENT_AUTH = 2;\nexport const CAPICOM_EKU_OTHER = 0;\nexport const CAPICOM_EKU_SMARTCARD_LOGON = 5;\nexport const CAPICOM_LOCAL_MACHINE_STORE = 1;\nexport const CAPICOM_MEMORY_STORE = 0;\nexport const CAPICOM_MY_STORE = 'My';\nexport const CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\nexport const CAPICOM_OID_OTHER = 0;\nexport const CAPICOM_PROPID_ACCESS_STATE = 14;\nexport const CAPICOM_PROPID_ARCHIVED = 19;\nexport const CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65;\nexport const CAPICOM_PROPID_AUTO_ENROLL = 21;\nexport const CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23;\nexport const CAPICOM_PROPID_CTL_USAGE = 9;\nexport const CAPICOM_PROPID_DATE_STAMP = 27;\nexport const CAPICOM_PROPID_DESCRIPTION = 13;\nexport const CAPICOM_PROPID_EFS = 17;\nexport const CAPICOM_PROPID_ENHKEY_USAGE = 9;\nexport const CAPICOM_PROPID_ENROLLMENT = 26;\nexport const CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30;\nexport const CAPICOM_PROPID_FIRST_RESERVED = 66;\nexport const CAPICOM_PROPID_FIRST_USER = 0x00008000;\nexport const CAPICOM_PROPID_FORTEZZA_DATA = 18;\nexport const CAPICOM_PROPID_FRIENDLY_NAME = 11;\nexport const CAPICOM_PROPID_HASH_PROP = 3;\nexport const CAPICOM_PROPID_IE30_RESERVED = 7;\nexport const CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24;\nexport const CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28;\nexport const CAPICOM_PROPID_KEY_CONTEXT = 5;\nexport const CAPICOM_PROPID_KEY_IDENTIFIER = 20;\nexport const CAPICOM_PROPID_KEY_PROV_HANDLE = 1;\nexport const CAPICOM_PROPID_KEY_PROV_INFO = 2;\nexport const CAPICOM_PROPID_KEY_SPEC = 6;\nexport const CAPICOM_PROPID_LAST_RESERVED = 0x00007fff;\nexport const CAPICOM_PROPID_LAST_USER = 0x0000ffff;\nexport const CAPICOM_PROPID_MD5_HASH = 4;\nexport const CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10;\nexport const CAPICOM_PROPID_PUBKEY_ALG_PARA = 22;\nexport const CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8;\nexport const CAPICOM_PROPID_PVK_FILE = 12;\nexport const CAPICOM_PROPID_RENEWAL = 64;\nexport const CAPICOM_PROPID_SHA1_HASH = 3;\nexport const CAPICOM_PROPID_SIGNATURE_HASH = 15;\nexport const CAPICOM_PROPID_SMART_CARD_DATA = 16;\nexport const CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29;\nexport const CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25;\nexport const CAPICOM_PROPID_UNKNOWN = 0;\nexport const CAPICOM_SMART_CARD_USER_STORE = 4;\nexport const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128;\nexport const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256;\nexport const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\nexport const CAPICOM_STORE_OPEN_READ_ONLY = 0;\nexport const CAPICOM_STORE_OPEN_READ_WRITE = 1;\nexport const CHECK_NONE = 0;\nexport const CHECK_OFFLINE_REVOCATION_STATUS = 16;\nexport const CHECK_ONLINE_REVOCATION_STATUS = 8;\nexport const CHECK_SIGNATURE_VALIDITY = 4;\nexport const CHECK_TIME_VALIDITY = 2;\nexport const CHECK_TRUSTED_ROOT = 1;\nexport const LOG_LEVEL_DEBUG = 4;\nexport const LOG_LEVEL_ERROR = 1;\nexport const LOG_LEVEL_INFO = 2;\nexport const TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144;\nexport const TRUST_CTL_IS_NOT_TIME_VALID = 131072;\nexport const TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288;\nexport const TRUST_IS_CYCLIC = 128;\nexport const TRUST_IS_NOT_SIGNATURE_VALID = 8;\nexport const TRUST_IS_NOT_TIME_NESTED = 2;\nexport const TRUST_IS_NOT_TIME_VALID = 1;\nexport const TRUST_IS_NOT_VALID_FOR_USAGE = 16;\nexport const TRUST_IS_PARTIAL_CHAIN = 65536;\nexport const TRUST_IS_REVOKED = 4;\nexport const TRUST_IS_UNTRUSTED_ROOT = 32;\nexport const TRUST_REVOCATION_STATUS_UNKNOWN = 64;\nexport const XmlDsigGost3410Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411';\nexport const XmlDsigGost3410UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411';\nexport const XmlDsigGost3411Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411';\nexport const XmlDsigGost3411UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr3411';\n","import { TagsTranslations } from './tags-translations';\n\nexport const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Удостоверяющий центр' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Тип' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN', 'ИНН организации'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","export const OIDS_DICTIONARY = {\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\n '1.2.643.3.8.100.1': 'Сертификат типа \"ekey-ГОСТ\"',\n '1.2.643.3.8.100.1.1': 'Общее использование в системах ИОК без права заверения финансовых документов',\n '1.2.643.3.8.100.1.10':\n 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11':\n 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13':\n 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.3.8.100.1.2': 'Передача отчетности по ТКС',\n '1.2.643.3.8.100.1.3': 'Оформление взаимных обязательств, соглашений, договоров, актов и т.п.',\n '1.2.643.3.8.100.1.4': 'Внутрикорпоративный документооборот',\n '1.2.643.3.8.100.1.5': 'Использование в системах электронной торговли',\n '1.2.643.3.8.100.1.6': 'Использование в торгово-закупочной системе \"ЭЛЕКТРА\"',\n '1.2.643.3.8.100.1.7': 'Использование в системе Портал государственных закупок Ставропольского края.',\n '1.2.643.3.8.100.1.8': 'Использование в Единой системе электронной торговли B2B-Center и B2G.',\n '1.2.643.3.8.100.1.9':\n 'Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа',\n '1.2.643.5.1.24.2.1.3':\n 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1':\n 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3':\n 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\n '1.2.643.6.2.1.7.1':\n 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.2.643.6.2.1.7.2':\n 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.3':\n 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.6.3.1.1': 'Использование на электронных площадок отобранных для проведения аукционах в электронной форме',\n '1.2.643.6.3.1.2.1': 'Тип участника - Юридическое лицо',\n '1.2.643.6.3.1.2.2': 'Тип участника - Физическое лицо',\n '1.2.643.6.3.1.2.3': 'Тип участника - Индивидуальный предприниматель',\n '1.2.643.6.3.1.3.1': 'Участник размещения заказа',\n '1.2.643.6.3.1.4.1': 'Администратор организации',\n '1.2.643.6.3.1.4.2': 'Уполномоченный специалист',\n '1.2.643.6.3.1.4.3': 'Специалист с правом подписи контракта',\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\n '1.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"',\n};\n","import { TagsTranslations } from './tags-translations';\n\nexport const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Владелец' },\n { possibleNames: ['SN'], translation: 'Фамилия' },\n { possibleNames: ['G'], translation: 'Имя Отчество' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Отдел/подразделение' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN', 'ИНН организации'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Экспортирует сертификат в формате base64\n *\n * @returns сертификат в формате base64\n */\nexport const exportBase64 = _afterPluginsLoaded(function (): string {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function exportBase64(): string {\n let base64: string;\n\n try {\n base64 = __cadesAsyncToken__ + cadesCertificate.Export(0);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при экспорте сертификата');\n }\n\n return base64;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\ninterface AlgorithmInfo {\n algorithm: string;\n oid: string;\n}\n\n/**\n * Возвращает информацию об алгоритме сертификата\n *\n * @returns информацию об алгоритме и его OID'е\n */\nexport const getAlgorithm = _afterPluginsLoaded(function (): AlgorithmInfo {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getAlgorithm(): AlgorithmInfo {\n const algorithmInfo: AlgorithmInfo = {\n algorithm: null,\n oid: null,\n };\n let cadesPublicKey;\n\n try {\n cadesPublicKey = __cadesAsyncToken__ + cadesCertificate.PublicKey();\n cadesPublicKey = __cadesAsyncToken__ + cadesPublicKey.Algorithm;\n algorithmInfo.algorithm = __cadesAsyncToken__ + cadesPublicKey.FriendlyName;\n algorithmInfo.oid = __cadesAsyncToken__ + cadesPublicKey.Value;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении алгоритма');\n }\n\n return algorithmInfo;\n }),\n );\n});\n","import { OIDS_DICTIONARY } from '../../constants';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\nexport interface ExtendedKeysTranslations {\n [key: string]: string | null;\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы сертификата\n *\n * @returns словарь расшифрованных ОИД'ов\n */\nexport const getDecodedExtendedKeyUsage = _afterPluginsLoaded(async function (): Promise {\n const certificateOids = await (this as Certificate).getExtendedKeyUsage();\n\n return certificateOids.reduce(\n (decodedOids, oidCode) => ({\n ...decodedOids,\n [oidCode]: OIDS_DICTIONARY[oidCode] || null,\n }),\n {},\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает ОИД'ы сертификата\n *\n * @returns список ОИД'ов\n */\nexport const getExtendedKeyUsage = _afterPluginsLoaded(function (): string[] {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getExtendedKeyUsage(): string[] {\n const OIDS: string[] = [];\n let count: any;\n\n try {\n count = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n count = __cadesAsyncToken__ + count.EKUs;\n count = __cadesAsyncToken__ + count.Count;\n\n if (count > 0) {\n while (count > 0) {\n let cadesExtendedKeyUsage;\n\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.EKUs;\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.Item(count);\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.OID;\n\n OIDS.push(cadesExtendedKeyUsage);\n\n count--;\n }\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || \"Ошибка при получении ОИД'ов\");\n }\n\n return OIDS;\n }),\n );\n});\n","import { TagsTranslations } from '../../constants/tags-translations';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { _parseCertInfo, TagTranslation } from '../../helpers/_parseCertInfo';\nimport { getCadesProp } from './getCadesProp';\n\n/**\n * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам\n *\n * @param tags = словарь\n * @param entitiesPath = путь к разбираемой сущности\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const getInfo = _afterPluginsLoaded(async function (\n tags: TagsTranslations[],\n entitiesPath: string,\n): Promise {\n let entities: string;\n\n try {\n entities = await getCadesProp.call(this, entitiesPath);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при извлечении информации из сертификата');\n }\n\n return _parseCertInfo(tags, entities);\n});\n","import { OIDS_DICTIONARY } from '../constants';\nimport { TagsTranslations } from '../constants/tags-translations';\n\nexport interface TagTranslation {\n description: string;\n title: string;\n isTranslated: boolean;\n}\n\n/**\n * Парсит информацию из строки с информацией о сертификате\n *\n * @param tagsTranslations - словарь с расшифровками тэгов\n * @param rawInfo - данные для парсинга\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const _parseCertInfo = (tagsTranslations: TagsTranslations[], rawInfo: string): TagTranslation[] => {\n const extractedEntities: string[] = rawInfo.match(/([а-яА-Яa-zA-Z0-9\\s.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (extractedEntities) {\n return extractedEntities.map((group) => {\n const segmentsMatch = group.trim().match(/^([а-яА-Яa-zA-Z0-9\\s.]+)=(.+?),?$/);\n let title = segmentsMatch?.[1];\n // Вырезаем лишние кавычки\n const description = segmentsMatch?.[2]?.replace(/^\"(.*)\"/, '$1')?.replace(/\"{2}/g, '\"');\n const oidIdentifierMatch = title?.match(/^OID\\.(.*)/);\n const oidIdentifier = oidIdentifierMatch?.[1];\n let isTranslated = false;\n\n // Если нашли в тайтле ОИД, пытаемся его расшифровать\n if (oidIdentifier) {\n const oidTranslation = OIDS_DICTIONARY[oidIdentifier];\n\n if (oidTranslation) {\n title = oidTranslation;\n isTranslated = true;\n }\n }\n\n const tagTranslation = tagsTranslations.find((tag) => tag.possibleNames.find((name) => name === title))\n ?.translation;\n\n if (tagTranslation) {\n title = tagTranslation;\n isTranslated = true;\n }\n\n return { description, title, isTranslated };\n });\n }\n};\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет наличие ОИД'а (ОИД'ов) у сертификата\n *\n * @param oids - ОИД'ы для проверки\n * @returns флаг наличия ОИД'ов у сертификата\n */\nexport const hasExtendedKeyUsage = _afterPluginsLoaded(async function (oids: string | string[]): Promise {\n const certOids = await (this as Certificate).getExtendedKeyUsage();\n\n let result: boolean;\n\n if (Array.isArray(oids)) {\n result = oids.every((oidToCheck) => certOids.some((certOid) => certOid === oidToCheck));\n } else {\n result = certOids.some((certOid) => certOid === oids);\n }\n\n return result;\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет действительность сертификата\n *\n * @returns флаг валидности\n */\nexport const isValid = _afterPluginsLoaded(function (): boolean {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function isValid() {\n let isValid;\n\n try {\n isValid = __cadesAsyncToken__ + cadesCertificate.IsValid();\n isValid = __cadesAsyncToken__ + isValid.Result;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при проверке сертификата');\n }\n\n return Boolean(isValid);\n }),\n );\n});\n","export const _extractCommonName = (subjectName: string): string | undefined =>\n subjectName.match(/CN=(.+?)(?:,|$)/)?.[1];\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { _isSupportedCadesVersion } from '../helpers/_isSupportedCadesVersion';\nimport { _isSupportedCSPVersion } from '../helpers/_isSupportedCSPVersion';\nimport { getSystemInfo, SystemInfo } from './getSystemInfo';\n\n/**\n * Проверяет корректность настроек ЭП на машине\n *\n * @returns флаг корректности настроек\n */\nexport const isValidSystemSetup = _afterPluginsLoaded(\n async (): Promise => {\n let systemInfo: SystemInfo;\n\n try {\n systemInfo = await getSystemInfo();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Настройки ЭП на данной машине не верны');\n }\n\n if (!_isSupportedCadesVersion(systemInfo.cadesVersion)) {\n throw new Error('Не поддерживаемая версия плагина');\n }\n\n if (!_isSupportedCSPVersion(systemInfo.cspVersion)) {\n throw new Error('Не поддерживаемая версия CSP');\n }\n\n return true;\n },\n);\n","export const _isSupportedCadesVersion = (version: string): boolean => {\n const match = version.match(/(\\d+)\\.(\\d+)\\.(\\d+)/);\n\n if (!match) {\n return false;\n }\n\n const [, major, minor, patch] = match;\n\n if (Number(major) < 2) {\n return false;\n }\n\n if (Number(major) === 2 && Number(patch) < 12438) {\n return false;\n }\n\n return true;\n};\n","const oldestSupportedCSPVersion = 4.0;\n\nexport const _isSupportedCSPVersion = (version: string): boolean => {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/)?.[0];\n\n return Number(version) >= oldestSupportedCSPVersion;\n};\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Создает подпись base64 строки по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param messageHash - хеш подписываемого сообщения, сгенерированный по ГОСТ Р 34.11\n * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false)\n * @returns подпись\n */\nexport const createSignature = _afterPluginsLoaded(\n async (thumbprint: string, messageHash: string, detachedSignature: boolean = true): Promise => {\n console.warn(\n [\n 'cryptoPro: Метод \"createSignature\" является устаревшим и будет убран из будущих версий.',\n 'Используйте \"createAttachedSignature\" и \"createDetachedSignature\".',\n ].join('\\n'),\n );\n\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function createSignature(): string {\n let cadesAttrs;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesSignedData.propset_Content(messageHash));\n void (\n __cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n signature =\n __cadesAsyncToken__ +\n cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_CADES_BES, detachedSignature);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\n\n/**\n * Создает XML подпись для документа в формате XML\n *\n * @param thumbprint - отпечаток сертификата\n * @param unencryptedMessage - подписываемое сообщение в формате XML\n * @returns подпись\n */\nexport const createXMLSignature = _afterPluginsLoaded(\n async (thumbprint: string, unencryptedMessage: string): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function createXMLSignature(): string {\n let cadesSigner;\n let cadesSignedXML;\n\n try {\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n cadesSignedXML = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.SignedXML');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n try {\n const signatureMethod = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102012-gostr34112012-256';\n const digestMethod = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34112012-256';\n\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n void (__cadesAsyncToken__ + cadesSigner.propset_CheckCertificate(true));\n void (__cadesAsyncToken__ + cadesSignedXML.propset_Content(unencryptedMessage));\n void (\n __cadesAsyncToken__ +\n cadesSignedXML.propset_SignatureType(cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED)\n );\n void (__cadesAsyncToken__ + cadesSignedXML.propset_SignatureMethod(signatureMethod));\n void (__cadesAsyncToken__ + cadesSignedXML.propset_DigestMethod(digestMethod));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n signature = __cadesAsyncToken__ + cadesSignedXML.Sign(cadesSigner);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Создает отсоединенную подпись хеша по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param messageHash - хеш подписываемого сообщения, сгенерированный по ГОСТ Р 34.11-2012 256 бит\n * @returns подпись в формате PKCS#7\n */\nexport const createDetachedSignature = _afterPluginsLoaded(\n async (thumbprint: string, messageHash: string): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function createDetachedSignature(): string {\n let cadesAttrs;\n let cadesHashedData;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesHashedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.HashedData');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке сертификата');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesHashedData.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256)\n );\n void (__cadesAsyncToken__ + cadesHashedData.SetHashValue(messageHash));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке хеша');\n }\n\n let signature: string;\n\n try {\n signature =\n __cadesAsyncToken__ +\n cadesSignedData.SignHash(cadesHashedData, cadesSigner, cadesplugin.CADESCOM_PKCS7_TYPE);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Добавляет отсоединенную подпись хеша к подписанному сообщению по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param signedMessage - подписанное сообщение\n * @param messageHash - хеш подписываемого сообщения, сгенерированный по ГОСТ Р 34.11-2012 256 бит\n * @returns подпись в формате PKCS#7\n */\nexport const addDetachedSignature = _afterPluginsLoaded(\n async (thumbprint: string, signedMessage: string | ArrayBuffer, messageHash: string): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function addDetachedSignature(): string {\n let cadesAttrs;\n let cadesHashedData;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesHashedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.HashedData');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке сертификата');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesHashedData.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256)\n );\n void (__cadesAsyncToken__ + cadesHashedData.SetHashValue(messageHash));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке хеша');\n }\n\n let signature: string;\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesSignedData.VerifyHash(cadesHashedData, signedMessage, cadesplugin.CADESCOM_PKCS7_TYPE)\n );\n signature =\n __cadesAsyncToken__ +\n cadesSignedData.CoSignHash(cadesHashedData, cadesSigner, cadesplugin.CADESCOM_PKCS7_TYPE);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Создает присоединенную подпись сообщения по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param message - подписываемое сообщение\n * @returns подпись в формате PKCS#7\n */\nexport const createAttachedSignature = _afterPluginsLoaded(\n async (thumbprint: string, unencryptedMessage: string | ArrayBuffer): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function createAttachedSignature(): string {\n let cadesAttrs;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let messageBase64;\n\n try {\n messageBase64 = Buffer.from(unencryptedMessage).toString('base64');\n } catch (error) {\n console.error(error);\n\n throw new Error('Ошибка при преобразовании сообщения в Base64');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesSignedData.propset_Content(messageBase64));\n void (__cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n signature = __cadesAsyncToken__ + cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_PKCS7_TYPE);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Добавляет присоединенную подпись к подписанному сообщению по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param signedMessage - подписанное сообщение\n * @returns подпись в формате PKCS#7\n */\nexport const addAttachedSignature = _afterPluginsLoaded(\n async (thumbprint: string, signedMessage: string | ArrayBuffer): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function addAttachedSignature(): string {\n let cadesAttrs;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let messageBase64;\n\n try {\n messageBase64 = Buffer.from(signedMessage).toString('base64');\n } catch (error) {\n console.error(error);\n\n throw new Error('Ошибка при преобразовании сообщения в Base64');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesSignedData.propset_Content(messageBase64));\n void (__cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n void (__cadesAsyncToken__ + cadesSignedData.VerifyCades(signedMessage, cadesplugin.CADESCOM_PKCS7_TYPE));\n signature = __cadesAsyncToken__ + cadesSignedData.CoSignCades(cadesSigner, cadesplugin.CADESCOM_PKCS7_TYPE);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\n/**\n * Создает хеш сообщения по ГОСТ Р 34.11-2012 256 бит\n * https://ru.wikipedia.org/wiki/%D0%A1%D1%82%D1%80%D0%B8%D0%B1%D0%BE%D0%B3_(%D1%85%D0%B5%D1%88-%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F)\n *\n * @param unencryptedMessage - сообщение для хеширования\n *\n * @returns хеш\n */\nexport const createHash = _afterPluginsLoaded(\n async (unencryptedMessage: string | ArrayBuffer): Promise => {\n const { cadesplugin } = window;\n\n return eval(\n _generateCadesFn(function createHash(): string {\n const cadesHashedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.HashedData');\n let messageBase64;\n let hash;\n\n try {\n messageBase64 = Buffer.from(unencryptedMessage).toString('base64');\n } catch (error) {\n console.error(error);\n\n throw new Error('Ошибка при преобразовании сообщения в Base64');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesHashedData.propset_Algorithm(cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256)\n );\n void (__cadesAsyncToken__ + cadesHashedData.propset_DataEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesHashedData.Hash(messageBase64));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации хэширования');\n }\n\n try {\n hash = __cadesAsyncToken__ + cadesHashedData.Value;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при создании хэша');\n }\n\n return hash;\n }),\n );\n },\n);\n"],"sourceRoot":""}