From bdb36572f1b94dd9e6b594d14b10478ed3e83c23 Mon Sep 17 00:00:00 2001 From: vgoma Date: Wed, 29 Nov 2017 00:14:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BE=D0=B1=D1=8A=D0=B5=D0=B4=D0=B8=D0=BD=D0=B8=D1=82=D1=8C=20?= =?UTF-8?q?=D0=B0=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD=D0=BD=D1=83?= =?UTF-8?q?=D1=8E=20=D0=B8=20=D1=81=D0=B8=D0=BD=D1=85=D1=80=D0=BE=D0=BD?= =?UTF-8?q?=D0=BD=D1=83=D1=8E=20=D0=BA=D0=BE=D0=B4=D0=BE=D0=B2=D1=83=D1=8E?= =?UTF-8?q?=20=D0=B1=D0=B0=D0=B7=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/1.crypto-pro.js | 28 +- dist/1.crypto-pro.js.map | 2 +- dist/2.crypto-pro.js | 24 + dist/2.crypto-pro.js.map | 2 +- dist/crypto-pro.js | 2 +- dist/crypto-pro.js.map | 2 +- example/cert-list.js | 2 + npm-shrinkwrap.json | 1570 +++++++++++++++++++++++++++++++++----- src/apiAsync.js | 4 +- src/common.js | 24 + 10 files changed, 1466 insertions(+), 194 deletions(-) diff --git a/dist/1.crypto-pro.js b/dist/1.crypto-pro.js index 9bbe31f..0590af6 100644 --- a/dist/1.crypto-pro.js +++ b/dist/1.crypto-pro.js @@ -177,11 +177,11 @@ webpackJsonpCryptoPro([1],[ * */ function isValidEDSSettings() { return new Promise(function (resolve, reject) { - cadesplugin.async_spawn(function* () { + cryptoCommon.execute(function () { var result; try { - result = yield cadesplugin.CreateObjectAsync('CAdESCOM.About'); + result = cryptoCommon.createObj('CAdESCOM.About'); } catch (error) { reject('Настройки ЭП на данной машине не верны'); } @@ -603,6 +603,28 @@ webpackJsonpCryptoPro([1],[ {possibleNames: ['L'], translation: 'Город'} ]; + function execute(cb) { + if (cadesplugin.CreateObjectAsync) { + var GeneratorFunction = (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))(); + + cb = String(cb); + + var args = cb.match(/^function\s*?\((.*?)\)/); + + args = (args && args[1]) || ''; + + cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1'); + + cadesplugin.async_spawn(new GeneratorFunction(args, cb)); + } + } + + function createObj(type) { + if (cadesplugin.CreateObjectAsync) { + return (new Function('', 'return yield cadesplugin.CreateObjectAsync(' + type + ')'))(); + } + } + /** * Парсит информацию из строки с информацией о сертификате * */ @@ -830,6 +852,8 @@ webpackJsonpCryptoPro([1],[ } module.exports = { + execute: execute, + createObj: createObj, subjectNameTagsTranslations: subjectNameTagsTranslations, issuerNameTagsTranslations: issuerNameTagsTranslations, parseCertInfo: parseCertInfo, diff --git a/dist/1.crypto-pro.js.map b/dist/1.crypto-pro.js.map index 268b611..548445a 100644 --- a/dist/1.crypto-pro.js.map +++ b/dist/1.crypto-pro.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./apiAsync.js","webpack:///./common.js","webpack:///./oids.js","webpack:///./constants.js"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,QAAQ,6BAA6B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;;AAErB;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACxiBA;AACA;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,+CAA+C;AACxD,UAAS,8CAA8C;AACvD,UAAS,kDAAkD;AAC3D,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0DAA0D;AACnE,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,2DAA2D;AACpE,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0CAA0C;AACnD,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAqC,EAAE;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB;AACjB,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,aAAa;AACxB,cAAa,QAAQ,gCAAgC;AACrD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB;AACrB,kBAAiB;AACjB,cAAa;AACb;AACA;AACA,kBAAiB;AACjB;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK,IAAI;;AAET;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACrRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,G","file":"1.crypto-pro.js","sourcesContent":["var cryptoCommon = require('./common'),\n cryptoConstants = require('./constants'),\n _certListCache;\n\nfunction Certificate(item) {\n this._cert = item._cert;\n this.thumbprint = item.thumbprint;\n this.subjectName = item.subjectName;\n this.issuerName = item.issuerName;\n this.validFrom = item.validFrom;\n this.validTo = item.validTo;\n}\n\n/**\n * Проверяет, валиден ли сертификат\n * */\nCertificate.prototype.isValid = function isValid() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result;\n\n try {\n result = yield cert.IsValid();\n result = yield result.Result;\n } catch (err) {\n reject('Ошибка при проверке сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n });\n};\n\n/**\n * Достает указанное свойство у сертификата\n * */\nCertificate.prototype.getProp = function (propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result;\n\n try {\n result = yield cert[propName];\n } catch (err) {\n reject('Ошибка при обращении к свойству сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n });\n};\n\n/**\n * Экспорт base64 представления сертификата пользователя\n * */\nCertificate.prototype.exportBase64 = function exportBase64() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var base64;\n\n try {\n base64 = yield cert.Export(0);\n } catch (err) {\n reject('Ошибка при экспорте сертификата: ', err.message);\n return;\n }\n\n resolve(base64);\n });\n });\n};\n\n/**\n * Возвращает информацию об алгоритме\n * */\nCertificate.prototype.getAlgorithm = function getAlgorithm() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result = {},\n algorithm;\n\n try {\n algorithm = yield cert.PublicKey();\n algorithm = yield algorithm.Algorithm;\n\n result.algorithm = yield algorithm.FriendlyName;\n result.oid = yield algorithm.Value;\n } catch (err) {\n reject('Ошибка при получении алгоритма: ', err.message);\n return;\n }\n\n resolve(result);\n });\n });\n};\n\n/**\n * Разбирает SubjectName сертификата по тэгам\n * */\nCertificate.prototype.getOwnerInfo = function getOwnerInfo() {\n return getCertInfo.call(this, cryptoCommon.subjectNameTagsTranslations, 'SubjectName');\n};\n\n/**\n * Разбирает IssuerName сертификата по тэгам\n * */\nCertificate.prototype.getIssuerInfo = function getIssuerInfo() {\n return getCertInfo.call(this, cryptoCommon.issuerNameTagsTranslations, 'IssuerName');\n};\n\n/**\n * Получение OID сертификата\n *\n * @returns {Array} Возвращает массив OID (улучшенного ключа)\n * */\nCertificate.prototype.getExtendedKeyUsage = function getExtendedKeyUsage() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var OIDS = [],\n count,\n item;\n\n try {\n count = yield cert.ExtendedKeyUsage();\n count = yield count.EKUs;\n count = yield count.Count;\n\n if (count > 0) {\n while (count > 0) {\n item = yield cert.ExtendedKeyUsage();\n item = yield item.EKUs;\n item = yield item.Item(count);\n item = yield item.OID;\n\n OIDS.push(item);\n\n count--;\n }\n }\n } catch (err) {\n reject('Ошибка при получении ОИД\\'ов: ', err.message);\n return;\n }\n\n resolve(OIDS);\n });\n });\n};\n\nCertificate.prototype.getDecodedExtendedKeyUsage = cryptoCommon.getDecodedExtendedKeyUsage;\n\nCertificate.prototype.hasExtendedKeyUsage = cryptoCommon.hasExtendedKeyUsage;\n\n/**\n * Проверяет корректность настроек ЭП на машине\n * */\nfunction isValidEDSSettings() {\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result;\n\n try {\n result = yield cadesplugin.CreateObjectAsync('CAdESCOM.About');\n } catch (error) {\n reject('Настройки ЭП на данной машине не верны');\n }\n\n resolve();\n });\n });\n}\n\n/**\n * Получить сертификат в формате cades по хэшу\n * */\nfunction getCadesCert(hash) {\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var oStore = yield cadesplugin.CreateObjectAsync('CAdESCOM.Store'),\n certs,\n certCnt,\n cert;\n\n if (!oStore) {\n reject('Не удалось получить доступ к хранилищу сертификатов');\n return;\n }\n\n // Открываем хранилище\n try {\n yield oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = yield oStore.Certificates;\n certCnt = yield certs.Count;\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!certCnt) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n // Получаем сертификат по хэшу\n try {\n certs = yield certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, hash);\n\n if (certs.Count) {\n cert = yield certs.Item(1);\n } else {\n throw new Error(hash);\n }\n } catch (err) {\n reject('Не удалось получить сертификат по хэшу: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n resolve(cert);\n });\n });\n}\n\n/**\n * Разбирает информацию сертификата по тэгам\n * */\nfunction getCertInfo(tags, propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var propInfo;\n\n try {\n propInfo = yield cert[propName];\n } catch (err) {\n reject('Ошибка при извлечении данных из сертификата: ', err.message);\n return;\n }\n\n resolve(cryptoCommon.parseCertInfo(tags, propInfo));\n });\n });\n}\n\n/**\n * Возвращает список сертификатов, доступных в системе\n *\n * @param {Boolean} [resetCache=false] -- нужно ли сбросить кэш списка сертификатов\n * @returns {Promise} -- со списком сертификатов {Array}\n * */\nfunction getCertsList(resetCache) {\n return new Promise(function (resolve, reject) {\n if (!resetCache && _certListCache) {\n resolve(_certListCache);\n return;\n }\n\n cadesplugin.async_spawn(function* () {\n var oStore = yield cadesplugin.CreateObjectAsync('CAdESCOM.Store'),\n result = [],\n certs,\n count,\n item;\n\n // Открываем хранилище\n try {\n yield oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = yield oStore.Certificates;\n\n if (certs) {\n certs = yield certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n * */\n certs = yield certs.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n cryptoConstants.PropId.CAPICOM_PROPID_KEY_PROV_INFO\n );\n\n count = yield certs.Count;\n }\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!count) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n try {\n while (count) {\n item = yield certs.Item(count);\n\n result.push(new Certificate({\n _cert: yield item,\n thumbprint: yield item.Thumbprint,\n subjectName: yield item.SubjectName,\n issuerName: yield item.IssuerName,\n validFrom: yield item.ValidFromDate,\n validTo: yield item.ValidToDate\n }));\n\n count--;\n }\n } catch (err) {\n reject('Ошибка обработки сертификатов: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n _certListCache = cryptoCommon.prepareCertsInfo(result);\n\n resolve(_certListCache);\n });\n });\n}\n\n/**\n * Получить сертификат по хэшу\n * */\nfunction getCert(hash) {\n return new Promise(function (resolve, reject) {\n if (!hash) {\n reject('Хэш не указан');\n return;\n }\n\n getCertsList().then(function (list) {\n var foundCert;\n\n list.some(function (cert) {\n if (hash === cert.thumbprint) {\n foundCert = cert;\n return true;\n }\n });\n\n if (foundCert) {\n resolve(foundCert);\n } else {\n reject('Сертификат с хэшем: \"' + hash + '\" не найден');\n }\n }, reject);\n });\n}\n\n/**\n * Создает подпись base64 строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataBase64 -- строковые данные в формате base64\n * @param {Boolean} signType -- тип подписи открепленная (true) / присоединенная (false) (default: true)\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signData(hash, dataBase64, signType) {\n signType = typeof signType === 'undefined' ? true : Boolean(signType);\n\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n cadesplugin.async_spawn(function* () {\n var clientTime = new Date(),\n oAttrs = yield cadesplugin.CreateObjectAsync('CADESCOM.CPAttribute'),\n oSignedData = yield cadesplugin.CreateObjectAsync('CAdESCOM.CadesSignedData'),\n oSigner = yield cadesplugin.CreateObjectAsync('CAdESCOM.CPSigner'),\n attrs,\n signature;\n\n clientTime = cryptoCommon.getDateObj(clientTime);\n\n try {\n yield oAttrs.propset_Name(cryptoConstants.Time.AUTHENTICATED_ATTRIBUTE_SIGNING_TIME);\n yield oAttrs.propset_Value(clientTime);\n } catch (err) {\n reject('Ошибка при установке данных подписи: ' + err.message);\n return;\n }\n\n // Задаем настройки для подписи\n try {\n yield oSigner.propset_Certificate(cert);\n attrs = yield oSigner.AuthenticatedAttributes2;\n yield attrs.Add(oAttrs);\n yield oSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY);\n yield oSignedData.propset_Content(dataBase64);\n yield oSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY);\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = yield oSignedData.SignCades(\n oSigner,\n cadesplugin.CADESCOM_CADES_BES,\n signType\n );\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n });\n }, reject);\n });\n}\n\n/**\n * Создает подпись XML строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataXML -- данные в формате XML\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signDataXML(hash, dataXML) {\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n cadesplugin.async_spawn(function* () {\n var oSigner = yield cadesplugin.CreateObjectAsync('CAdESCOM.CPSigner'),\n signerXML = yield cadesplugin.CreateObjectAsync('CAdESCOM.SignedXML'),\n cnts = cryptoConstants,\n signature;\n\n // Задаем настройки для подписи\n try {\n yield oSigner.propset_Certificate(cert);\n // Добавляем данные для подписи\n yield signerXML.propset_Content(dataXML);\n // Устанавливаем тип подписи\n yield signerXML.propset_SignatureType(cnts.SignatureType.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED);\n // Устанавливаем алгоритм подписи\n yield signerXML.propset_SignatureMethod(cnts.GostXmlDSigUrls.XmlDsigGost3410Url);\n // Устанавливаем алгоритм хэширования\n yield signerXML.propset_DigestMethod(cnts.GostXmlDSigUrls.XmlDsigGost3411Url);\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = yield signerXML.Sign(oSigner);\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n });\n }, reject);\n });\n}\n\n/**\n * Возвращает информацию о версии CSP и плагина\n * */\nfunction getSystemInfo() {\n var sysInfo = cryptoCommon.getEnvInfo();\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var e;\n\n try {\n e = yield cadesplugin.CreateObjectAsync('CAdESCOM.About');\n\n sysInfo.cadesVersion = yield e.PluginVersion;\n // Возможен вызов в ранних версиях в виде sysInfo.cspVersion = yield e.CSPVersion('', 75);\n sysInfo.cspVersion = yield e.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = yield e.Version;\n }\n\n sysInfo.cadesVersion = yield sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = yield sysInfo.cspVersion.toString();\n\n resolve(sysInfo);\n } catch (err) {\n reject('Ошибка при получении информации о системе: ', err.message);\n }\n });\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии CSP\n * */\nfunction isValidCSPVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCSPVersion(version));\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии плагина\n * */\nfunction isValidCadesVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCadesVersion(version));\n });\n}\n\nmodule.exports = {\n isValidEDSSettings: isValidEDSSettings,\n getCertsList: getCertsList,\n getCert: getCert,\n signData: signData,\n signDataXML: signDataXML,\n getSystemInfo: getSystemInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./apiAsync.js\n ** module id = 4\n ** module chunks = 1\n **/","var bowser = require('bowser/bowser');\nvar oids = require('./oids');\n\nvar subjectNameTagsTranslations = [\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\n issuerNameTagsTranslations = [\n {possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя'},\n {possibleNames: ['CN'], translation: 'Удостоверяющий центр'},\n {possibleNames: ['S'], translation: 'Регион'},\n {possibleNames: ['C'], 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\n/**\n * Парсит информацию из строки с информацией о сертификате\n * */\nfunction parseCertInfo(tags, infoString) {\n /**\n * Пример входной строки:\n *\n\n T=Генеральный директор, UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n STREET=\"Крыленко, д.3, лит.Б\", CN=Король Анатолий Евгеньевич, G=Анатолий Евгеньевич, SN=Король,\n OU=Администрация, O=\"ООО \"\"Аксиома\"\"\", L=Санкт-Петербург, S=78 г. Санкт-Петербург, C=RU, E=korol@sferasro.ru,\n INN=007811514257, OGRN=1127847087884, SNILS=11617693460\n\n * */\n var result = infoString.match(/([а-яА-Яa-zA-Z0-9\\.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (result) {\n result = result.map(function (group) {\n /**\n * Пример входной строки:\n *\n\n UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n\n * */\n var parts = group.match(/^([а-яА-Яa-zA-Z0-9\\.]+)=(.+?),?$/),\n title = parts && parts[1],\n descr = parts && parts[2],\n translated = false,\n oidTitle;\n\n // Если тайтл содержит ОИД, пытаемся расшифровать\n if (/^OID./.test(title)) {\n oidTitle = title.match(/^OID\\.(.*)/);\n\n if (oidTitle && oidTitle[1]) {\n oidTitle = oids[oidTitle[1]];\n\n if (oidTitle) {\n title = oidTitle;\n }\n }\n }\n\n // Вырезаем лишние кавычки\n descr = descr.replace(/^\"(.*)\"/, '$1');\n descr = descr.replace(/\"{2}/g, '\"');\n\n tags.some(function (tag) {\n return tag.possibleNames.some(function (possible) {\n var match = possible === title;\n\n if (match) {\n title = tag.translation;\n translated = true;\n }\n\n return match;\n });\n });\n\n return {\n title: title,\n descr: descr,\n translated: translated\n };\n });\n }\n\n return result;\n}\n\n/**\n * Возвращает дату в формате (dd.mm.yyyy hh:mm:ss) из строки, формата, используемого плагином cryptoPro\n * */\nfunction getReadableDate(date) {\n date = new Date(date);\n\n return ([\n date.getDate(),\n date.getMonth() + 1,\n date.getFullYear()\n ].join('.') + ' ' + [\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n ].join(':')).replace(/\\b(\\d)\\b/g, '0$1');\n}\n\n/**\n * Преобразует дату для IE\n * */\nfunction getDateObj(dateObj) {\n return bowser.msie ? dateObj.getVarDate() : dateObj;\n}\n\n/**\n * Подготавливает информацию о сертификатах\n * */\nfunction prepareCertsInfo(items) {\n return items.map(function (c) {\n c.name = c.subjectName.match(/CN=(.+?),/);\n\n // Удалось ли вытащить Common Name\n if (c.name && c.name[1]) {\n c.name = c.name[1];\n }\n\n c.validFrom = getReadableDate(c.validFrom);\n c.validTo = getReadableDate(c.validTo);\n\n c.label = c.name + ' (до ' + c.validTo + ')';\n\n return c;\n });\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы\n * */\nfunction getDecodedExtendedKeyUsage() {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n resolve(certOids.reduce(function (oidsLst, oid) {\n oid = {\n id: oid,\n descr: oids[oid] || null\n };\n\n if (oid.descr) {\n oidsLst.unshift(oid);\n } else {\n oidsLst.push(oid);\n }\n\n return oidsLst;\n }, []));\n });\n });\n}\n\n/**\n * Проверка наличия ОИД'а(ОИД'ов) у сертификата\n *\n * @param {String|Array} oids - ОИД'ы для проверки\n * @returns {Promise} с отложенным результатом типа {Boolean}\n * */\nfunction hasExtendedKeyUsage(oids) {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n var result;\n\n if (Array.isArray(oids)) {\n result = oids.every(function (oidToCheck) {\n return certOids.some(function (certOid) {\n return certOid === oidToCheck;\n });\n });\n } else {\n result = certOids.some(function (certOid) {\n return certOid === oids;\n });\n }\n\n resolve(result);\n });\n });\n}\n\n/**\n * Выводит информацию о системе пользователя\n * */\nfunction getEnvInfo() {\n var parsed = bowser._detect(navigator.userAgent),\n info = {\n browserName: parsed.name,\n browserVersion: parsed.version\n };\n\n if (parsed.mac) {\n info.os = 'Mac';\n } else if (parsed.windows) {\n info.os = 'Windows';\n } else if (parsed.linux) {\n info.os = 'Linux';\n }\n\n return info;\n}\n\n/**\n * Подходящая ли версия CSP\n * */\nfunction isValidCSPVersion(version) {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/);\n\n return version >= 3.6;\n}\n\n/**\n * Подходящая ли версия cades плагина\n * */\nfunction isValidCadesVersion(version) {\n version = version.split('.').reduce(function (verInfo, number, i) {\n if (i === 0) {\n verInfo.major = number;\n } else if (i === 1) {\n verInfo.minor = number;\n } else if (i === 2) {\n verInfo.patch = number;\n }\n\n return verInfo;\n }, {});\n\n if (version.major < 2) {\n return false;\n }\n\n return version.patch >= 12438;\n}\n\nmodule.exports = {\n subjectNameTagsTranslations: subjectNameTagsTranslations,\n issuerNameTagsTranslations: issuerNameTagsTranslations,\n parseCertInfo: parseCertInfo,\n getReadableDate: getReadableDate,\n getDateObj: getDateObj,\n prepareCertsInfo: prepareCertsInfo,\n getDecodedExtendedKeyUsage: getDecodedExtendedKeyUsage,\n hasExtendedKeyUsage: hasExtendedKeyUsage,\n getEnvInfo: getEnvInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./common.js\n ** module id = 5\n ** module chunks = 1 2\n **/","module.exports = {\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\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.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.6.2.1.7.2': 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.2.1.7.1': 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\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 '1.2.643.3.8.100.1.10': 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11': 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13': 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.6.3': 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.5.1.24.2.1.3': 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1': 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3': 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\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.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"'\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./oids.js\n ** module id = 6\n ** module chunks = 1 2\n **/","module.exports = {\n // CAPICOM_STORE_LOCATION enumeration\n StoreLocation: {\n CAPICOM_MEMORY_STORE: 0,\n CAPICOM_LOCAL_MACHINE_STORE: 1,\n CAPICOM_CURRENT_USER_STORE: 2,\n CAPICOM_ACTIVE_DIRECTORY_USER_STORE: 3,\n CAPICOM_SMART_CARD_USER_STORE: 4\n },\n // CAPICOM_STORE_OPEN_MODE enumeration\n StoreOpenMode: {\n CAPICOM_STORE_OPEN_READ_ONLY: 0,\n CAPICOM_STORE_OPEN_READ_WRITE: 1,\n CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED: 2,\n CAPICOM_STORE_OPEN_EXISTING_ONLY: 128,\n CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED: 256\n },\n // CAPICOM_CERTIFICATE_FIND_TYPE enumeration\n CertFindType: {\n CAPICOM_CERTIFICATE_FIND_SHA1_HASH: 0,\n CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME: 1,\n CAPICOM_CERTIFICATE_FIND_ISSUER_NAME: 2,\n CAPICOM_CERTIFICATE_FIND_ROOT_NAME: 3,\n CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME: 4,\n CAPICOM_CERTIFICATE_FIND_EXTENSION: 5,\n CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY: 6,\n CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY: 7,\n CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY: 8,\n CAPICOM_CERTIFICATE_FIND_TIME_VALID: 9,\n CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID: 10,\n CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED: 11,\n CAPICOM_CERTIFICATE_FIND_KEY_USAGE: 12\n },\n Time: {\n AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0\n },\n Check: {\n CHECK_NONE: 0,\n CHECK_TRUSTED_ROOT: 1,\n CHECK_TIME_VALIDITY: 2,\n CHECK_SIGNATURE_VALIDITY: 4,\n CHECK_ONLINE_REVOCATION_STATUS: 8,\n CHECK_OFFLINE_REVOCATION_STATUS: 16,\n TRUST_IS_NOT_TIME_VALID: 1,\n TRUST_IS_NOT_TIME_NESTED: 2,\n TRUST_IS_REVOKED: 4,\n TRUST_IS_NOT_SIGNATURE_VALID: 8,\n TRUST_IS_NOT_VALID_FOR_USAGE: 16,\n TRUST_IS_UNTRUSTED_ROOT: 32,\n TRUST_REVOCATION_STATUS_UNKNOWN: 64,\n TRUST_IS_CYCLIC: 128,\n TRUST_IS_PARTIAL_CHAIN: 65536,\n TRUST_CTL_IS_NOT_TIME_VALID: 131072,\n TRUST_CTL_IS_NOT_SIGNATURE_VALID: 262144,\n TRUST_CTL_IS_NOT_VALID_FOR_USAGE: 524288,\n },\n // CAPICOM_PROPID enumeration\n PropId: {\n CAPICOM_PROPID_UNKNOWN: 0,\n CAPICOM_PROPID_KEY_PROV_HANDLE: 1,\n CAPICOM_PROPID_KEY_PROV_INFO: 2,\n CAPICOM_PROPID_SHA1_HASH: 3,\n CAPICOM_PROPID_HASH_PROP: 3,\n CAPICOM_PROPID_MD5_HASH: 4,\n CAPICOM_PROPID_KEY_CONTEXT: 5,\n CAPICOM_PROPID_KEY_SPEC: 6,\n CAPICOM_PROPID_IE30_RESERVED: 7,\n CAPICOM_PROPID_PUBKEY_HASH_RESERVED: 8,\n CAPICOM_PROPID_ENHKEY_USAGE: 9,\n CAPICOM_PROPID_CTL_USAGE: 9,\n CAPICOM_PROPID_NEXT_UPDATE_LOCATION: 10,\n CAPICOM_PROPID_FRIENDLY_NAME: 11,\n CAPICOM_PROPID_PVK_FILE: 12,\n CAPICOM_PROPID_DESCRIPTION: 13,\n CAPICOM_PROPID_ACCESS_STATE: 14,\n CAPICOM_PROPID_SIGNATURE_HASH: 15,\n CAPICOM_PROPID_SMART_CARD_DATA: 16,\n CAPICOM_PROPID_EFS: 17,\n CAPICOM_PROPID_FORTEZZA_DATA: 18,\n CAPICOM_PROPID_ARCHIVED: 19,\n CAPICOM_PROPID_KEY_IDENTIFIER: 20,\n CAPICOM_PROPID_AUTO_ENROLL: 21,\n CAPICOM_PROPID_PUBKEY_ALG_PARA: 22,\n CAPICOM_PROPID_CROSS_CERT_DIST_POINTS: 23,\n CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH: 24,\n CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH: 25,\n CAPICOM_PROPID_ENROLLMENT: 26,\n CAPICOM_PROPID_DATE_STAMP: 27,\n CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH: 28,\n CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH: 29,\n CAPICOM_PROPID_EXTENDED_ERROR_INFO: 30,\n CAPICOM_PROPID_RENEWAL: 64,\n CAPICOM_PROPID_ARCHIVED_KEY_HASH: 65,\n CAPICOM_PROPID_FIRST_RESERVED: 66,\n CAPICOM_PROPID_LAST_RESERVED: 0x00007FFF,\n CAPICOM_PROPID_FIRST_USER: 0x00008000,\n CAPICOM_PROPID_LAST_USER: 0x0000FFFF\n },\n // CADESCOM_XML_SIGNATURE_TYPE enumeration\n SignatureType: {\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED: 0,\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING: 1,\n CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE: 2\n },\n // CADESCOM_HASH_ALGORITHM enumeration\n HashAlgorithm: {\n CADESCOM_HASH_ALGORITHM_CP_GOST_3411: 100,\n CADESCOM_HASH_ALGORITHM_MD2: 1,\n CADESCOM_HASH_ALGORITHM_MD4: 2,\n CADESCOM_HASH_ALGORITHM_MD5: 3,\n CADESCOM_HASH_ALGORITHM_SHA_256: 4,\n CADESCOM_HASH_ALGORITHM_SHA_384: 5,\n CADESCOM_HASH_ALGORITHM_SHA_512: 6,\n CADESCOM_HASH_ALGORITHM_SHA1: 0\n },\n CadesType: {\n CADESCOM_CADES_DEFAULT: 0,\n CADESCOM_CADES_BES: 1,\n CADESCOM_CADES_X_LONG_TYPE_1: 0x5d\n },\n ContentEncoding: {\n CADESCOM_BASE64_TO_BINARY: 0x01,\n CADESCOM_STRING_TO_UCS2LE: 0x00\n },\n StoreNames: {\n CAPICOM_MY_STORE: 'My'\n },\n Chain: {\n CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT: 0,\n CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN: 1,\n CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY: 2\n },\n GostXmlDSigUrls: {\n XmlDsigGost3410Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411',\n XmlDsigGost3411Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411',\n XmlDsigGost3410UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411',\n XmlDsigGost3411UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr3411'\n }\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./constants.js\n ** module id = 7\n ** module chunks = 1 2\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./apiAsync.js","webpack:///./common.js","webpack:///./oids.js","webpack:///./constants.js"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,4BAA2B;AAC3B;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,MAAM;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,QAAQ,6BAA6B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;;AAErB;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACxiBA;AACA;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,+CAA+C;AACxD,UAAS,8CAA8C;AACvD,UAAS,kDAAkD;AAC3D,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0DAA0D;AACnE,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,2DAA2D;AACpE,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0CAA0C;AACnD,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA;AACA,8FAA6F;;AAE7F;;AAEA;;AAEA,wC;;AAEA,+BAA8B,WAAW;;AAEzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAqC,EAAE;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB;AACjB,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,aAAa;AACxB,cAAa,QAAQ,gCAAgC;AACrD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB;AACrB,kBAAiB;AACjB,cAAa;AACb;AACA;AACA,kBAAiB;AACjB;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK,IAAI;;AAET;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,G","file":"1.crypto-pro.js","sourcesContent":["var cryptoCommon = require('./common'),\n cryptoConstants = require('./constants'),\n _certListCache;\n\nfunction Certificate(item) {\n this._cert = item._cert;\n this.thumbprint = item.thumbprint;\n this.subjectName = item.subjectName;\n this.issuerName = item.issuerName;\n this.validFrom = item.validFrom;\n this.validTo = item.validTo;\n}\n\n/**\n * Проверяет, валиден ли сертификат\n * */\nCertificate.prototype.isValid = function isValid() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result;\n\n try {\n result = yield cert.IsValid();\n result = yield result.Result;\n } catch (err) {\n reject('Ошибка при проверке сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n });\n};\n\n/**\n * Достает указанное свойство у сертификата\n * */\nCertificate.prototype.getProp = function (propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result;\n\n try {\n result = yield cert[propName];\n } catch (err) {\n reject('Ошибка при обращении к свойству сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n });\n};\n\n/**\n * Экспорт base64 представления сертификата пользователя\n * */\nCertificate.prototype.exportBase64 = function exportBase64() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var base64;\n\n try {\n base64 = yield cert.Export(0);\n } catch (err) {\n reject('Ошибка при экспорте сертификата: ', err.message);\n return;\n }\n\n resolve(base64);\n });\n });\n};\n\n/**\n * Возвращает информацию об алгоритме\n * */\nCertificate.prototype.getAlgorithm = function getAlgorithm() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var result = {},\n algorithm;\n\n try {\n algorithm = yield cert.PublicKey();\n algorithm = yield algorithm.Algorithm;\n\n result.algorithm = yield algorithm.FriendlyName;\n result.oid = yield algorithm.Value;\n } catch (err) {\n reject('Ошибка при получении алгоритма: ', err.message);\n return;\n }\n\n resolve(result);\n });\n });\n};\n\n/**\n * Разбирает SubjectName сертификата по тэгам\n * */\nCertificate.prototype.getOwnerInfo = function getOwnerInfo() {\n return getCertInfo.call(this, cryptoCommon.subjectNameTagsTranslations, 'SubjectName');\n};\n\n/**\n * Разбирает IssuerName сертификата по тэгам\n * */\nCertificate.prototype.getIssuerInfo = function getIssuerInfo() {\n return getCertInfo.call(this, cryptoCommon.issuerNameTagsTranslations, 'IssuerName');\n};\n\n/**\n * Получение OID сертификата\n *\n * @returns {Array} Возвращает массив OID (улучшенного ключа)\n * */\nCertificate.prototype.getExtendedKeyUsage = function getExtendedKeyUsage() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var OIDS = [],\n count,\n item;\n\n try {\n count = yield cert.ExtendedKeyUsage();\n count = yield count.EKUs;\n count = yield count.Count;\n\n if (count > 0) {\n while (count > 0) {\n item = yield cert.ExtendedKeyUsage();\n item = yield item.EKUs;\n item = yield item.Item(count);\n item = yield item.OID;\n\n OIDS.push(item);\n\n count--;\n }\n }\n } catch (err) {\n reject('Ошибка при получении ОИД\\'ов: ', err.message);\n return;\n }\n\n resolve(OIDS);\n });\n });\n};\n\nCertificate.prototype.getDecodedExtendedKeyUsage = cryptoCommon.getDecodedExtendedKeyUsage;\n\nCertificate.prototype.hasExtendedKeyUsage = cryptoCommon.hasExtendedKeyUsage;\n\n/**\n * Проверяет корректность настроек ЭП на машине\n * */\nfunction isValidEDSSettings() {\n return new Promise(function (resolve, reject) {\n cryptoCommon.execute(function () {\n var result;\n\n try {\n result = cryptoCommon.createObj('CAdESCOM.About');\n } catch (error) {\n reject('Настройки ЭП на данной машине не верны');\n }\n\n resolve();\n });\n });\n}\n\n/**\n * Получить сертификат в формате cades по хэшу\n * */\nfunction getCadesCert(hash) {\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var oStore = yield cadesplugin.CreateObjectAsync('CAdESCOM.Store'),\n certs,\n certCnt,\n cert;\n\n if (!oStore) {\n reject('Не удалось получить доступ к хранилищу сертификатов');\n return;\n }\n\n // Открываем хранилище\n try {\n yield oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = yield oStore.Certificates;\n certCnt = yield certs.Count;\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!certCnt) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n // Получаем сертификат по хэшу\n try {\n certs = yield certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, hash);\n\n if (certs.Count) {\n cert = yield certs.Item(1);\n } else {\n throw new Error(hash);\n }\n } catch (err) {\n reject('Не удалось получить сертификат по хэшу: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n resolve(cert);\n });\n });\n}\n\n/**\n * Разбирает информацию сертификата по тэгам\n * */\nfunction getCertInfo(tags, propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var propInfo;\n\n try {\n propInfo = yield cert[propName];\n } catch (err) {\n reject('Ошибка при извлечении данных из сертификата: ', err.message);\n return;\n }\n\n resolve(cryptoCommon.parseCertInfo(tags, propInfo));\n });\n });\n}\n\n/**\n * Возвращает список сертификатов, доступных в системе\n *\n * @param {Boolean} [resetCache=false] -- нужно ли сбросить кэш списка сертификатов\n * @returns {Promise} -- со списком сертификатов {Array}\n * */\nfunction getCertsList(resetCache) {\n return new Promise(function (resolve, reject) {\n if (!resetCache && _certListCache) {\n resolve(_certListCache);\n return;\n }\n\n cadesplugin.async_spawn(function* () {\n var oStore = yield cadesplugin.CreateObjectAsync('CAdESCOM.Store'),\n result = [],\n certs,\n count,\n item;\n\n // Открываем хранилище\n try {\n yield oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = yield oStore.Certificates;\n\n if (certs) {\n certs = yield certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n * */\n certs = yield certs.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n cryptoConstants.PropId.CAPICOM_PROPID_KEY_PROV_INFO\n );\n\n count = yield certs.Count;\n }\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!count) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n try {\n while (count) {\n item = yield certs.Item(count);\n\n result.push(new Certificate({\n _cert: yield item,\n thumbprint: yield item.Thumbprint,\n subjectName: yield item.SubjectName,\n issuerName: yield item.IssuerName,\n validFrom: yield item.ValidFromDate,\n validTo: yield item.ValidToDate\n }));\n\n count--;\n }\n } catch (err) {\n reject('Ошибка обработки сертификатов: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n _certListCache = cryptoCommon.prepareCertsInfo(result);\n\n resolve(_certListCache);\n });\n });\n}\n\n/**\n * Получить сертификат по хэшу\n * */\nfunction getCert(hash) {\n return new Promise(function (resolve, reject) {\n if (!hash) {\n reject('Хэш не указан');\n return;\n }\n\n getCertsList().then(function (list) {\n var foundCert;\n\n list.some(function (cert) {\n if (hash === cert.thumbprint) {\n foundCert = cert;\n return true;\n }\n });\n\n if (foundCert) {\n resolve(foundCert);\n } else {\n reject('Сертификат с хэшем: \"' + hash + '\" не найден');\n }\n }, reject);\n });\n}\n\n/**\n * Создает подпись base64 строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataBase64 -- строковые данные в формате base64\n * @param {Boolean} signType -- тип подписи открепленная (true) / присоединенная (false) (default: true)\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signData(hash, dataBase64, signType) {\n signType = typeof signType === 'undefined' ? true : Boolean(signType);\n\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n cadesplugin.async_spawn(function* () {\n var clientTime = new Date(),\n oAttrs = yield cadesplugin.CreateObjectAsync('CADESCOM.CPAttribute'),\n oSignedData = yield cadesplugin.CreateObjectAsync('CAdESCOM.CadesSignedData'),\n oSigner = yield cadesplugin.CreateObjectAsync('CAdESCOM.CPSigner'),\n attrs,\n signature;\n\n clientTime = cryptoCommon.getDateObj(clientTime);\n\n try {\n yield oAttrs.propset_Name(cryptoConstants.Time.AUTHENTICATED_ATTRIBUTE_SIGNING_TIME);\n yield oAttrs.propset_Value(clientTime);\n } catch (err) {\n reject('Ошибка при установке данных подписи: ' + err.message);\n return;\n }\n\n // Задаем настройки для подписи\n try {\n yield oSigner.propset_Certificate(cert);\n attrs = yield oSigner.AuthenticatedAttributes2;\n yield attrs.Add(oAttrs);\n yield oSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY);\n yield oSignedData.propset_Content(dataBase64);\n yield oSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY);\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = yield oSignedData.SignCades(\n oSigner,\n cadesplugin.CADESCOM_CADES_BES,\n signType\n );\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n });\n }, reject);\n });\n}\n\n/**\n * Создает подпись XML строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataXML -- данные в формате XML\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signDataXML(hash, dataXML) {\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n cadesplugin.async_spawn(function* () {\n var oSigner = yield cadesplugin.CreateObjectAsync('CAdESCOM.CPSigner'),\n signerXML = yield cadesplugin.CreateObjectAsync('CAdESCOM.SignedXML'),\n cnts = cryptoConstants,\n signature;\n\n // Задаем настройки для подписи\n try {\n yield oSigner.propset_Certificate(cert);\n // Добавляем данные для подписи\n yield signerXML.propset_Content(dataXML);\n // Устанавливаем тип подписи\n yield signerXML.propset_SignatureType(cnts.SignatureType.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED);\n // Устанавливаем алгоритм подписи\n yield signerXML.propset_SignatureMethod(cnts.GostXmlDSigUrls.XmlDsigGost3410Url);\n // Устанавливаем алгоритм хэширования\n yield signerXML.propset_DigestMethod(cnts.GostXmlDSigUrls.XmlDsigGost3411Url);\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = yield signerXML.Sign(oSigner);\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n });\n }, reject);\n });\n}\n\n/**\n * Возвращает информацию о версии CSP и плагина\n * */\nfunction getSystemInfo() {\n var sysInfo = cryptoCommon.getEnvInfo();\n\n return new Promise(function (resolve, reject) {\n cadesplugin.async_spawn(function* () {\n var e;\n\n try {\n e = yield cadesplugin.CreateObjectAsync('CAdESCOM.About');\n\n sysInfo.cadesVersion = yield e.PluginVersion;\n // Возможен вызов в ранних версиях в виде sysInfo.cspVersion = yield e.CSPVersion('', 75);\n sysInfo.cspVersion = yield e.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = yield e.Version;\n }\n\n sysInfo.cadesVersion = yield sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = yield sysInfo.cspVersion.toString();\n\n resolve(sysInfo);\n } catch (err) {\n reject('Ошибка при получении информации о системе: ', err.message);\n }\n });\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии CSP\n * */\nfunction isValidCSPVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCSPVersion(version));\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии плагина\n * */\nfunction isValidCadesVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCadesVersion(version));\n });\n}\n\nmodule.exports = {\n isValidEDSSettings: isValidEDSSettings,\n getCertsList: getCertsList,\n getCert: getCert,\n signData: signData,\n signDataXML: signDataXML,\n getSystemInfo: getSystemInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./apiAsync.js\n ** module id = 4\n ** module chunks = 1\n **/","var bowser = require('bowser/bowser');\nvar oids = require('./oids');\n\nvar subjectNameTagsTranslations = [\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\n issuerNameTagsTranslations = [\n {possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя'},\n {possibleNames: ['CN'], translation: 'Удостоверяющий центр'},\n {possibleNames: ['S'], translation: 'Регион'},\n {possibleNames: ['C'], 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\nfunction execute(cb) {\n if (cadesplugin.CreateObjectAsync) {\n var GeneratorFunction = (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();\n \n cb = String(cb);\n \n var args = cb.match(/^function\\s*?\\((.*?)\\)/);\n \n args = (args && args[1]) || ''; \n \n cb = cb.replace(/^.*?{([\\s\\S]*?)}$/, '$1');\n \n cadesplugin.async_spawn(new GeneratorFunction(args, cb));\n }\n}\n\nfunction createObj(type) {\n if (cadesplugin.CreateObjectAsync) {\n return (new Function('', 'return yield cadesplugin.CreateObjectAsync(' + type + ')'))();\n }\n}\n\n/**\n * Парсит информацию из строки с информацией о сертификате\n * */\nfunction parseCertInfo(tags, infoString) {\n /**\n * Пример входной строки:\n *\n\n T=Генеральный директор, UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n STREET=\"Крыленко, д.3, лит.Б\", CN=Король Анатолий Евгеньевич, G=Анатолий Евгеньевич, SN=Король,\n OU=Администрация, O=\"ООО \"\"Аксиома\"\"\", L=Санкт-Петербург, S=78 г. Санкт-Петербург, C=RU, E=korol@sferasro.ru,\n INN=007811514257, OGRN=1127847087884, SNILS=11617693460\n\n * */\n var result = infoString.match(/([а-яА-Яa-zA-Z0-9\\.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (result) {\n result = result.map(function (group) {\n /**\n * Пример входной строки:\n *\n\n UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n\n * */\n var parts = group.match(/^([а-яА-Яa-zA-Z0-9\\.]+)=(.+?),?$/),\n title = parts && parts[1],\n descr = parts && parts[2],\n translated = false,\n oidTitle;\n\n // Если тайтл содержит ОИД, пытаемся расшифровать\n if (/^OID./.test(title)) {\n oidTitle = title.match(/^OID\\.(.*)/);\n\n if (oidTitle && oidTitle[1]) {\n oidTitle = oids[oidTitle[1]];\n\n if (oidTitle) {\n title = oidTitle;\n }\n }\n }\n\n // Вырезаем лишние кавычки\n descr = descr.replace(/^\"(.*)\"/, '$1');\n descr = descr.replace(/\"{2}/g, '\"');\n\n tags.some(function (tag) {\n return tag.possibleNames.some(function (possible) {\n var match = possible === title;\n\n if (match) {\n title = tag.translation;\n translated = true;\n }\n\n return match;\n });\n });\n\n return {\n title: title,\n descr: descr,\n translated: translated\n };\n });\n }\n\n return result;\n}\n\n/**\n * Возвращает дату в формате (dd.mm.yyyy hh:mm:ss) из строки, формата, используемого плагином cryptoPro\n * */\nfunction getReadableDate(date) {\n date = new Date(date);\n\n return ([\n date.getDate(),\n date.getMonth() + 1,\n date.getFullYear()\n ].join('.') + ' ' + [\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n ].join(':')).replace(/\\b(\\d)\\b/g, '0$1');\n}\n\n/**\n * Преобразует дату для IE\n * */\nfunction getDateObj(dateObj) {\n return bowser.msie ? dateObj.getVarDate() : dateObj;\n}\n\n/**\n * Подготавливает информацию о сертификатах\n * */\nfunction prepareCertsInfo(items) {\n return items.map(function (c) {\n c.name = c.subjectName.match(/CN=(.+?),/);\n\n // Удалось ли вытащить Common Name\n if (c.name && c.name[1]) {\n c.name = c.name[1];\n }\n\n c.validFrom = getReadableDate(c.validFrom);\n c.validTo = getReadableDate(c.validTo);\n\n c.label = c.name + ' (до ' + c.validTo + ')';\n\n return c;\n });\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы\n * */\nfunction getDecodedExtendedKeyUsage() {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n resolve(certOids.reduce(function (oidsLst, oid) {\n oid = {\n id: oid,\n descr: oids[oid] || null\n };\n\n if (oid.descr) {\n oidsLst.unshift(oid);\n } else {\n oidsLst.push(oid);\n }\n\n return oidsLst;\n }, []));\n });\n });\n}\n\n/**\n * Проверка наличия ОИД'а(ОИД'ов) у сертификата\n *\n * @param {String|Array} oids - ОИД'ы для проверки\n * @returns {Promise} с отложенным результатом типа {Boolean}\n * */\nfunction hasExtendedKeyUsage(oids) {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n var result;\n\n if (Array.isArray(oids)) {\n result = oids.every(function (oidToCheck) {\n return certOids.some(function (certOid) {\n return certOid === oidToCheck;\n });\n });\n } else {\n result = certOids.some(function (certOid) {\n return certOid === oids;\n });\n }\n\n resolve(result);\n });\n });\n}\n\n/**\n * Выводит информацию о системе пользователя\n * */\nfunction getEnvInfo() {\n var parsed = bowser._detect(navigator.userAgent),\n info = {\n browserName: parsed.name,\n browserVersion: parsed.version\n };\n\n if (parsed.mac) {\n info.os = 'Mac';\n } else if (parsed.windows) {\n info.os = 'Windows';\n } else if (parsed.linux) {\n info.os = 'Linux';\n }\n\n return info;\n}\n\n/**\n * Подходящая ли версия CSP\n * */\nfunction isValidCSPVersion(version) {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/);\n\n return version >= 3.6;\n}\n\n/**\n * Подходящая ли версия cades плагина\n * */\nfunction isValidCadesVersion(version) {\n version = version.split('.').reduce(function (verInfo, number, i) {\n if (i === 0) {\n verInfo.major = number;\n } else if (i === 1) {\n verInfo.minor = number;\n } else if (i === 2) {\n verInfo.patch = number;\n }\n\n return verInfo;\n }, {});\n\n if (version.major < 2) {\n return false;\n }\n\n return version.patch >= 12438;\n}\n\nmodule.exports = {\n execute: execute,\n createObj: createObj,\n subjectNameTagsTranslations: subjectNameTagsTranslations,\n issuerNameTagsTranslations: issuerNameTagsTranslations,\n parseCertInfo: parseCertInfo,\n getReadableDate: getReadableDate,\n getDateObj: getDateObj,\n prepareCertsInfo: prepareCertsInfo,\n getDecodedExtendedKeyUsage: getDecodedExtendedKeyUsage,\n hasExtendedKeyUsage: hasExtendedKeyUsage,\n getEnvInfo: getEnvInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./common.js\n ** module id = 5\n ** module chunks = 1 2\n **/","module.exports = {\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\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.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.6.2.1.7.2': 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.2.1.7.1': 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\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 '1.2.643.3.8.100.1.10': 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11': 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13': 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.6.3': 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.5.1.24.2.1.3': 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1': 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3': 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\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.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"'\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./oids.js\n ** module id = 6\n ** module chunks = 1 2\n **/","module.exports = {\n // CAPICOM_STORE_LOCATION enumeration\n StoreLocation: {\n CAPICOM_MEMORY_STORE: 0,\n CAPICOM_LOCAL_MACHINE_STORE: 1,\n CAPICOM_CURRENT_USER_STORE: 2,\n CAPICOM_ACTIVE_DIRECTORY_USER_STORE: 3,\n CAPICOM_SMART_CARD_USER_STORE: 4\n },\n // CAPICOM_STORE_OPEN_MODE enumeration\n StoreOpenMode: {\n CAPICOM_STORE_OPEN_READ_ONLY: 0,\n CAPICOM_STORE_OPEN_READ_WRITE: 1,\n CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED: 2,\n CAPICOM_STORE_OPEN_EXISTING_ONLY: 128,\n CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED: 256\n },\n // CAPICOM_CERTIFICATE_FIND_TYPE enumeration\n CertFindType: {\n CAPICOM_CERTIFICATE_FIND_SHA1_HASH: 0,\n CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME: 1,\n CAPICOM_CERTIFICATE_FIND_ISSUER_NAME: 2,\n CAPICOM_CERTIFICATE_FIND_ROOT_NAME: 3,\n CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME: 4,\n CAPICOM_CERTIFICATE_FIND_EXTENSION: 5,\n CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY: 6,\n CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY: 7,\n CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY: 8,\n CAPICOM_CERTIFICATE_FIND_TIME_VALID: 9,\n CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID: 10,\n CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED: 11,\n CAPICOM_CERTIFICATE_FIND_KEY_USAGE: 12\n },\n Time: {\n AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0\n },\n Check: {\n CHECK_NONE: 0,\n CHECK_TRUSTED_ROOT: 1,\n CHECK_TIME_VALIDITY: 2,\n CHECK_SIGNATURE_VALIDITY: 4,\n CHECK_ONLINE_REVOCATION_STATUS: 8,\n CHECK_OFFLINE_REVOCATION_STATUS: 16,\n TRUST_IS_NOT_TIME_VALID: 1,\n TRUST_IS_NOT_TIME_NESTED: 2,\n TRUST_IS_REVOKED: 4,\n TRUST_IS_NOT_SIGNATURE_VALID: 8,\n TRUST_IS_NOT_VALID_FOR_USAGE: 16,\n TRUST_IS_UNTRUSTED_ROOT: 32,\n TRUST_REVOCATION_STATUS_UNKNOWN: 64,\n TRUST_IS_CYCLIC: 128,\n TRUST_IS_PARTIAL_CHAIN: 65536,\n TRUST_CTL_IS_NOT_TIME_VALID: 131072,\n TRUST_CTL_IS_NOT_SIGNATURE_VALID: 262144,\n TRUST_CTL_IS_NOT_VALID_FOR_USAGE: 524288,\n },\n // CAPICOM_PROPID enumeration\n PropId: {\n CAPICOM_PROPID_UNKNOWN: 0,\n CAPICOM_PROPID_KEY_PROV_HANDLE: 1,\n CAPICOM_PROPID_KEY_PROV_INFO: 2,\n CAPICOM_PROPID_SHA1_HASH: 3,\n CAPICOM_PROPID_HASH_PROP: 3,\n CAPICOM_PROPID_MD5_HASH: 4,\n CAPICOM_PROPID_KEY_CONTEXT: 5,\n CAPICOM_PROPID_KEY_SPEC: 6,\n CAPICOM_PROPID_IE30_RESERVED: 7,\n CAPICOM_PROPID_PUBKEY_HASH_RESERVED: 8,\n CAPICOM_PROPID_ENHKEY_USAGE: 9,\n CAPICOM_PROPID_CTL_USAGE: 9,\n CAPICOM_PROPID_NEXT_UPDATE_LOCATION: 10,\n CAPICOM_PROPID_FRIENDLY_NAME: 11,\n CAPICOM_PROPID_PVK_FILE: 12,\n CAPICOM_PROPID_DESCRIPTION: 13,\n CAPICOM_PROPID_ACCESS_STATE: 14,\n CAPICOM_PROPID_SIGNATURE_HASH: 15,\n CAPICOM_PROPID_SMART_CARD_DATA: 16,\n CAPICOM_PROPID_EFS: 17,\n CAPICOM_PROPID_FORTEZZA_DATA: 18,\n CAPICOM_PROPID_ARCHIVED: 19,\n CAPICOM_PROPID_KEY_IDENTIFIER: 20,\n CAPICOM_PROPID_AUTO_ENROLL: 21,\n CAPICOM_PROPID_PUBKEY_ALG_PARA: 22,\n CAPICOM_PROPID_CROSS_CERT_DIST_POINTS: 23,\n CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH: 24,\n CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH: 25,\n CAPICOM_PROPID_ENROLLMENT: 26,\n CAPICOM_PROPID_DATE_STAMP: 27,\n CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH: 28,\n CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH: 29,\n CAPICOM_PROPID_EXTENDED_ERROR_INFO: 30,\n CAPICOM_PROPID_RENEWAL: 64,\n CAPICOM_PROPID_ARCHIVED_KEY_HASH: 65,\n CAPICOM_PROPID_FIRST_RESERVED: 66,\n CAPICOM_PROPID_LAST_RESERVED: 0x00007FFF,\n CAPICOM_PROPID_FIRST_USER: 0x00008000,\n CAPICOM_PROPID_LAST_USER: 0x0000FFFF\n },\n // CADESCOM_XML_SIGNATURE_TYPE enumeration\n SignatureType: {\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED: 0,\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING: 1,\n CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE: 2\n },\n // CADESCOM_HASH_ALGORITHM enumeration\n HashAlgorithm: {\n CADESCOM_HASH_ALGORITHM_CP_GOST_3411: 100,\n CADESCOM_HASH_ALGORITHM_MD2: 1,\n CADESCOM_HASH_ALGORITHM_MD4: 2,\n CADESCOM_HASH_ALGORITHM_MD5: 3,\n CADESCOM_HASH_ALGORITHM_SHA_256: 4,\n CADESCOM_HASH_ALGORITHM_SHA_384: 5,\n CADESCOM_HASH_ALGORITHM_SHA_512: 6,\n CADESCOM_HASH_ALGORITHM_SHA1: 0\n },\n CadesType: {\n CADESCOM_CADES_DEFAULT: 0,\n CADESCOM_CADES_BES: 1,\n CADESCOM_CADES_X_LONG_TYPE_1: 0x5d\n },\n ContentEncoding: {\n CADESCOM_BASE64_TO_BINARY: 0x01,\n CADESCOM_STRING_TO_UCS2LE: 0x00\n },\n StoreNames: {\n CAPICOM_MY_STORE: 'My'\n },\n Chain: {\n CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT: 0,\n CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN: 1,\n CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY: 2\n },\n GostXmlDSigUrls: {\n XmlDsigGost3410Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411',\n XmlDsigGost3411Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411',\n XmlDsigGost3410UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411',\n XmlDsigGost3411UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr3411'\n }\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./constants.js\n ** module id = 7\n ** module chunks = 1 2\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/2.crypto-pro.js b/dist/2.crypto-pro.js index d157025..aa4822b 100644 --- a/dist/2.crypto-pro.js +++ b/dist/2.crypto-pro.js @@ -46,6 +46,28 @@ webpackJsonpCryptoPro([2],[ {possibleNames: ['L'], translation: 'Город'} ]; + function execute(cb) { + if (cadesplugin.CreateObjectAsync) { + var GeneratorFunction = (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))(); + + cb = String(cb); + + var args = cb.match(/^function\s*?\((.*?)\)/); + + args = (args && args[1]) || ''; + + cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1'); + + cadesplugin.async_spawn(new GeneratorFunction(args, cb)); + } + } + + function createObj(type) { + if (cadesplugin.CreateObjectAsync) { + return (new Function('', 'return yield cadesplugin.CreateObjectAsync(' + type + ')'))(); + } + } + /** * Парсит информацию из строки с информацией о сертификате * */ @@ -273,6 +295,8 @@ webpackJsonpCryptoPro([2],[ } module.exports = { + execute: execute, + createObj: createObj, subjectNameTagsTranslations: subjectNameTagsTranslations, issuerNameTagsTranslations: issuerNameTagsTranslations, parseCertInfo: parseCertInfo, diff --git a/dist/2.crypto-pro.js.map b/dist/2.crypto-pro.js.map index 99f6934..f708e5b 100644 --- a/dist/2.crypto-pro.js.map +++ b/dist/2.crypto-pro.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./common.js","webpack:///./oids.js","webpack:///./constants.js","webpack:///./apiSync.js"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,+CAA+C;AACxD,UAAS,8CAA8C;AACvD,UAAS,kDAAkD;AAC3D,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0DAA0D;AACnE,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,2DAA2D;AACpE,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0CAA0C;AACnD,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAqC,EAAE;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB;AACjB,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,aAAa;AACxB,cAAa,QAAQ,gCAAgC;AACrD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB;AACrB,kBAAiB;AACjB,cAAa;AACb;AACA;AACA,kBAAiB;AACjB;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK,IAAI;;AAET;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACrRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC1IA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,QAAQ,6BAA6B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;;AAEjB;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,UAAS;AACT;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G","file":"2.crypto-pro.js","sourcesContent":["var bowser = require('bowser/bowser');\nvar oids = require('./oids');\n\nvar subjectNameTagsTranslations = [\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\n issuerNameTagsTranslations = [\n {possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя'},\n {possibleNames: ['CN'], translation: 'Удостоверяющий центр'},\n {possibleNames: ['S'], translation: 'Регион'},\n {possibleNames: ['C'], 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\n/**\n * Парсит информацию из строки с информацией о сертификате\n * */\nfunction parseCertInfo(tags, infoString) {\n /**\n * Пример входной строки:\n *\n\n T=Генеральный директор, UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n STREET=\"Крыленко, д.3, лит.Б\", CN=Король Анатолий Евгеньевич, G=Анатолий Евгеньевич, SN=Король,\n OU=Администрация, O=\"ООО \"\"Аксиома\"\"\", L=Санкт-Петербург, S=78 г. Санкт-Петербург, C=RU, E=korol@sferasro.ru,\n INN=007811514257, OGRN=1127847087884, SNILS=11617693460\n\n * */\n var result = infoString.match(/([а-яА-Яa-zA-Z0-9\\.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (result) {\n result = result.map(function (group) {\n /**\n * Пример входной строки:\n *\n\n UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n\n * */\n var parts = group.match(/^([а-яА-Яa-zA-Z0-9\\.]+)=(.+?),?$/),\n title = parts && parts[1],\n descr = parts && parts[2],\n translated = false,\n oidTitle;\n\n // Если тайтл содержит ОИД, пытаемся расшифровать\n if (/^OID./.test(title)) {\n oidTitle = title.match(/^OID\\.(.*)/);\n\n if (oidTitle && oidTitle[1]) {\n oidTitle = oids[oidTitle[1]];\n\n if (oidTitle) {\n title = oidTitle;\n }\n }\n }\n\n // Вырезаем лишние кавычки\n descr = descr.replace(/^\"(.*)\"/, '$1');\n descr = descr.replace(/\"{2}/g, '\"');\n\n tags.some(function (tag) {\n return tag.possibleNames.some(function (possible) {\n var match = possible === title;\n\n if (match) {\n title = tag.translation;\n translated = true;\n }\n\n return match;\n });\n });\n\n return {\n title: title,\n descr: descr,\n translated: translated\n };\n });\n }\n\n return result;\n}\n\n/**\n * Возвращает дату в формате (dd.mm.yyyy hh:mm:ss) из строки, формата, используемого плагином cryptoPro\n * */\nfunction getReadableDate(date) {\n date = new Date(date);\n\n return ([\n date.getDate(),\n date.getMonth() + 1,\n date.getFullYear()\n ].join('.') + ' ' + [\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n ].join(':')).replace(/\\b(\\d)\\b/g, '0$1');\n}\n\n/**\n * Преобразует дату для IE\n * */\nfunction getDateObj(dateObj) {\n return bowser.msie ? dateObj.getVarDate() : dateObj;\n}\n\n/**\n * Подготавливает информацию о сертификатах\n * */\nfunction prepareCertsInfo(items) {\n return items.map(function (c) {\n c.name = c.subjectName.match(/CN=(.+?),/);\n\n // Удалось ли вытащить Common Name\n if (c.name && c.name[1]) {\n c.name = c.name[1];\n }\n\n c.validFrom = getReadableDate(c.validFrom);\n c.validTo = getReadableDate(c.validTo);\n\n c.label = c.name + ' (до ' + c.validTo + ')';\n\n return c;\n });\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы\n * */\nfunction getDecodedExtendedKeyUsage() {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n resolve(certOids.reduce(function (oidsLst, oid) {\n oid = {\n id: oid,\n descr: oids[oid] || null\n };\n\n if (oid.descr) {\n oidsLst.unshift(oid);\n } else {\n oidsLst.push(oid);\n }\n\n return oidsLst;\n }, []));\n });\n });\n}\n\n/**\n * Проверка наличия ОИД'а(ОИД'ов) у сертификата\n *\n * @param {String|Array} oids - ОИД'ы для проверки\n * @returns {Promise} с отложенным результатом типа {Boolean}\n * */\nfunction hasExtendedKeyUsage(oids) {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n var result;\n\n if (Array.isArray(oids)) {\n result = oids.every(function (oidToCheck) {\n return certOids.some(function (certOid) {\n return certOid === oidToCheck;\n });\n });\n } else {\n result = certOids.some(function (certOid) {\n return certOid === oids;\n });\n }\n\n resolve(result);\n });\n });\n}\n\n/**\n * Выводит информацию о системе пользователя\n * */\nfunction getEnvInfo() {\n var parsed = bowser._detect(navigator.userAgent),\n info = {\n browserName: parsed.name,\n browserVersion: parsed.version\n };\n\n if (parsed.mac) {\n info.os = 'Mac';\n } else if (parsed.windows) {\n info.os = 'Windows';\n } else if (parsed.linux) {\n info.os = 'Linux';\n }\n\n return info;\n}\n\n/**\n * Подходящая ли версия CSP\n * */\nfunction isValidCSPVersion(version) {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/);\n\n return version >= 3.6;\n}\n\n/**\n * Подходящая ли версия cades плагина\n * */\nfunction isValidCadesVersion(version) {\n version = version.split('.').reduce(function (verInfo, number, i) {\n if (i === 0) {\n verInfo.major = number;\n } else if (i === 1) {\n verInfo.minor = number;\n } else if (i === 2) {\n verInfo.patch = number;\n }\n\n return verInfo;\n }, {});\n\n if (version.major < 2) {\n return false;\n }\n\n return version.patch >= 12438;\n}\n\nmodule.exports = {\n subjectNameTagsTranslations: subjectNameTagsTranslations,\n issuerNameTagsTranslations: issuerNameTagsTranslations,\n parseCertInfo: parseCertInfo,\n getReadableDate: getReadableDate,\n getDateObj: getDateObj,\n prepareCertsInfo: prepareCertsInfo,\n getDecodedExtendedKeyUsage: getDecodedExtendedKeyUsage,\n hasExtendedKeyUsage: hasExtendedKeyUsage,\n getEnvInfo: getEnvInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./common.js\n ** module id = 5\n ** module chunks = 1 2\n **/","module.exports = {\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\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.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.6.2.1.7.2': 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.2.1.7.1': 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\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 '1.2.643.3.8.100.1.10': 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11': 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13': 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.6.3': 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.5.1.24.2.1.3': 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1': 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3': 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\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.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"'\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./oids.js\n ** module id = 6\n ** module chunks = 1 2\n **/","module.exports = {\n // CAPICOM_STORE_LOCATION enumeration\n StoreLocation: {\n CAPICOM_MEMORY_STORE: 0,\n CAPICOM_LOCAL_MACHINE_STORE: 1,\n CAPICOM_CURRENT_USER_STORE: 2,\n CAPICOM_ACTIVE_DIRECTORY_USER_STORE: 3,\n CAPICOM_SMART_CARD_USER_STORE: 4\n },\n // CAPICOM_STORE_OPEN_MODE enumeration\n StoreOpenMode: {\n CAPICOM_STORE_OPEN_READ_ONLY: 0,\n CAPICOM_STORE_OPEN_READ_WRITE: 1,\n CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED: 2,\n CAPICOM_STORE_OPEN_EXISTING_ONLY: 128,\n CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED: 256\n },\n // CAPICOM_CERTIFICATE_FIND_TYPE enumeration\n CertFindType: {\n CAPICOM_CERTIFICATE_FIND_SHA1_HASH: 0,\n CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME: 1,\n CAPICOM_CERTIFICATE_FIND_ISSUER_NAME: 2,\n CAPICOM_CERTIFICATE_FIND_ROOT_NAME: 3,\n CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME: 4,\n CAPICOM_CERTIFICATE_FIND_EXTENSION: 5,\n CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY: 6,\n CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY: 7,\n CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY: 8,\n CAPICOM_CERTIFICATE_FIND_TIME_VALID: 9,\n CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID: 10,\n CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED: 11,\n CAPICOM_CERTIFICATE_FIND_KEY_USAGE: 12\n },\n Time: {\n AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0\n },\n Check: {\n CHECK_NONE: 0,\n CHECK_TRUSTED_ROOT: 1,\n CHECK_TIME_VALIDITY: 2,\n CHECK_SIGNATURE_VALIDITY: 4,\n CHECK_ONLINE_REVOCATION_STATUS: 8,\n CHECK_OFFLINE_REVOCATION_STATUS: 16,\n TRUST_IS_NOT_TIME_VALID: 1,\n TRUST_IS_NOT_TIME_NESTED: 2,\n TRUST_IS_REVOKED: 4,\n TRUST_IS_NOT_SIGNATURE_VALID: 8,\n TRUST_IS_NOT_VALID_FOR_USAGE: 16,\n TRUST_IS_UNTRUSTED_ROOT: 32,\n TRUST_REVOCATION_STATUS_UNKNOWN: 64,\n TRUST_IS_CYCLIC: 128,\n TRUST_IS_PARTIAL_CHAIN: 65536,\n TRUST_CTL_IS_NOT_TIME_VALID: 131072,\n TRUST_CTL_IS_NOT_SIGNATURE_VALID: 262144,\n TRUST_CTL_IS_NOT_VALID_FOR_USAGE: 524288,\n },\n // CAPICOM_PROPID enumeration\n PropId: {\n CAPICOM_PROPID_UNKNOWN: 0,\n CAPICOM_PROPID_KEY_PROV_HANDLE: 1,\n CAPICOM_PROPID_KEY_PROV_INFO: 2,\n CAPICOM_PROPID_SHA1_HASH: 3,\n CAPICOM_PROPID_HASH_PROP: 3,\n CAPICOM_PROPID_MD5_HASH: 4,\n CAPICOM_PROPID_KEY_CONTEXT: 5,\n CAPICOM_PROPID_KEY_SPEC: 6,\n CAPICOM_PROPID_IE30_RESERVED: 7,\n CAPICOM_PROPID_PUBKEY_HASH_RESERVED: 8,\n CAPICOM_PROPID_ENHKEY_USAGE: 9,\n CAPICOM_PROPID_CTL_USAGE: 9,\n CAPICOM_PROPID_NEXT_UPDATE_LOCATION: 10,\n CAPICOM_PROPID_FRIENDLY_NAME: 11,\n CAPICOM_PROPID_PVK_FILE: 12,\n CAPICOM_PROPID_DESCRIPTION: 13,\n CAPICOM_PROPID_ACCESS_STATE: 14,\n CAPICOM_PROPID_SIGNATURE_HASH: 15,\n CAPICOM_PROPID_SMART_CARD_DATA: 16,\n CAPICOM_PROPID_EFS: 17,\n CAPICOM_PROPID_FORTEZZA_DATA: 18,\n CAPICOM_PROPID_ARCHIVED: 19,\n CAPICOM_PROPID_KEY_IDENTIFIER: 20,\n CAPICOM_PROPID_AUTO_ENROLL: 21,\n CAPICOM_PROPID_PUBKEY_ALG_PARA: 22,\n CAPICOM_PROPID_CROSS_CERT_DIST_POINTS: 23,\n CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH: 24,\n CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH: 25,\n CAPICOM_PROPID_ENROLLMENT: 26,\n CAPICOM_PROPID_DATE_STAMP: 27,\n CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH: 28,\n CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH: 29,\n CAPICOM_PROPID_EXTENDED_ERROR_INFO: 30,\n CAPICOM_PROPID_RENEWAL: 64,\n CAPICOM_PROPID_ARCHIVED_KEY_HASH: 65,\n CAPICOM_PROPID_FIRST_RESERVED: 66,\n CAPICOM_PROPID_LAST_RESERVED: 0x00007FFF,\n CAPICOM_PROPID_FIRST_USER: 0x00008000,\n CAPICOM_PROPID_LAST_USER: 0x0000FFFF\n },\n // CADESCOM_XML_SIGNATURE_TYPE enumeration\n SignatureType: {\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED: 0,\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING: 1,\n CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE: 2\n },\n // CADESCOM_HASH_ALGORITHM enumeration\n HashAlgorithm: {\n CADESCOM_HASH_ALGORITHM_CP_GOST_3411: 100,\n CADESCOM_HASH_ALGORITHM_MD2: 1,\n CADESCOM_HASH_ALGORITHM_MD4: 2,\n CADESCOM_HASH_ALGORITHM_MD5: 3,\n CADESCOM_HASH_ALGORITHM_SHA_256: 4,\n CADESCOM_HASH_ALGORITHM_SHA_384: 5,\n CADESCOM_HASH_ALGORITHM_SHA_512: 6,\n CADESCOM_HASH_ALGORITHM_SHA1: 0\n },\n CadesType: {\n CADESCOM_CADES_DEFAULT: 0,\n CADESCOM_CADES_BES: 1,\n CADESCOM_CADES_X_LONG_TYPE_1: 0x5d\n },\n ContentEncoding: {\n CADESCOM_BASE64_TO_BINARY: 0x01,\n CADESCOM_STRING_TO_UCS2LE: 0x00\n },\n StoreNames: {\n CAPICOM_MY_STORE: 'My'\n },\n Chain: {\n CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT: 0,\n CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN: 1,\n CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY: 2\n },\n GostXmlDSigUrls: {\n XmlDsigGost3410Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411',\n XmlDsigGost3411Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411',\n XmlDsigGost3410UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411',\n XmlDsigGost3411UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr3411'\n }\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./constants.js\n ** module id = 7\n ** module chunks = 1 2\n **/","var cryptoCommon = require('./common'),\n cryptoConstants = require('./constants'),\n _certListCache;\n\nfunction Certificate(item) {\n this._cert = item._cert;\n this.thumbprint = item.thumbprint;\n this.subjectName = item.subjectName;\n this.issuerName = item.issuerName;\n this.validFrom = item.validFrom;\n this.validTo = item.validTo;\n}\n\n/**\n * Проверяет, валиден ли сертификат\n * */\nCertificate.prototype.isValid = function isValid() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var result;\n\n try {\n result = cert.IsValid();\n result = result.Result;\n } catch (err) {\n reject('Ошибка при проверке сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n};\n\n/**\n * Достает указанное свойство у сертификата\n * */\nCertificate.prototype.getProp = function (propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var result;\n\n try {\n result = cert[propName];\n } catch (err) {\n reject('Ошибка при обращении к свойству сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n};\n\n/**\n * Экспорт base64 представления сертификата пользователя\n * */\nCertificate.prototype.exportBase64 = function exportBase64() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var base64;\n\n try {\n base64 = cert.Export(0);\n } catch (err) {\n reject('Ошибка при экспорте сертификата: ', err.message);\n return;\n }\n\n resolve(base64);\n });\n};\n\n/**\n * Возвращает информацию об алгоритме\n * */\nCertificate.prototype.getAlgorithm = function getAlgorithm() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var result = {},\n algorithm;\n\n try {\n algorithm = cert.PublicKey();\n algorithm = algorithm.Algorithm;\n\n result.algorithm = algorithm.FriendlyName;\n result.oid = algorithm.Value;\n } catch (err) {\n reject('Ошибка при получении алгоритма: ', err.message);\n return;\n }\n\n resolve(result);\n });\n};\n\n/**\n * Разбирает SubjectName сертификата по тэгам\n * */\nCertificate.prototype.getOwnerInfo = function getOwnerInfo() {\n return getCertInfo.call(this, cryptoCommon.subjectNameTagsTranslations, 'SubjectName');\n};\n\n/**\n * Разбирает IssuerName сертификата по тэгам\n * */\nCertificate.prototype.getIssuerInfo = function getIssuerInfo() {\n return getCertInfo.call(this, cryptoCommon.issuerNameTagsTranslations, 'IssuerName');\n};\n\n/**\n * Получение OID сертификата\n * Возвращает массив OID (улучшенного ключа)\n * */\nCertificate.prototype.getExtendedKeyUsage = function getExtendedKeyUsage() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var OIDS = [],\n count,\n item;\n\n try {\n count = cert.ExtendedKeyUsage();\n count = count.EKUs;\n count = count.Count;\n\n if (count > 0) {\n while (count > 0) {\n item = cert.ExtendedKeyUsage();\n item = item.EKUs;\n item = item.Item(count);\n item = item.OID;\n\n OIDS.push(item);\n\n count--;\n }\n }\n } catch (err) {\n reject('Ошибка при получении ОИД\\'ов: ', err.message);\n return;\n }\n\n resolve(OIDS);\n });\n};\n\nCertificate.prototype.getDecodedExtendedKeyUsage = cryptoCommon.getDecodedExtendedKeyUsage;\n\nCertificate.prototype.hasExtendedKeyUsage = cryptoCommon.hasExtendedKeyUsage;\n\n/**\n * Проверяет корректность настроек ЭП на машине\n * */\nfunction isValidEDSSettings() {\n return new Promise(function (resolve, reject) {\n var result;\n\n try {\n result = cadesplugin.CreateObject('CAdESCOM.About');\n } catch (error) {\n reject('Настройки ЭП на данной машине не верны');\n }\n\n resolve();\n });\n}\n\n/**\n * Получить сертификат в формате cades по хэшу\n * */\nfunction getCadesCert(hash) {\n return new Promise(function (resolve, reject) {\n var oStore = cadesplugin.CreateObject('CAdESCOM.Store'),\n certs,\n certCnt,\n cert;\n\n if (!oStore) {\n reject('Не удалось получить доступ к хранилищу сертификатов');\n return;\n }\n\n // Открываем хранилище\n try {\n oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = oStore.Certificates;\n certCnt = certs.Count;\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!certCnt) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n // Получаем сертификат по хэшу\n try {\n certs = certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, hash);\n\n if (certs.Count) {\n cert = certs.Item(1);\n } else {\n throw new Error(hash);\n }\n } catch (err) {\n reject('Не удалось получить сертификат по хэшу: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n resolve(cert);\n });\n}\n\n/**\n * Разбирает информацию сертификата по тэгам\n * */\nfunction getCertInfo(tags, propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var propInfo;\n\n try {\n propInfo = cert[propName];\n } catch (err) {\n reject('Ошибка при извлечении данных из сертификата: ', err.message);\n return;\n }\n\n resolve(cryptoCommon.parseCertInfo(tags, propInfo));\n });\n}\n\n/**\n * Возвращает список сертификатов, доступных в системе\n *\n * @param {Boolean} [resetCache=false] -- нужно ли сбросить кэш списка сертификатов\n * @returns {Promise} -- со списком сертификатов {Array}\n * */\nfunction getCertsList(resetCache) {\n return new Promise(function (resolve, reject) {\n if (!resetCache && _certListCache) {\n resolve(_certListCache);\n return;\n }\n\n var oStore = cadesplugin.CreateObject('CAdESCOM.Store'),\n result = [],\n certs,\n count,\n item;\n\n // Открываем хранилище\n try {\n oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = oStore.Certificates;\n\n if (certs) {\n certs = certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n * */\n certs = certs.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n cryptoConstants.PropId.CAPICOM_PROPID_KEY_PROV_INFO\n );\n\n count = certs.Count;\n }\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!count) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n try {\n while (count) {\n item = certs.Item(count);\n\n result.push(new Certificate({\n _cert: item,\n thumbprint: item.Thumbprint,\n subjectName: item.SubjectName,\n issuerName: item.IssuerName,\n validFrom: item.ValidFromDate,\n validTo: item.ValidToDate\n }));\n\n count--;\n }\n } catch (err) {\n reject('Ошибка обработки сертификатов: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n _certListCache = cryptoCommon.prepareCertsInfo(result);\n\n resolve(_certListCache);\n });\n}\n\n/**\n * Получить сертификат по хэшу\n * */\nfunction getCert(hash) {\n return new Promise(function (resolve, reject) {\n if (!hash) {\n reject('Хэш не указан');\n return;\n }\n\n getCertsList().then(function (list) {\n var foundCert;\n\n list.some(function (cert) {\n if (hash === cert.thumbprint) {\n foundCert = cert;\n return true;\n }\n });\n\n if (foundCert) {\n resolve(foundCert);\n } else {\n reject('Сертификат с хэшем: \"' + hash + '\" не найден');\n }\n }, reject);\n });\n}\n\n/**\n * Создает подпись base64 строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataBase64 -- строковые данные в формате base64\n * @param {Boolean} signType -- тип подписи открепленная (true) / присоединенная (false) (default: true)\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signData(hash, dataBase64, signType) {\n signType = typeof signType === 'undefined' ? true : Boolean(signType);\n\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n var clientTime = new Date(),\n oAttrs = cadesplugin.CreateObject('CADESCOM.CPAttribute'),\n oSignedData = cadesplugin.CreateObject('CAdESCOM.CadesSignedData'),\n oSigner = cadesplugin.CreateObject('CAdESCOM.CPSigner'),\n attrs,\n signature;\n\n clientTime = cryptoCommon.getDateObj(clientTime);\n\n try {\n oAttrs.Name = cryptoConstants.Time.AUTHENTICATED_ATTRIBUTE_SIGNING_TIME;\n oAttrs.Value = clientTime;\n } catch (err) {\n reject('Ошибка при установке данных подписи: ' + err.message);\n return;\n }\n\n // Задаем настройки для подписи\n try {\n oSigner.Certificate = cert;\n attrs = oSigner.AuthenticatedAttributes2;\n attrs.Add(oAttrs);\n oSignedData.ContentEncoding = cadesplugin.CADESCOM_BASE64_TO_BINARY;\n oSignedData.Content = dataBase64;\n oSigner.Options = cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY;\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = oSignedData.SignCades(\n oSigner,\n cadesplugin.CADESCOM_CADES_BES,\n signType\n );\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n }, reject);\n });\n}\n\n/**\n * Создает подпись XML строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataXML -- данные в формате XML\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signDataXML(hash, dataXML) {\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n var oSigner = cadesplugin.CreateObject('CAdESCOM.CPSigner'),\n signerXML = cadesplugin.CreateObject('CAdESCOM.SignedXML'),\n cnts = cryptoConstants,\n signature;\n\n // Задаем настройки для подписи\n try {\n oSigner.Certificate = cert;\n // Добавляем данные для подписи\n signerXML.Content = dataXML;\n // Устанавливаем тип подписи\n signerXML.SignatureType = cnts.SignatureType.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED;\n // Устанавливаем алгоритм подписи\n signerXML.SignatureMethod = cnts.GostXmlDSigUrls.XmlDsigGost3410Url;\n // Устанавливаем алгоритм хэширования\n signerXML.DigestMethod = cnts.GostXmlDSigUrls.XmlDsigGost3411Url;\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = signerXML.Sign(oSigner);\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n }, reject);\n });\n}\n\n/**\n * Возвращает информацию о версии CSP и плагина\n * */\nfunction getSystemInfo() {\n var sysInfo = cryptoCommon.getEnvInfo();\n\n return new Promise(function (resolve, reject) {\n var e;\n\n try {\n e = cadesplugin.CreateObject('CAdESCOM.About');\n\n sysInfo.cadesVersion = e.PluginVersion;\n // Возможен вызов в ранних версиях в виде sysInfo.cspVersion = e.CSPVersion('', 75);\n sysInfo.cspVersion = e.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = e.Version;\n }\n\n sysInfo.cadesVersion = sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = sysInfo.cspVersion.toString();\n\n resolve(sysInfo);\n } catch (err) {\n reject('Ошибка при получении информации о системе: ', err.message);\n }\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии CSP\n * */\nfunction isValidCSPVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCSPVersion(version));\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии плагина\n * */\nfunction isValidCadesVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCadesVersion(version));\n });\n}\n\nmodule.exports = {\n isValidEDSSettings: isValidEDSSettings,\n getCertsList: getCertsList,\n getCert: getCert,\n signData: signData,\n signDataXML: signDataXML,\n getSystemInfo: getSystemInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./apiSync.js\n ** module id = 8\n ** module chunks = 2\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./common.js?fc46","webpack:///./oids.js?7c42","webpack:///./constants.js?532c","webpack:///./apiSync.js"],"names":[],"mappings":";;;;;;;;;AAAA;AACA;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,+CAA+C;AACxD,UAAS,8CAA8C;AACvD,UAAS,kDAAkD;AAC3D,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0DAA0D;AACnE,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA,UAAS,4EAA4E;AACrF,UAAS,2DAA2D;AACpE,UAAS,4CAA4C;AACrD,UAAS,4CAA4C;AACrD,UAAS,gDAAgD;AACzD,UAAS,8CAA8C;AACvD,UAAS,0CAA0C;AACnD,UAAS,+CAA+C;AACxD,UAAS,qDAAqD;AAC9D,UAAS,2DAA2D;AACpE,UAAS,wDAAwD;AACjE,UAAS,kDAAkD;AAC3D,UAAS,2CAA2C;AACpD,UAAS;AACT;;AAEA;AACA;AACA,8FAA6F;;AAE7F;;AAEA;;AAEA,wC;;AAEA,+BAA8B,WAAW;;AAEzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sCAAqC,EAAE;;AAEvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,kBAAiB;AACjB,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;;AAEA;AACA,cAAa;AACb,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,aAAa;AACxB,cAAa,QAAQ,gCAAgC;AACrD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAqB;AACrB,kBAAiB;AACjB,cAAa;AACb;AACA;AACA,kBAAiB;AACjB;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK,IAAI;;AAET;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC1IA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAuB;AACvB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,QAAQ,6BAA6B;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;;AAEjB;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;;AAEb;AACA;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,QAAQ,wDAAwD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,UAAS;AACT;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G","file":"2.crypto-pro.js","sourcesContent":["var bowser = require('bowser/bowser');\nvar oids = require('./oids');\n\nvar subjectNameTagsTranslations = [\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\n issuerNameTagsTranslations = [\n {possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя'},\n {possibleNames: ['CN'], translation: 'Удостоверяющий центр'},\n {possibleNames: ['S'], translation: 'Регион'},\n {possibleNames: ['C'], 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\nfunction execute(cb) {\n if (cadesplugin.CreateObjectAsync) {\n var GeneratorFunction = (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))();\n \n cb = String(cb);\n \n var args = cb.match(/^function\\s*?\\((.*?)\\)/);\n \n args = (args && args[1]) || ''; \n \n cb = cb.replace(/^.*?{([\\s\\S]*?)}$/, '$1');\n \n cadesplugin.async_spawn(new GeneratorFunction(args, cb));\n }\n}\n\nfunction createObj(type) {\n if (cadesplugin.CreateObjectAsync) {\n return (new Function('', 'return yield cadesplugin.CreateObjectAsync(' + type + ')'))();\n }\n}\n\n/**\n * Парсит информацию из строки с информацией о сертификате\n * */\nfunction parseCertInfo(tags, infoString) {\n /**\n * Пример входной строки:\n *\n\n T=Генеральный директор, UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n STREET=\"Крыленко, д.3, лит.Б\", CN=Король Анатолий Евгеньевич, G=Анатолий Евгеньевич, SN=Король,\n OU=Администрация, O=\"ООО \"\"Аксиома\"\"\", L=Санкт-Петербург, S=78 г. Санкт-Петербург, C=RU, E=korol@sferasro.ru,\n INN=007811514257, OGRN=1127847087884, SNILS=11617693460\n\n * */\n var result = infoString.match(/([а-яА-Яa-zA-Z0-9\\.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (result) {\n result = result.map(function (group) {\n /**\n * Пример входной строки:\n *\n\n UnstructuredName=\"INN=7811514257/KPP=781101001/OGRN=1127847087884\",\n\n * */\n var parts = group.match(/^([а-яА-Яa-zA-Z0-9\\.]+)=(.+?),?$/),\n title = parts && parts[1],\n descr = parts && parts[2],\n translated = false,\n oidTitle;\n\n // Если тайтл содержит ОИД, пытаемся расшифровать\n if (/^OID./.test(title)) {\n oidTitle = title.match(/^OID\\.(.*)/);\n\n if (oidTitle && oidTitle[1]) {\n oidTitle = oids[oidTitle[1]];\n\n if (oidTitle) {\n title = oidTitle;\n }\n }\n }\n\n // Вырезаем лишние кавычки\n descr = descr.replace(/^\"(.*)\"/, '$1');\n descr = descr.replace(/\"{2}/g, '\"');\n\n tags.some(function (tag) {\n return tag.possibleNames.some(function (possible) {\n var match = possible === title;\n\n if (match) {\n title = tag.translation;\n translated = true;\n }\n\n return match;\n });\n });\n\n return {\n title: title,\n descr: descr,\n translated: translated\n };\n });\n }\n\n return result;\n}\n\n/**\n * Возвращает дату в формате (dd.mm.yyyy hh:mm:ss) из строки, формата, используемого плагином cryptoPro\n * */\nfunction getReadableDate(date) {\n date = new Date(date);\n\n return ([\n date.getDate(),\n date.getMonth() + 1,\n date.getFullYear()\n ].join('.') + ' ' + [\n date.getHours(),\n date.getMinutes(),\n date.getSeconds()\n ].join(':')).replace(/\\b(\\d)\\b/g, '0$1');\n}\n\n/**\n * Преобразует дату для IE\n * */\nfunction getDateObj(dateObj) {\n return bowser.msie ? dateObj.getVarDate() : dateObj;\n}\n\n/**\n * Подготавливает информацию о сертификатах\n * */\nfunction prepareCertsInfo(items) {\n return items.map(function (c) {\n c.name = c.subjectName.match(/CN=(.+?),/);\n\n // Удалось ли вытащить Common Name\n if (c.name && c.name[1]) {\n c.name = c.name[1];\n }\n\n c.validFrom = getReadableDate(c.validFrom);\n c.validTo = getReadableDate(c.validTo);\n\n c.label = c.name + ' (до ' + c.validTo + ')';\n\n return c;\n });\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы\n * */\nfunction getDecodedExtendedKeyUsage() {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n resolve(certOids.reduce(function (oidsLst, oid) {\n oid = {\n id: oid,\n descr: oids[oid] || null\n };\n\n if (oid.descr) {\n oidsLst.unshift(oid);\n } else {\n oidsLst.push(oid);\n }\n\n return oidsLst;\n }, []));\n });\n });\n}\n\n/**\n * Проверка наличия ОИД'а(ОИД'ов) у сертификата\n *\n * @param {String|Array} oids - ОИД'ы для проверки\n * @returns {Promise} с отложенным результатом типа {Boolean}\n * */\nfunction hasExtendedKeyUsage(oids) {\n var that = this;\n\n return new Promise(function (resolve) {\n that.getExtendedKeyUsage().then(function (certOids) {\n var result;\n\n if (Array.isArray(oids)) {\n result = oids.every(function (oidToCheck) {\n return certOids.some(function (certOid) {\n return certOid === oidToCheck;\n });\n });\n } else {\n result = certOids.some(function (certOid) {\n return certOid === oids;\n });\n }\n\n resolve(result);\n });\n });\n}\n\n/**\n * Выводит информацию о системе пользователя\n * */\nfunction getEnvInfo() {\n var parsed = bowser._detect(navigator.userAgent),\n info = {\n browserName: parsed.name,\n browserVersion: parsed.version\n };\n\n if (parsed.mac) {\n info.os = 'Mac';\n } else if (parsed.windows) {\n info.os = 'Windows';\n } else if (parsed.linux) {\n info.os = 'Linux';\n }\n\n return info;\n}\n\n/**\n * Подходящая ли версия CSP\n * */\nfunction isValidCSPVersion(version) {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/);\n\n return version >= 3.6;\n}\n\n/**\n * Подходящая ли версия cades плагина\n * */\nfunction isValidCadesVersion(version) {\n version = version.split('.').reduce(function (verInfo, number, i) {\n if (i === 0) {\n verInfo.major = number;\n } else if (i === 1) {\n verInfo.minor = number;\n } else if (i === 2) {\n verInfo.patch = number;\n }\n\n return verInfo;\n }, {});\n\n if (version.major < 2) {\n return false;\n }\n\n return version.patch >= 12438;\n}\n\nmodule.exports = {\n execute: execute,\n createObj: createObj,\n subjectNameTagsTranslations: subjectNameTagsTranslations,\n issuerNameTagsTranslations: issuerNameTagsTranslations,\n parseCertInfo: parseCertInfo,\n getReadableDate: getReadableDate,\n getDateObj: getDateObj,\n prepareCertsInfo: prepareCertsInfo,\n getDecodedExtendedKeyUsage: getDecodedExtendedKeyUsage,\n hasExtendedKeyUsage: hasExtendedKeyUsage,\n getEnvInfo: getEnvInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./common.js\n ** module id = 5\n ** module chunks = 1 2\n **/","module.exports = {\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\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.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.6.2.1.7.2': 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.2.1.7.1': 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\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 '1.2.643.3.8.100.1.10': 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11': 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13': 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.6.3': 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.5.1.24.2.1.3': 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1': 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3': 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\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.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"'\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./oids.js\n ** module id = 6\n ** module chunks = 1 2\n **/","module.exports = {\n // CAPICOM_STORE_LOCATION enumeration\n StoreLocation: {\n CAPICOM_MEMORY_STORE: 0,\n CAPICOM_LOCAL_MACHINE_STORE: 1,\n CAPICOM_CURRENT_USER_STORE: 2,\n CAPICOM_ACTIVE_DIRECTORY_USER_STORE: 3,\n CAPICOM_SMART_CARD_USER_STORE: 4\n },\n // CAPICOM_STORE_OPEN_MODE enumeration\n StoreOpenMode: {\n CAPICOM_STORE_OPEN_READ_ONLY: 0,\n CAPICOM_STORE_OPEN_READ_WRITE: 1,\n CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED: 2,\n CAPICOM_STORE_OPEN_EXISTING_ONLY: 128,\n CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED: 256\n },\n // CAPICOM_CERTIFICATE_FIND_TYPE enumeration\n CertFindType: {\n CAPICOM_CERTIFICATE_FIND_SHA1_HASH: 0,\n CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME: 1,\n CAPICOM_CERTIFICATE_FIND_ISSUER_NAME: 2,\n CAPICOM_CERTIFICATE_FIND_ROOT_NAME: 3,\n CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME: 4,\n CAPICOM_CERTIFICATE_FIND_EXTENSION: 5,\n CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY: 6,\n CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY: 7,\n CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY: 8,\n CAPICOM_CERTIFICATE_FIND_TIME_VALID: 9,\n CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID: 10,\n CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED: 11,\n CAPICOM_CERTIFICATE_FIND_KEY_USAGE: 12\n },\n Time: {\n AUTHENTICATED_ATTRIBUTE_SIGNING_TIME: 0\n },\n Check: {\n CHECK_NONE: 0,\n CHECK_TRUSTED_ROOT: 1,\n CHECK_TIME_VALIDITY: 2,\n CHECK_SIGNATURE_VALIDITY: 4,\n CHECK_ONLINE_REVOCATION_STATUS: 8,\n CHECK_OFFLINE_REVOCATION_STATUS: 16,\n TRUST_IS_NOT_TIME_VALID: 1,\n TRUST_IS_NOT_TIME_NESTED: 2,\n TRUST_IS_REVOKED: 4,\n TRUST_IS_NOT_SIGNATURE_VALID: 8,\n TRUST_IS_NOT_VALID_FOR_USAGE: 16,\n TRUST_IS_UNTRUSTED_ROOT: 32,\n TRUST_REVOCATION_STATUS_UNKNOWN: 64,\n TRUST_IS_CYCLIC: 128,\n TRUST_IS_PARTIAL_CHAIN: 65536,\n TRUST_CTL_IS_NOT_TIME_VALID: 131072,\n TRUST_CTL_IS_NOT_SIGNATURE_VALID: 262144,\n TRUST_CTL_IS_NOT_VALID_FOR_USAGE: 524288,\n },\n // CAPICOM_PROPID enumeration\n PropId: {\n CAPICOM_PROPID_UNKNOWN: 0,\n CAPICOM_PROPID_KEY_PROV_HANDLE: 1,\n CAPICOM_PROPID_KEY_PROV_INFO: 2,\n CAPICOM_PROPID_SHA1_HASH: 3,\n CAPICOM_PROPID_HASH_PROP: 3,\n CAPICOM_PROPID_MD5_HASH: 4,\n CAPICOM_PROPID_KEY_CONTEXT: 5,\n CAPICOM_PROPID_KEY_SPEC: 6,\n CAPICOM_PROPID_IE30_RESERVED: 7,\n CAPICOM_PROPID_PUBKEY_HASH_RESERVED: 8,\n CAPICOM_PROPID_ENHKEY_USAGE: 9,\n CAPICOM_PROPID_CTL_USAGE: 9,\n CAPICOM_PROPID_NEXT_UPDATE_LOCATION: 10,\n CAPICOM_PROPID_FRIENDLY_NAME: 11,\n CAPICOM_PROPID_PVK_FILE: 12,\n CAPICOM_PROPID_DESCRIPTION: 13,\n CAPICOM_PROPID_ACCESS_STATE: 14,\n CAPICOM_PROPID_SIGNATURE_HASH: 15,\n CAPICOM_PROPID_SMART_CARD_DATA: 16,\n CAPICOM_PROPID_EFS: 17,\n CAPICOM_PROPID_FORTEZZA_DATA: 18,\n CAPICOM_PROPID_ARCHIVED: 19,\n CAPICOM_PROPID_KEY_IDENTIFIER: 20,\n CAPICOM_PROPID_AUTO_ENROLL: 21,\n CAPICOM_PROPID_PUBKEY_ALG_PARA: 22,\n CAPICOM_PROPID_CROSS_CERT_DIST_POINTS: 23,\n CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH: 24,\n CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH: 25,\n CAPICOM_PROPID_ENROLLMENT: 26,\n CAPICOM_PROPID_DATE_STAMP: 27,\n CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH: 28,\n CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH: 29,\n CAPICOM_PROPID_EXTENDED_ERROR_INFO: 30,\n CAPICOM_PROPID_RENEWAL: 64,\n CAPICOM_PROPID_ARCHIVED_KEY_HASH: 65,\n CAPICOM_PROPID_FIRST_RESERVED: 66,\n CAPICOM_PROPID_LAST_RESERVED: 0x00007FFF,\n CAPICOM_PROPID_FIRST_USER: 0x00008000,\n CAPICOM_PROPID_LAST_USER: 0x0000FFFF\n },\n // CADESCOM_XML_SIGNATURE_TYPE enumeration\n SignatureType: {\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED: 0,\n CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING: 1,\n CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE: 2\n },\n // CADESCOM_HASH_ALGORITHM enumeration\n HashAlgorithm: {\n CADESCOM_HASH_ALGORITHM_CP_GOST_3411: 100,\n CADESCOM_HASH_ALGORITHM_MD2: 1,\n CADESCOM_HASH_ALGORITHM_MD4: 2,\n CADESCOM_HASH_ALGORITHM_MD5: 3,\n CADESCOM_HASH_ALGORITHM_SHA_256: 4,\n CADESCOM_HASH_ALGORITHM_SHA_384: 5,\n CADESCOM_HASH_ALGORITHM_SHA_512: 6,\n CADESCOM_HASH_ALGORITHM_SHA1: 0\n },\n CadesType: {\n CADESCOM_CADES_DEFAULT: 0,\n CADESCOM_CADES_BES: 1,\n CADESCOM_CADES_X_LONG_TYPE_1: 0x5d\n },\n ContentEncoding: {\n CADESCOM_BASE64_TO_BINARY: 0x01,\n CADESCOM_STRING_TO_UCS2LE: 0x00\n },\n StoreNames: {\n CAPICOM_MY_STORE: 'My'\n },\n Chain: {\n CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT: 0,\n CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN: 1,\n CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY: 2\n },\n GostXmlDSigUrls: {\n XmlDsigGost3410Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411',\n XmlDsigGost3411Url: 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411',\n XmlDsigGost3410UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411',\n XmlDsigGost3411UrlObsolete: 'http://www.w3.org/2001/04/xmldsig-more#gostr3411'\n }\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./constants.js\n ** module id = 7\n ** module chunks = 1 2\n **/","var cryptoCommon = require('./common'),\n cryptoConstants = require('./constants'),\n _certListCache;\n\nfunction Certificate(item) {\n this._cert = item._cert;\n this.thumbprint = item.thumbprint;\n this.subjectName = item.subjectName;\n this.issuerName = item.issuerName;\n this.validFrom = item.validFrom;\n this.validTo = item.validTo;\n}\n\n/**\n * Проверяет, валиден ли сертификат\n * */\nCertificate.prototype.isValid = function isValid() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var result;\n\n try {\n result = cert.IsValid();\n result = result.Result;\n } catch (err) {\n reject('Ошибка при проверке сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n};\n\n/**\n * Достает указанное свойство у сертификата\n * */\nCertificate.prototype.getProp = function (propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var result;\n\n try {\n result = cert[propName];\n } catch (err) {\n reject('Ошибка при обращении к свойству сертификата: ', err.message);\n return;\n }\n\n resolve(result);\n });\n};\n\n/**\n * Экспорт base64 представления сертификата пользователя\n * */\nCertificate.prototype.exportBase64 = function exportBase64() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var base64;\n\n try {\n base64 = cert.Export(0);\n } catch (err) {\n reject('Ошибка при экспорте сертификата: ', err.message);\n return;\n }\n\n resolve(base64);\n });\n};\n\n/**\n * Возвращает информацию об алгоритме\n * */\nCertificate.prototype.getAlgorithm = function getAlgorithm() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var result = {},\n algorithm;\n\n try {\n algorithm = cert.PublicKey();\n algorithm = algorithm.Algorithm;\n\n result.algorithm = algorithm.FriendlyName;\n result.oid = algorithm.Value;\n } catch (err) {\n reject('Ошибка при получении алгоритма: ', err.message);\n return;\n }\n\n resolve(result);\n });\n};\n\n/**\n * Разбирает SubjectName сертификата по тэгам\n * */\nCertificate.prototype.getOwnerInfo = function getOwnerInfo() {\n return getCertInfo.call(this, cryptoCommon.subjectNameTagsTranslations, 'SubjectName');\n};\n\n/**\n * Разбирает IssuerName сертификата по тэгам\n * */\nCertificate.prototype.getIssuerInfo = function getIssuerInfo() {\n return getCertInfo.call(this, cryptoCommon.issuerNameTagsTranslations, 'IssuerName');\n};\n\n/**\n * Получение OID сертификата\n * Возвращает массив OID (улучшенного ключа)\n * */\nCertificate.prototype.getExtendedKeyUsage = function getExtendedKeyUsage() {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var OIDS = [],\n count,\n item;\n\n try {\n count = cert.ExtendedKeyUsage();\n count = count.EKUs;\n count = count.Count;\n\n if (count > 0) {\n while (count > 0) {\n item = cert.ExtendedKeyUsage();\n item = item.EKUs;\n item = item.Item(count);\n item = item.OID;\n\n OIDS.push(item);\n\n count--;\n }\n }\n } catch (err) {\n reject('Ошибка при получении ОИД\\'ов: ', err.message);\n return;\n }\n\n resolve(OIDS);\n });\n};\n\nCertificate.prototype.getDecodedExtendedKeyUsage = cryptoCommon.getDecodedExtendedKeyUsage;\n\nCertificate.prototype.hasExtendedKeyUsage = cryptoCommon.hasExtendedKeyUsage;\n\n/**\n * Проверяет корректность настроек ЭП на машине\n * */\nfunction isValidEDSSettings() {\n return new Promise(function (resolve, reject) {\n var result;\n\n try {\n result = cadesplugin.CreateObject('CAdESCOM.About');\n } catch (error) {\n reject('Настройки ЭП на данной машине не верны');\n }\n\n resolve();\n });\n}\n\n/**\n * Получить сертификат в формате cades по хэшу\n * */\nfunction getCadesCert(hash) {\n return new Promise(function (resolve, reject) {\n var oStore = cadesplugin.CreateObject('CAdESCOM.Store'),\n certs,\n certCnt,\n cert;\n\n if (!oStore) {\n reject('Не удалось получить доступ к хранилищу сертификатов');\n return;\n }\n\n // Открываем хранилище\n try {\n oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = oStore.Certificates;\n certCnt = certs.Count;\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!certCnt) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n // Получаем сертификат по хэшу\n try {\n certs = certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, hash);\n\n if (certs.Count) {\n cert = certs.Item(1);\n } else {\n throw new Error(hash);\n }\n } catch (err) {\n reject('Не удалось получить сертификат по хэшу: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n resolve(cert);\n });\n}\n\n/**\n * Разбирает информацию сертификата по тэгам\n * */\nfunction getCertInfo(tags, propName) {\n var cert = this._cert;\n\n return new Promise(function (resolve, reject) {\n var propInfo;\n\n try {\n propInfo = cert[propName];\n } catch (err) {\n reject('Ошибка при извлечении данных из сертификата: ', err.message);\n return;\n }\n\n resolve(cryptoCommon.parseCertInfo(tags, propInfo));\n });\n}\n\n/**\n * Возвращает список сертификатов, доступных в системе\n *\n * @param {Boolean} [resetCache=false] -- нужно ли сбросить кэш списка сертификатов\n * @returns {Promise} -- со списком сертификатов {Array}\n * */\nfunction getCertsList(resetCache) {\n return new Promise(function (resolve, reject) {\n if (!resetCache && _certListCache) {\n resolve(_certListCache);\n return;\n }\n\n var oStore = cadesplugin.CreateObject('CAdESCOM.Store'),\n result = [],\n certs,\n count,\n item;\n\n // Открываем хранилище\n try {\n oStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED\n );\n } catch (err) {\n reject('Ошибка при открытии хранилища: ' + err.message);\n return;\n }\n\n // Получаем доступ к сертификатам\n try {\n certs = oStore.Certificates;\n\n if (certs) {\n certs = certs.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n * */\n certs = certs.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n cryptoConstants.PropId.CAPICOM_PROPID_KEY_PROV_INFO\n );\n\n count = certs.Count;\n }\n } catch (err) {\n reject('Ошибка получения списка сертификатов: ' + err.message);\n return;\n }\n\n if (!count) {\n reject('Нет доступных сертификатов');\n return;\n }\n\n try {\n while (count) {\n item = certs.Item(count);\n\n result.push(new Certificate({\n _cert: item,\n thumbprint: item.Thumbprint,\n subjectName: item.SubjectName,\n issuerName: item.IssuerName,\n validFrom: item.ValidFromDate,\n validTo: item.ValidToDate\n }));\n\n count--;\n }\n } catch (err) {\n reject('Ошибка обработки сертификатов: ' + err.message);\n return;\n }\n\n oStore.Close();\n\n _certListCache = cryptoCommon.prepareCertsInfo(result);\n\n resolve(_certListCache);\n });\n}\n\n/**\n * Получить сертификат по хэшу\n * */\nfunction getCert(hash) {\n return new Promise(function (resolve, reject) {\n if (!hash) {\n reject('Хэш не указан');\n return;\n }\n\n getCertsList().then(function (list) {\n var foundCert;\n\n list.some(function (cert) {\n if (hash === cert.thumbprint) {\n foundCert = cert;\n return true;\n }\n });\n\n if (foundCert) {\n resolve(foundCert);\n } else {\n reject('Сертификат с хэшем: \"' + hash + '\" не найден');\n }\n }, reject);\n });\n}\n\n/**\n * Создает подпись base64 строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataBase64 -- строковые данные в формате base64\n * @param {Boolean} signType -- тип подписи открепленная (true) / присоединенная (false) (default: true)\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signData(hash, dataBase64, signType) {\n signType = typeof signType === 'undefined' ? true : Boolean(signType);\n\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n var clientTime = new Date(),\n oAttrs = cadesplugin.CreateObject('CADESCOM.CPAttribute'),\n oSignedData = cadesplugin.CreateObject('CAdESCOM.CadesSignedData'),\n oSigner = cadesplugin.CreateObject('CAdESCOM.CPSigner'),\n attrs,\n signature;\n\n clientTime = cryptoCommon.getDateObj(clientTime);\n\n try {\n oAttrs.Name = cryptoConstants.Time.AUTHENTICATED_ATTRIBUTE_SIGNING_TIME;\n oAttrs.Value = clientTime;\n } catch (err) {\n reject('Ошибка при установке данных подписи: ' + err.message);\n return;\n }\n\n // Задаем настройки для подписи\n try {\n oSigner.Certificate = cert;\n attrs = oSigner.AuthenticatedAttributes2;\n attrs.Add(oAttrs);\n oSignedData.ContentEncoding = cadesplugin.CADESCOM_BASE64_TO_BINARY;\n oSignedData.Content = dataBase64;\n oSigner.Options = cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY;\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = oSignedData.SignCades(\n oSigner,\n cadesplugin.CADESCOM_CADES_BES,\n signType\n );\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n }, reject);\n });\n}\n\n/**\n * Создает подпись XML строки по hash'у сертификата\n *\n * @param {String} hash -- fingerprint (thumbprint) сертификата\n * @param {String} dataXML -- данные в формате XML\n * @returns {Promise} -- обещание, которое зарезолвится с данными о подписи {String}\n * */\nfunction signDataXML(hash, dataXML) {\n return new Promise(function (resolve, reject) {\n getCadesCert(hash).then(function (cert) {\n var oSigner = cadesplugin.CreateObject('CAdESCOM.CPSigner'),\n signerXML = cadesplugin.CreateObject('CAdESCOM.SignedXML'),\n cnts = cryptoConstants,\n signature;\n\n // Задаем настройки для подписи\n try {\n oSigner.Certificate = cert;\n // Добавляем данные для подписи\n signerXML.Content = dataXML;\n // Устанавливаем тип подписи\n signerXML.SignatureType = cnts.SignatureType.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED;\n // Устанавливаем алгоритм подписи\n signerXML.SignatureMethod = cnts.GostXmlDSigUrls.XmlDsigGost3410Url;\n // Устанавливаем алгоритм хэширования\n signerXML.DigestMethod = cnts.GostXmlDSigUrls.XmlDsigGost3411Url;\n } catch (err) {\n reject('Не удалось установить настройки для подписи: ' + err.message);\n return;\n }\n\n try {\n signature = signerXML.Sign(oSigner);\n } catch (err) {\n reject('Не удалось создать подпись: ' + err.message);\n return;\n }\n\n resolve(signature);\n }, reject);\n });\n}\n\n/**\n * Возвращает информацию о версии CSP и плагина\n * */\nfunction getSystemInfo() {\n var sysInfo = cryptoCommon.getEnvInfo();\n\n return new Promise(function (resolve, reject) {\n var e;\n\n try {\n e = cadesplugin.CreateObject('CAdESCOM.About');\n\n sysInfo.cadesVersion = e.PluginVersion;\n // Возможен вызов в ранних версиях в виде sysInfo.cspVersion = e.CSPVersion('', 75);\n sysInfo.cspVersion = e.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = e.Version;\n }\n\n sysInfo.cadesVersion = sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = sysInfo.cspVersion.toString();\n\n resolve(sysInfo);\n } catch (err) {\n reject('Ошибка при получении информации о системе: ', err.message);\n }\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии CSP\n * */\nfunction isValidCSPVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCSPVersion(version));\n });\n}\n\n/**\n * Promise обертка для синхронного вызова проверки версии плагина\n * */\nfunction isValidCadesVersion(version) {\n return new Promise(function (resolve) {\n resolve(cryptoCommon.isValidCadesVersion(version));\n });\n}\n\nmodule.exports = {\n isValidEDSSettings: isValidEDSSettings,\n getCertsList: getCertsList,\n getCert: getCert,\n signData: signData,\n signDataXML: signDataXML,\n getSystemInfo: getSystemInfo,\n isValidCSPVersion: isValidCSPVersion,\n isValidCadesVersion: isValidCadesVersion\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./apiSync.js\n ** module id = 8\n ** module chunks = 2\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/crypto-pro.js b/dist/crypto-pro.js index 275a95f..2ff5d20 100644 --- a/dist/crypto-pro.js +++ b/dist/crypto-pro.js @@ -178,7 +178,7 @@ var CryptoPro = cadesplugin.then( function () { if (canAsync) { - __webpack_require__.e/* nsure */(1, function () { + __webpack_require__.e/* nsure */(1/* empty */, function () { cryptoService = __webpack_require__(4); finishLoading(); }); diff --git a/dist/crypto-pro.js.map b/dist/crypto-pro.js.map index 085d43f..86fc469 100644 --- a/dist/crypto-pro.js.map +++ b/dist/crypto-pro.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 7688ca643b5f9737c1f8","webpack:///./index.js","webpack:///../~/bowser/bowser.js","webpack:///../~/webpack/buildin/amd-define.js","webpack:///../vendor/cadesplugin_api.js"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB,kBAAiB;AACjB;AACA;AACA;AACA,sBAAqB;AACrB;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;AACD;AACA;;AAEA;AACA;AACA,G;;;;;;AC5GA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;;AAEA;AACA,oBAAmB,wBAAwB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,MAAM;AACpB,eAAc,SAAS;AACvB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,gBAAgB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sDAAqD;AACrD,mDAAkD;AAClD,mDAAkD;AAClD;AACA,eAAc,cAAc;AAC5B,eAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA,eAAc,OAAO;AACrB,eAAc,QAAQ;AACtB,eAAc,OAAO;AACrB,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,QAAQ;AACtB,eAAc,OAAO;AACrB,eAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAC;;;;;;;ACnkBD,8BAA6B,mDAAmD;;;;;;;ACAhF,EAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAsD;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAgD,iBAAiB,WAAW,UAAU,YAAY,aAAa;AAC/G,0FAAyF,aAAa,mBAAmB,uBAAuB,uBAAuB,cAAc,mBAAmB,YAAY;AACpN,6FAA4F,iBAAiB,yBAAyB,WAAW;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB;AACzB,qCAAoC;AACpC,kBAAiB;AACjB;AACA;AACA;AACA;AACA,0BAAyB;;AAEzB;AACA;AACA;AACA;AACA,0BAAyB;AACzB;AACA;AACA;AACA,kBAAiB;AACjB,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAa;AACb;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,EAAC","file":"crypto-pro.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonpCryptoPro\"];\n \twindow[\"webpackJsonpCryptoPro\"] = function webpackJsonpCallback(chunkIds, moreModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, callbacks = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tcallbacks.push.apply(callbacks, installedChunks[chunkId]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);\n \t\twhile(callbacks.length)\n \t\t\tcallbacks.shift().call(null, __webpack_require__);\n\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// \"0\" means \"already loaded\"\n \t// Array means \"loading\", array contains callbacks\n \tvar installedChunks = {\n \t\t0:0\n \t};\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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId, callback) {\n \t\t// \"0\" is the signal for \"already loaded\"\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn callback.call(null, __webpack_require__);\n\n \t\t// an array means \"currently loading\".\n \t\tif(installedChunks[chunkId] !== undefined) {\n \t\t\tinstalledChunks[chunkId].push(callback);\n \t\t} else {\n \t\t\t// start chunk loading\n \t\t\tinstalledChunks[chunkId] = [callback];\n \t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\tvar script = document.createElement('script');\n \t\t\tscript.type = 'text/javascript';\n \t\t\tscript.charset = 'utf-8';\n \t\t\tscript.async = true;\n\n \t\t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".crypto-pro.js\";\n \t\t\thead.appendChild(script);\n \t\t}\n \t};\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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 7688ca643b5f9737c1f8\n **/","var bowser = require('bowser/bowser'),\n browserInfo = bowser._detect(navigator.userAgent),\n global = Function('return this')(),\n canPromise = Boolean(global.Promise),\n CryptoProConfig = global.CryptoProConfig,\n canAsync,\n cadesplugin,\n cryptoService,\n _errorMsg = '',\n _isLoaded = false,\n _onLoadCbQueue = [];\n\nglobal.allow_firefox_cadesplugin_async = browserInfo.firefox && browserInfo.version >= 52;\n\nrequire('../vendor/cadesplugin_api');\n\ncadesplugin = global.cadesplugin;\n\ncanAsync = Boolean(cadesplugin.CreateObjectAsync);\n\nfunction execOnloadQueue() {\n _onLoadCbQueue.forEach(function (callback) {\n callback();\n });\n}\n\nfunction passToWaitOnLoad(callback) {\n if (Object.prototype.toString.call(callback) === '[object Function]') {\n _onLoadCbQueue.push(callback);\n }\n}\n\nfunction callOnLoad(method) {\n _isLoaded ? method() : passToWaitOnLoad(method);\n}\n\nfunction finishLoading() {\n _isLoaded = true;\n\n execOnloadQueue();\n}\n\nfunction call() {\n var args = Array.prototype.slice.call(arguments),\n methodName = args.shift();\n\n return new Promise(function (resolve, reject) {\n callOnLoad(function () {\n var method;\n\n if (_errorMsg) {\n reject(_errorMsg);\n return;\n }\n\n method = cryptoService[methodName];\n\n if (!method) {\n reject('Метод \"' + methodName + '\" не доступен');\n return;\n }\n\n method.apply(null, args).then(resolve, reject);\n });\n });\n}\n\nif (cadesplugin) {\n canAsync = Boolean(cadesplugin.CreateObjectAsync);\n\n // Уровень отладки (LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_ERROR)\n cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR);\n\n // Получаем указанные конфиги\n if (CryptoProConfig && CryptoProConfig.publicPath) {\n __webpack_public_path__ = CryptoProConfig.publicPath;\n }\n\n if (canPromise) {\n cadesplugin.then(\n function () {\n if (canAsync) {\n require.ensure([], function () {\n cryptoService = require('./apiAsync');\n finishLoading();\n });\n } else {\n require.ensure([], function () {\n cryptoService = require('./apiSync');\n finishLoading();\n });\n }\n },\n\n function () {\n _errorMsg = 'КриптоПРО ЭЦП Browser Plug-In не доступен';\n finishLoading();\n }\n );\n } else {\n throw new Error('Не поддерживаются промисы. Необходим полифилл.');\n }\n} else {\n throw new Error('Не подключен модуль для работы с cades plugin');\n}\n\nmodule.exports = {\n call: call\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","/*!\n * Bowser - a browser detector\n * https://github.com/ded/bowser\n * MIT License | (c) Dustin Diaz 2015\n */\n\n!function (name, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports = definition()\n else if (typeof define == 'function' && define.amd) define(name, definition)\n else this[name] = definition()\n}('bowser', function () {\n /**\n * See useragents.js for examples of navigator.userAgent\n */\n\n var t = true\n\n function detect(ua) {\n\n function getFirstMatch(regex) {\n var match = ua.match(regex);\n return (match && match.length > 1 && match[1]) || '';\n }\n\n function getSecondMatch(regex) {\n var match = ua.match(regex);\n return (match && match.length > 1 && match[2]) || '';\n }\n\n var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()\n , likeAndroid = /like android/i.test(ua)\n , android = !likeAndroid && /android/i.test(ua)\n , nexusMobile = /nexus\\s*[0-6]\\s*/i.test(ua)\n , nexusTablet = !nexusMobile && /nexus\\s*[0-9]+/i.test(ua)\n , chromeos = /CrOS/.test(ua)\n , silk = /silk/i.test(ua)\n , sailfish = /sailfish/i.test(ua)\n , tizen = /tizen/i.test(ua)\n , webos = /(web|hpw)os/i.test(ua)\n , windowsphone = /windows phone/i.test(ua)\n , samsungBrowser = /SamsungBrowser/i.test(ua)\n , windows = !windowsphone && /windows/i.test(ua)\n , mac = !iosdevice && !silk && /macintosh/i.test(ua)\n , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua)\n , edgeVersion = getFirstMatch(/edge\\/(\\d+(\\.\\d+)?)/i)\n , versionIdentifier = getFirstMatch(/version\\/(\\d+(\\.\\d+)?)/i)\n , tablet = /tablet/i.test(ua)\n , mobile = !tablet && /[^-]mobi/i.test(ua)\n , xbox = /xbox/i.test(ua)\n , result\n\n if (/opera/i.test(ua)) {\n // an old Opera\n result = {\n name: 'Opera'\n , opera: t\n , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n } else if (/opr|opios/i.test(ua)) {\n // a new Opera\n result = {\n name: 'Opera'\n , opera: t\n , version: getFirstMatch(/(?:opr|opios)[\\s\\/](\\d+(\\.\\d+)?)/i) || versionIdentifier\n }\n }\n else if (/SamsungBrowser/i.test(ua)) {\n result = {\n name: 'Samsung Internet for Android'\n , samsungBrowser: t\n , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/coast/i.test(ua)) {\n result = {\n name: 'Opera Coast'\n , coast: t\n , version: versionIdentifier || getFirstMatch(/(?:coast)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/yabrowser/i.test(ua)) {\n result = {\n name: 'Yandex Browser'\n , yandexbrowser: t\n , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/ucbrowser/i.test(ua)) {\n result = {\n name: 'UC Browser'\n , ucbrowser: t\n , version: getFirstMatch(/(?:ucbrowser)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/mxios/i.test(ua)) {\n result = {\n name: 'Maxthon'\n , maxthon: t\n , version: getFirstMatch(/(?:mxios)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/epiphany/i.test(ua)) {\n result = {\n name: 'Epiphany'\n , epiphany: t\n , version: getFirstMatch(/(?:epiphany)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/puffin/i.test(ua)) {\n result = {\n name: 'Puffin'\n , puffin: t\n , version: getFirstMatch(/(?:puffin)[\\s\\/](\\d+(?:\\.\\d+)?)/i)\n }\n }\n else if (/sleipnir/i.test(ua)) {\n result = {\n name: 'Sleipnir'\n , sleipnir: t\n , version: getFirstMatch(/(?:sleipnir)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/k-meleon/i.test(ua)) {\n result = {\n name: 'K-Meleon'\n , kMeleon: t\n , version: getFirstMatch(/(?:k-meleon)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (windowsphone) {\n result = {\n name: 'Windows Phone'\n , windowsphone: t\n }\n if (edgeVersion) {\n result.msedge = t\n result.version = edgeVersion\n }\n else {\n result.msie = t\n result.version = getFirstMatch(/iemobile\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/msie|trident/i.test(ua)) {\n result = {\n name: 'Internet Explorer'\n , msie: t\n , version: getFirstMatch(/(?:msie |rv:)(\\d+(\\.\\d+)?)/i)\n }\n } else if (chromeos) {\n result = {\n name: 'Chrome'\n , chromeos: t\n , chromeBook: t\n , chrome: t\n , version: getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)\n }\n } else if (/chrome.+? edge/i.test(ua)) {\n result = {\n name: 'Microsoft Edge'\n , msedge: t\n , version: edgeVersion\n }\n }\n else if (/vivaldi/i.test(ua)) {\n result = {\n name: 'Vivaldi'\n , vivaldi: t\n , version: getFirstMatch(/vivaldi\\/(\\d+(\\.\\d+)?)/i) || versionIdentifier\n }\n }\n else if (sailfish) {\n result = {\n name: 'Sailfish'\n , sailfish: t\n , version: getFirstMatch(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/seamonkey\\//i.test(ua)) {\n result = {\n name: 'SeaMonkey'\n , seamonkey: t\n , version: getFirstMatch(/seamonkey\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/firefox|iceweasel|fxios/i.test(ua)) {\n result = {\n name: 'Firefox'\n , firefox: t\n , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \\/](\\d+(\\.\\d+)?)/i)\n }\n if (/\\((mobile|tablet);[^\\)]*rv:[\\d\\.]+\\)/i.test(ua)) {\n result.firefoxos = t\n }\n }\n else if (silk) {\n result = {\n name: 'Amazon Silk'\n , silk: t\n , version : getFirstMatch(/silk\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/phantom/i.test(ua)) {\n result = {\n name: 'PhantomJS'\n , phantom: t\n , version: getFirstMatch(/phantomjs\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/slimerjs/i.test(ua)) {\n result = {\n name: 'SlimerJS'\n , slimer: t\n , version: getFirstMatch(/slimerjs\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/blackberry|\\bbb\\d+/i.test(ua) || /rim\\stablet/i.test(ua)) {\n result = {\n name: 'BlackBerry'\n , blackberry: t\n , version: versionIdentifier || getFirstMatch(/blackberry[\\d]+\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (webos) {\n result = {\n name: 'WebOS'\n , webos: t\n , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\\/(\\d+(\\.\\d+)?)/i)\n };\n /touchpad\\//i.test(ua) && (result.touchpad = t)\n }\n else if (/bada/i.test(ua)) {\n result = {\n name: 'Bada'\n , bada: t\n , version: getFirstMatch(/dolfin\\/(\\d+(\\.\\d+)?)/i)\n };\n }\n else if (tizen) {\n result = {\n name: 'Tizen'\n , tizen: t\n , version: getFirstMatch(/(?:tizen\\s?)?browser\\/(\\d+(\\.\\d+)?)/i) || versionIdentifier\n };\n }\n else if (/qupzilla/i.test(ua)) {\n result = {\n name: 'QupZilla'\n , qupzilla: t\n , version: getFirstMatch(/(?:qupzilla)[\\s\\/](\\d+(?:\\.\\d+)+)/i) || versionIdentifier\n }\n }\n else if (/chromium/i.test(ua)) {\n result = {\n name: 'Chromium'\n , chromium: t\n , version: getFirstMatch(/(?:chromium)[\\s\\/](\\d+(?:\\.\\d+)?)/i) || versionIdentifier\n }\n }\n else if (/chrome|crios|crmo/i.test(ua)) {\n result = {\n name: 'Chrome'\n , chrome: t\n , version: getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (android) {\n result = {\n name: 'Android'\n , version: versionIdentifier\n }\n }\n else if (/safari|applewebkit/i.test(ua)) {\n result = {\n name: 'Safari'\n , safari: t\n }\n if (versionIdentifier) {\n result.version = versionIdentifier\n }\n }\n else if (iosdevice) {\n result = {\n name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'\n }\n // WTF: version is not part of user agent in web apps\n if (versionIdentifier) {\n result.version = versionIdentifier\n }\n }\n else if(/googlebot/i.test(ua)) {\n result = {\n name: 'Googlebot'\n , googlebot: t\n , version: getFirstMatch(/googlebot\\/(\\d+(\\.\\d+))/i) || versionIdentifier\n }\n }\n else {\n result = {\n name: getFirstMatch(/^(.*)\\/(.*) /),\n version: getSecondMatch(/^(.*)\\/(.*) /)\n };\n }\n\n // set webkit or gecko flag for browsers based on these engines\n if (!result.msedge && /(apple)?webkit/i.test(ua)) {\n if (/(apple)?webkit\\/537\\.36/i.test(ua)) {\n result.name = result.name || \"Blink\"\n result.blink = t\n } else {\n result.name = result.name || \"Webkit\"\n result.webkit = t\n }\n if (!result.version && versionIdentifier) {\n result.version = versionIdentifier\n }\n } else if (!result.opera && /gecko\\//i.test(ua)) {\n result.name = result.name || \"Gecko\"\n result.gecko = t\n result.version = result.version || getFirstMatch(/gecko\\/(\\d+(\\.\\d+)?)/i)\n }\n\n // set OS flags for platforms that have multiple browsers\n if (!result.windowsphone && !result.msedge && (android || result.silk)) {\n result.android = t\n } else if (!result.windowsphone && !result.msedge && iosdevice) {\n result[iosdevice] = t\n result.ios = t\n } else if (mac) {\n result.mac = t\n } else if (xbox) {\n result.xbox = t\n } else if (windows) {\n result.windows = t\n } else if (linux) {\n result.linux = t\n }\n\n // OS version extraction\n var osVersion = '';\n if (result.windowsphone) {\n osVersion = getFirstMatch(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i);\n } else if (iosdevice) {\n osVersion = getFirstMatch(/os (\\d+([_\\s]\\d+)*) like mac os x/i);\n osVersion = osVersion.replace(/[_\\s]/g, '.');\n } else if (android) {\n osVersion = getFirstMatch(/android[ \\/-](\\d+(\\.\\d+)*)/i);\n } else if (result.webos) {\n osVersion = getFirstMatch(/(?:web|hpw)os\\/(\\d+(\\.\\d+)*)/i);\n } else if (result.blackberry) {\n osVersion = getFirstMatch(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i);\n } else if (result.bada) {\n osVersion = getFirstMatch(/bada\\/(\\d+(\\.\\d+)*)/i);\n } else if (result.tizen) {\n osVersion = getFirstMatch(/tizen[\\/\\s](\\d+(\\.\\d+)*)/i);\n }\n if (osVersion) {\n result.osversion = osVersion;\n }\n\n // device type extraction\n var osMajorVersion = osVersion.split('.')[0];\n if (\n tablet\n || nexusTablet\n || iosdevice == 'ipad'\n || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile)))\n || result.silk\n ) {\n result.tablet = t\n } else if (\n mobile\n || iosdevice == 'iphone'\n || iosdevice == 'ipod'\n || android\n || nexusMobile\n || result.blackberry\n || result.webos\n || result.bada\n ) {\n result.mobile = t\n }\n\n // Graded Browser Support\n // http://developer.yahoo.com/yui/articles/gbs\n if (result.msedge ||\n (result.msie && result.version >= 10) ||\n (result.yandexbrowser && result.version >= 15) ||\n\t\t (result.vivaldi && result.version >= 1.0) ||\n (result.chrome && result.version >= 20) ||\n (result.samsungBrowser && result.version >= 4) ||\n (result.firefox && result.version >= 20.0) ||\n (result.safari && result.version >= 6) ||\n (result.opera && result.version >= 10.0) ||\n (result.ios && result.osversion && result.osversion.split(\".\")[0] >= 6) ||\n (result.blackberry && result.version >= 10.1)\n || (result.chromium && result.version >= 20)\n ) {\n result.a = t;\n }\n else if ((result.msie && result.version < 10) ||\n (result.chrome && result.version < 20) ||\n (result.firefox && result.version < 20.0) ||\n (result.safari && result.version < 6) ||\n (result.opera && result.version < 10.0) ||\n (result.ios && result.osversion && result.osversion.split(\".\")[0] < 6)\n || (result.chromium && result.version < 20)\n ) {\n result.c = t\n } else result.x = t\n\n return result\n }\n\n var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '')\n\n bowser.test = function (browserList) {\n for (var i = 0; i < browserList.length; ++i) {\n var browserItem = browserList[i];\n if (typeof browserItem=== 'string') {\n if (browserItem in bowser) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Get version precisions count\n *\n * @example\n * getVersionPrecision(\"1.10.3\") // 3\n *\n * @param {string} version\n * @return {number}\n */\n function getVersionPrecision(version) {\n return version.split(\".\").length;\n }\n\n /**\n * Array::map polyfill\n *\n * @param {Array} arr\n * @param {Function} iterator\n * @return {Array}\n */\n function map(arr, iterator) {\n var result = [], i;\n if (Array.prototype.map) {\n return Array.prototype.map.call(arr, iterator);\n }\n for (i = 0; i < arr.length; i++) {\n result.push(iterator(arr[i]));\n }\n return result;\n }\n\n /**\n * Calculate browser version weight\n *\n * @example\n * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1\n * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1\n * compareVersions(['1.10.2.1', '1.10.2.1']); // 0\n * compareVersions(['1.10.2.1', '1.0800.2']); // -1\n *\n * @param {Array} versions versions to compare\n * @return {Number} comparison result\n */\n function compareVersions(versions) {\n // 1) get common precision for both versions, for example for \"10.0\" and \"9\" it should be 2\n var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1]));\n var chunks = map(versions, function (version) {\n var delta = precision - getVersionPrecision(version);\n\n // 2) \"9\" -> \"9.0\" (for precision = 2)\n version = version + new Array(delta + 1).join(\".0\");\n\n // 3) \"9.0\" -> [\"000000000\"\", \"000000009\"]\n return map(version.split(\".\"), function (chunk) {\n return new Array(20 - chunk.length).join(\"0\") + chunk;\n }).reverse();\n });\n\n // iterate in reverse order by reversed chunks array\n while (--precision >= 0) {\n // 4) compare: \"000000009\" > \"000000010\" = false (but \"9\" > \"10\" = true)\n if (chunks[0][precision] > chunks[1][precision]) {\n return 1;\n }\n else if (chunks[0][precision] === chunks[1][precision]) {\n if (precision === 0) {\n // all version chunks are same\n return 0;\n }\n }\n else {\n return -1;\n }\n }\n }\n\n /**\n * Check if browser is unsupported\n *\n * @example\n * bowser.isUnsupportedBrowser({\n * msie: \"10\",\n * firefox: \"23\",\n * chrome: \"29\",\n * safari: \"5.1\",\n * opera: \"16\",\n * phantom: \"534\"\n * });\n *\n * @param {Object} minVersions map of minimal version to browser\n * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map\n * @param {String} [ua] user agent string\n * @return {Boolean}\n */\n function isUnsupportedBrowser(minVersions, strictMode, ua) {\n var _bowser = bowser;\n\n // make strictMode param optional with ua param usage\n if (typeof strictMode === 'string') {\n ua = strictMode;\n strictMode = void(0);\n }\n\n if (strictMode === void(0)) {\n strictMode = false;\n }\n if (ua) {\n _bowser = detect(ua);\n }\n\n var version = \"\" + _bowser.version;\n for (var browser in minVersions) {\n if (minVersions.hasOwnProperty(browser)) {\n if (_bowser[browser]) {\n if (typeof minVersions[browser] !== 'string') {\n throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions));\n }\n\n // browser version and min supported version.\n return compareVersions([version, minVersions[browser]]) < 0;\n }\n }\n }\n\n return strictMode; // not found\n }\n\n /**\n * Check if browser is supported\n *\n * @param {Object} minVersions map of minimal version to browser\n * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map\n * @param {String} [ua] user agent string\n * @return {Boolean}\n */\n function check(minVersions, strictMode, ua) {\n return !isUnsupportedBrowser(minVersions, strictMode, ua);\n }\n\n bowser.isUnsupportedBrowser = isUnsupportedBrowser;\n bowser.compareVersions = compareVersions;\n bowser.check = check;\n\n /*\n * Set our detect method to the main bowser object so we can\n * reuse it to test other user agents.\n * This is needed to implement future tests.\n */\n bowser._detect = detect;\n\n return bowser\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ../~/bowser/bowser.js\n ** module id = 1\n ** module chunks = 0\n **/","module.exports = function() { throw new Error(\"define cannot be used indirect\"); };\r\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ../~/webpack/buildin/amd-define.js\n ** module id = 2\n ** module chunks = 0\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 isYaBrowser = 0;\n var isFireFox = 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 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\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.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\n cadesplugin.LOG_LEVEL_DEBUG = 4;\n cadesplugin.LOG_LEVEL_INFO = 2;\n cadesplugin.LOG_LEVEL_ERROR = 1;\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 retVal;\n }\n\n function isIOS() {\n var retVal = (navigator.userAgent.match(/ipod/i) ||\n navigator.userAgent.match(/ipad/i) ||\n navigator.userAgent.match(/iphone/i));\n return retVal;\n }\n\n function isNativeMessageSupported()\n {\n var retVal_chrome = navigator.userAgent.match(/chrome/i);\n isOpera = navigator.userAgent.match(/opr/i);\n isYaBrowser = navigator.userAgent.match(/YaBrowser/i);\n isFireFox = navigator.userAgent.match(/Firefox/i);\n\n if(isFireFox && window.allow_firefox_cadesplugin_async)\n return true;\n\n if(retVal_chrome == null) // В IE работаем через NPAPI\n return false;\n else\n {\n // В Chrome и Opera работаем через асинхронную версию\n if(retVal_chrome.length > 0 || isOpera != null )\n {\n return true;\n }\n }\n return false;\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 создаются через CX509EnrollmentWebClassFactory\n var objCertEnrollClassFactory = document.getElementById(\"certEnrollClassFactory\");\n return objCertEnrollClassFactory.CreateObject(name);\n }\n catch (e) {\n throw(\"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS\");\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 // В Firefox, Safari создаются объекты 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 // Функция активации асинхронных объектов КриптоПро ЭЦП 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 //Выводим окно поверх других с предложением установить расширение для 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_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)\n {\n // Для Firefox вместе с сообщением 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_nmcades_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n\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\n function load_extension()\n {\n\n if(isFireFox){\n // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера.\n nmcades_api_onload();\n return;\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 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(\"iecheck\").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 window.addEventListener(\"load\", function (event) {\n load_npapi_plugin();\n check_npapi_plugin();\n }, false);\n }\n }\n\n function set_pluginObject(obj)\n {\n pluginObject = obj;\n }\n\n //Export\n cadesplugin.JSModuleVersion = \"2.1.0\";\n cadesplugin.async_spawn = async_spawn;\n cadesplugin.set = set_pluginObject;\n cadesplugin.set_log_level = set_log_level;\n cadesplugin.getLastError = getLastError;\n\n if(isNativeMessageSupported())\n {\n cadesplugin.CreateObjectAsync = CreateObjectAsync;\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\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ../vendor/cadesplugin_api.js\n ** module id = 3\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap d7bb984983f7d0f13ad2","webpack:///./index.js","webpack:///../~/bowser/bowser.js","webpack:///../~/webpack/buildin/amd-define.js","webpack:///../vendor/cadesplugin_api.js"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,UAAS;AACT,MAAK;AACL;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB,kBAAiB;AACjB;AACA;AACA;AACA,sBAAqB;AACrB;AACA,cAAa;;AAEb;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,EAAC;AACD;AACA;;AAEA;AACA;AACA,G;;;;;;AC5GA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;;AAEL;AACA;;AAEA;;AAEA;AACA,oBAAmB,wBAAwB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAc,MAAM;AACpB,eAAc,SAAS;AACvB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA,gBAAe,gBAAgB;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,sDAAqD;AACrD,mDAAkD;AAClD,mDAAkD;AAClD;AACA,eAAc,cAAc;AAC5B,eAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,QAAO;AACP,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAQ;AACR;AACA,eAAc,OAAO;AACrB,eAAc,QAAQ;AACtB,eAAc,OAAO;AACrB,eAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,uBAAsB;AACtB;;AAEA;AACA;AACA;AACA,eAAc,OAAO;AACrB,eAAc,QAAQ;AACtB,eAAc,OAAO;AACrB,eAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,EAAC;;;;;;;ACnkBD,8BAA6B,mDAAmD;;;;;;;ACAhF,EAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uDAAsD;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA,QAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA2C;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAgD,iBAAiB,WAAW,UAAU,YAAY,aAAa;AAC/G,0FAAyF,aAAa,mBAAmB,uBAAuB,uBAAuB,cAAc,mBAAmB,YAAY;AACpN,6FAA4F,iBAAiB,yBAAyB,WAAW;AACjJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAAyB;AACzB,qCAAoC;AACpC,kBAAiB;AACjB;AACA;AACA;AACA;AACA,0BAAyB;;AAEzB;AACA;AACA;AACA;AACA,0BAAyB;AACzB;AACA;AACA;AACA,kBAAiB;AACjB,cAAa;AACb,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAa;AACb;AACA;AACA,UAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,sBAAqB;AACrB;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,EAAC","file":"crypto-pro.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonpCryptoPro\"];\n \twindow[\"webpackJsonpCryptoPro\"] = function webpackJsonpCallback(chunkIds, moreModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, callbacks = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tcallbacks.push.apply(callbacks, installedChunks[chunkId]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);\n \t\twhile(callbacks.length)\n \t\t\tcallbacks.shift().call(null, __webpack_require__);\n\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// \"0\" means \"already loaded\"\n \t// Array means \"loading\", array contains callbacks\n \tvar installedChunks = {\n \t\t0:0\n \t};\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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId, callback) {\n \t\t// \"0\" is the signal for \"already loaded\"\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn callback.call(null, __webpack_require__);\n\n \t\t// an array means \"currently loading\".\n \t\tif(installedChunks[chunkId] !== undefined) {\n \t\t\tinstalledChunks[chunkId].push(callback);\n \t\t} else {\n \t\t\t// start chunk loading\n \t\t\tinstalledChunks[chunkId] = [callback];\n \t\t\tvar head = document.getElementsByTagName('head')[0];\n \t\t\tvar script = document.createElement('script');\n \t\t\tscript.type = 'text/javascript';\n \t\t\tscript.charset = 'utf-8';\n \t\t\tscript.async = true;\n\n \t\t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".crypto-pro.js\";\n \t\t\thead.appendChild(script);\n \t\t}\n \t};\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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap d7bb984983f7d0f13ad2\n **/","var bowser = require('bowser/bowser'),\n browserInfo = bowser._detect(navigator.userAgent),\n global = Function('return this')(),\n canPromise = Boolean(global.Promise),\n CryptoProConfig = global.CryptoProConfig,\n canAsync,\n cadesplugin,\n cryptoService,\n _errorMsg = '',\n _isLoaded = false,\n _onLoadCbQueue = [];\n\nglobal.allow_firefox_cadesplugin_async = browserInfo.firefox && browserInfo.version >= 52;\n\nrequire('../vendor/cadesplugin_api');\n\ncadesplugin = global.cadesplugin;\n\ncanAsync = Boolean(cadesplugin.CreateObjectAsync);\n\nfunction execOnloadQueue() {\n _onLoadCbQueue.forEach(function (callback) {\n callback();\n });\n}\n\nfunction passToWaitOnLoad(callback) {\n if (Object.prototype.toString.call(callback) === '[object Function]') {\n _onLoadCbQueue.push(callback);\n }\n}\n\nfunction callOnLoad(method) {\n _isLoaded ? method() : passToWaitOnLoad(method);\n}\n\nfunction finishLoading() {\n _isLoaded = true;\n\n execOnloadQueue();\n}\n\nfunction call() {\n var args = Array.prototype.slice.call(arguments),\n methodName = args.shift();\n\n return new Promise(function (resolve, reject) {\n callOnLoad(function () {\n var method;\n\n if (_errorMsg) {\n reject(_errorMsg);\n return;\n }\n\n method = cryptoService[methodName];\n\n if (!method) {\n reject('Метод \"' + methodName + '\" не доступен');\n return;\n }\n\n method.apply(null, args).then(resolve, reject);\n });\n });\n}\n\nif (cadesplugin) {\n canAsync = Boolean(cadesplugin.CreateObjectAsync);\n\n // Уровень отладки (LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_ERROR)\n cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR);\n\n // Получаем указанные конфиги\n if (CryptoProConfig && CryptoProConfig.publicPath) {\n __webpack_public_path__ = CryptoProConfig.publicPath;\n }\n\n if (canPromise) {\n cadesplugin.then(\n function () {\n if (canAsync) {\n require.ensure([], function () {\n cryptoService = require('./apiAsync');\n finishLoading();\n });\n } else {\n require.ensure([], function () {\n cryptoService = require('./apiSync');\n finishLoading();\n });\n }\n },\n\n function () {\n _errorMsg = 'КриптоПРО ЭЦП Browser Plug-In не доступен';\n finishLoading();\n }\n );\n } else {\n throw new Error('Не поддерживаются промисы. Необходим полифилл.');\n }\n} else {\n throw new Error('Не подключен модуль для работы с cades plugin');\n}\n\nmodule.exports = {\n call: call\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","/*!\n * Bowser - a browser detector\n * https://github.com/ded/bowser\n * MIT License | (c) Dustin Diaz 2015\n */\n\n!function (name, definition) {\n if (typeof module != 'undefined' && module.exports) module.exports = definition()\n else if (typeof define == 'function' && define.amd) define(name, definition)\n else this[name] = definition()\n}('bowser', function () {\n /**\n * See useragents.js for examples of navigator.userAgent\n */\n\n var t = true\n\n function detect(ua) {\n\n function getFirstMatch(regex) {\n var match = ua.match(regex);\n return (match && match.length > 1 && match[1]) || '';\n }\n\n function getSecondMatch(regex) {\n var match = ua.match(regex);\n return (match && match.length > 1 && match[2]) || '';\n }\n\n var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()\n , likeAndroid = /like android/i.test(ua)\n , android = !likeAndroid && /android/i.test(ua)\n , nexusMobile = /nexus\\s*[0-6]\\s*/i.test(ua)\n , nexusTablet = !nexusMobile && /nexus\\s*[0-9]+/i.test(ua)\n , chromeos = /CrOS/.test(ua)\n , silk = /silk/i.test(ua)\n , sailfish = /sailfish/i.test(ua)\n , tizen = /tizen/i.test(ua)\n , webos = /(web|hpw)os/i.test(ua)\n , windowsphone = /windows phone/i.test(ua)\n , samsungBrowser = /SamsungBrowser/i.test(ua)\n , windows = !windowsphone && /windows/i.test(ua)\n , mac = !iosdevice && !silk && /macintosh/i.test(ua)\n , linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua)\n , edgeVersion = getFirstMatch(/edge\\/(\\d+(\\.\\d+)?)/i)\n , versionIdentifier = getFirstMatch(/version\\/(\\d+(\\.\\d+)?)/i)\n , tablet = /tablet/i.test(ua)\n , mobile = !tablet && /[^-]mobi/i.test(ua)\n , xbox = /xbox/i.test(ua)\n , result\n\n if (/opera/i.test(ua)) {\n // an old Opera\n result = {\n name: 'Opera'\n , opera: t\n , version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n } else if (/opr|opios/i.test(ua)) {\n // a new Opera\n result = {\n name: 'Opera'\n , opera: t\n , version: getFirstMatch(/(?:opr|opios)[\\s\\/](\\d+(\\.\\d+)?)/i) || versionIdentifier\n }\n }\n else if (/SamsungBrowser/i.test(ua)) {\n result = {\n name: 'Samsung Internet for Android'\n , samsungBrowser: t\n , version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/coast/i.test(ua)) {\n result = {\n name: 'Opera Coast'\n , coast: t\n , version: versionIdentifier || getFirstMatch(/(?:coast)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/yabrowser/i.test(ua)) {\n result = {\n name: 'Yandex Browser'\n , yandexbrowser: t\n , version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\\s\\/](\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/ucbrowser/i.test(ua)) {\n result = {\n name: 'UC Browser'\n , ucbrowser: t\n , version: getFirstMatch(/(?:ucbrowser)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/mxios/i.test(ua)) {\n result = {\n name: 'Maxthon'\n , maxthon: t\n , version: getFirstMatch(/(?:mxios)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/epiphany/i.test(ua)) {\n result = {\n name: 'Epiphany'\n , epiphany: t\n , version: getFirstMatch(/(?:epiphany)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/puffin/i.test(ua)) {\n result = {\n name: 'Puffin'\n , puffin: t\n , version: getFirstMatch(/(?:puffin)[\\s\\/](\\d+(?:\\.\\d+)?)/i)\n }\n }\n else if (/sleipnir/i.test(ua)) {\n result = {\n name: 'Sleipnir'\n , sleipnir: t\n , version: getFirstMatch(/(?:sleipnir)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (/k-meleon/i.test(ua)) {\n result = {\n name: 'K-Meleon'\n , kMeleon: t\n , version: getFirstMatch(/(?:k-meleon)[\\s\\/](\\d+(?:\\.\\d+)+)/i)\n }\n }\n else if (windowsphone) {\n result = {\n name: 'Windows Phone'\n , windowsphone: t\n }\n if (edgeVersion) {\n result.msedge = t\n result.version = edgeVersion\n }\n else {\n result.msie = t\n result.version = getFirstMatch(/iemobile\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/msie|trident/i.test(ua)) {\n result = {\n name: 'Internet Explorer'\n , msie: t\n , version: getFirstMatch(/(?:msie |rv:)(\\d+(\\.\\d+)?)/i)\n }\n } else if (chromeos) {\n result = {\n name: 'Chrome'\n , chromeos: t\n , chromeBook: t\n , chrome: t\n , version: getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)\n }\n } else if (/chrome.+? edge/i.test(ua)) {\n result = {\n name: 'Microsoft Edge'\n , msedge: t\n , version: edgeVersion\n }\n }\n else if (/vivaldi/i.test(ua)) {\n result = {\n name: 'Vivaldi'\n , vivaldi: t\n , version: getFirstMatch(/vivaldi\\/(\\d+(\\.\\d+)?)/i) || versionIdentifier\n }\n }\n else if (sailfish) {\n result = {\n name: 'Sailfish'\n , sailfish: t\n , version: getFirstMatch(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/seamonkey\\//i.test(ua)) {\n result = {\n name: 'SeaMonkey'\n , seamonkey: t\n , version: getFirstMatch(/seamonkey\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/firefox|iceweasel|fxios/i.test(ua)) {\n result = {\n name: 'Firefox'\n , firefox: t\n , version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \\/](\\d+(\\.\\d+)?)/i)\n }\n if (/\\((mobile|tablet);[^\\)]*rv:[\\d\\.]+\\)/i.test(ua)) {\n result.firefoxos = t\n }\n }\n else if (silk) {\n result = {\n name: 'Amazon Silk'\n , silk: t\n , version : getFirstMatch(/silk\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/phantom/i.test(ua)) {\n result = {\n name: 'PhantomJS'\n , phantom: t\n , version: getFirstMatch(/phantomjs\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/slimerjs/i.test(ua)) {\n result = {\n name: 'SlimerJS'\n , slimer: t\n , version: getFirstMatch(/slimerjs\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (/blackberry|\\bbb\\d+/i.test(ua) || /rim\\stablet/i.test(ua)) {\n result = {\n name: 'BlackBerry'\n , blackberry: t\n , version: versionIdentifier || getFirstMatch(/blackberry[\\d]+\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (webos) {\n result = {\n name: 'WebOS'\n , webos: t\n , version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\\/(\\d+(\\.\\d+)?)/i)\n };\n /touchpad\\//i.test(ua) && (result.touchpad = t)\n }\n else if (/bada/i.test(ua)) {\n result = {\n name: 'Bada'\n , bada: t\n , version: getFirstMatch(/dolfin\\/(\\d+(\\.\\d+)?)/i)\n };\n }\n else if (tizen) {\n result = {\n name: 'Tizen'\n , tizen: t\n , version: getFirstMatch(/(?:tizen\\s?)?browser\\/(\\d+(\\.\\d+)?)/i) || versionIdentifier\n };\n }\n else if (/qupzilla/i.test(ua)) {\n result = {\n name: 'QupZilla'\n , qupzilla: t\n , version: getFirstMatch(/(?:qupzilla)[\\s\\/](\\d+(?:\\.\\d+)+)/i) || versionIdentifier\n }\n }\n else if (/chromium/i.test(ua)) {\n result = {\n name: 'Chromium'\n , chromium: t\n , version: getFirstMatch(/(?:chromium)[\\s\\/](\\d+(?:\\.\\d+)?)/i) || versionIdentifier\n }\n }\n else if (/chrome|crios|crmo/i.test(ua)) {\n result = {\n name: 'Chrome'\n , chrome: t\n , version: getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.\\d+)?)/i)\n }\n }\n else if (android) {\n result = {\n name: 'Android'\n , version: versionIdentifier\n }\n }\n else if (/safari|applewebkit/i.test(ua)) {\n result = {\n name: 'Safari'\n , safari: t\n }\n if (versionIdentifier) {\n result.version = versionIdentifier\n }\n }\n else if (iosdevice) {\n result = {\n name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'\n }\n // WTF: version is not part of user agent in web apps\n if (versionIdentifier) {\n result.version = versionIdentifier\n }\n }\n else if(/googlebot/i.test(ua)) {\n result = {\n name: 'Googlebot'\n , googlebot: t\n , version: getFirstMatch(/googlebot\\/(\\d+(\\.\\d+))/i) || versionIdentifier\n }\n }\n else {\n result = {\n name: getFirstMatch(/^(.*)\\/(.*) /),\n version: getSecondMatch(/^(.*)\\/(.*) /)\n };\n }\n\n // set webkit or gecko flag for browsers based on these engines\n if (!result.msedge && /(apple)?webkit/i.test(ua)) {\n if (/(apple)?webkit\\/537\\.36/i.test(ua)) {\n result.name = result.name || \"Blink\"\n result.blink = t\n } else {\n result.name = result.name || \"Webkit\"\n result.webkit = t\n }\n if (!result.version && versionIdentifier) {\n result.version = versionIdentifier\n }\n } else if (!result.opera && /gecko\\//i.test(ua)) {\n result.name = result.name || \"Gecko\"\n result.gecko = t\n result.version = result.version || getFirstMatch(/gecko\\/(\\d+(\\.\\d+)?)/i)\n }\n\n // set OS flags for platforms that have multiple browsers\n if (!result.windowsphone && !result.msedge && (android || result.silk)) {\n result.android = t\n } else if (!result.windowsphone && !result.msedge && iosdevice) {\n result[iosdevice] = t\n result.ios = t\n } else if (mac) {\n result.mac = t\n } else if (xbox) {\n result.xbox = t\n } else if (windows) {\n result.windows = t\n } else if (linux) {\n result.linux = t\n }\n\n // OS version extraction\n var osVersion = '';\n if (result.windowsphone) {\n osVersion = getFirstMatch(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i);\n } else if (iosdevice) {\n osVersion = getFirstMatch(/os (\\d+([_\\s]\\d+)*) like mac os x/i);\n osVersion = osVersion.replace(/[_\\s]/g, '.');\n } else if (android) {\n osVersion = getFirstMatch(/android[ \\/-](\\d+(\\.\\d+)*)/i);\n } else if (result.webos) {\n osVersion = getFirstMatch(/(?:web|hpw)os\\/(\\d+(\\.\\d+)*)/i);\n } else if (result.blackberry) {\n osVersion = getFirstMatch(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i);\n } else if (result.bada) {\n osVersion = getFirstMatch(/bada\\/(\\d+(\\.\\d+)*)/i);\n } else if (result.tizen) {\n osVersion = getFirstMatch(/tizen[\\/\\s](\\d+(\\.\\d+)*)/i);\n }\n if (osVersion) {\n result.osversion = osVersion;\n }\n\n // device type extraction\n var osMajorVersion = osVersion.split('.')[0];\n if (\n tablet\n || nexusTablet\n || iosdevice == 'ipad'\n || (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile)))\n || result.silk\n ) {\n result.tablet = t\n } else if (\n mobile\n || iosdevice == 'iphone'\n || iosdevice == 'ipod'\n || android\n || nexusMobile\n || result.blackberry\n || result.webos\n || result.bada\n ) {\n result.mobile = t\n }\n\n // Graded Browser Support\n // http://developer.yahoo.com/yui/articles/gbs\n if (result.msedge ||\n (result.msie && result.version >= 10) ||\n (result.yandexbrowser && result.version >= 15) ||\n\t\t (result.vivaldi && result.version >= 1.0) ||\n (result.chrome && result.version >= 20) ||\n (result.samsungBrowser && result.version >= 4) ||\n (result.firefox && result.version >= 20.0) ||\n (result.safari && result.version >= 6) ||\n (result.opera && result.version >= 10.0) ||\n (result.ios && result.osversion && result.osversion.split(\".\")[0] >= 6) ||\n (result.blackberry && result.version >= 10.1)\n || (result.chromium && result.version >= 20)\n ) {\n result.a = t;\n }\n else if ((result.msie && result.version < 10) ||\n (result.chrome && result.version < 20) ||\n (result.firefox && result.version < 20.0) ||\n (result.safari && result.version < 6) ||\n (result.opera && result.version < 10.0) ||\n (result.ios && result.osversion && result.osversion.split(\".\")[0] < 6)\n || (result.chromium && result.version < 20)\n ) {\n result.c = t\n } else result.x = t\n\n return result\n }\n\n var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '')\n\n bowser.test = function (browserList) {\n for (var i = 0; i < browserList.length; ++i) {\n var browserItem = browserList[i];\n if (typeof browserItem=== 'string') {\n if (browserItem in bowser) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * Get version precisions count\n *\n * @example\n * getVersionPrecision(\"1.10.3\") // 3\n *\n * @param {string} version\n * @return {number}\n */\n function getVersionPrecision(version) {\n return version.split(\".\").length;\n }\n\n /**\n * Array::map polyfill\n *\n * @param {Array} arr\n * @param {Function} iterator\n * @return {Array}\n */\n function map(arr, iterator) {\n var result = [], i;\n if (Array.prototype.map) {\n return Array.prototype.map.call(arr, iterator);\n }\n for (i = 0; i < arr.length; i++) {\n result.push(iterator(arr[i]));\n }\n return result;\n }\n\n /**\n * Calculate browser version weight\n *\n * @example\n * compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1\n * compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1\n * compareVersions(['1.10.2.1', '1.10.2.1']); // 0\n * compareVersions(['1.10.2.1', '1.0800.2']); // -1\n *\n * @param {Array} versions versions to compare\n * @return {Number} comparison result\n */\n function compareVersions(versions) {\n // 1) get common precision for both versions, for example for \"10.0\" and \"9\" it should be 2\n var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1]));\n var chunks = map(versions, function (version) {\n var delta = precision - getVersionPrecision(version);\n\n // 2) \"9\" -> \"9.0\" (for precision = 2)\n version = version + new Array(delta + 1).join(\".0\");\n\n // 3) \"9.0\" -> [\"000000000\"\", \"000000009\"]\n return map(version.split(\".\"), function (chunk) {\n return new Array(20 - chunk.length).join(\"0\") + chunk;\n }).reverse();\n });\n\n // iterate in reverse order by reversed chunks array\n while (--precision >= 0) {\n // 4) compare: \"000000009\" > \"000000010\" = false (but \"9\" > \"10\" = true)\n if (chunks[0][precision] > chunks[1][precision]) {\n return 1;\n }\n else if (chunks[0][precision] === chunks[1][precision]) {\n if (precision === 0) {\n // all version chunks are same\n return 0;\n }\n }\n else {\n return -1;\n }\n }\n }\n\n /**\n * Check if browser is unsupported\n *\n * @example\n * bowser.isUnsupportedBrowser({\n * msie: \"10\",\n * firefox: \"23\",\n * chrome: \"29\",\n * safari: \"5.1\",\n * opera: \"16\",\n * phantom: \"534\"\n * });\n *\n * @param {Object} minVersions map of minimal version to browser\n * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map\n * @param {String} [ua] user agent string\n * @return {Boolean}\n */\n function isUnsupportedBrowser(minVersions, strictMode, ua) {\n var _bowser = bowser;\n\n // make strictMode param optional with ua param usage\n if (typeof strictMode === 'string') {\n ua = strictMode;\n strictMode = void(0);\n }\n\n if (strictMode === void(0)) {\n strictMode = false;\n }\n if (ua) {\n _bowser = detect(ua);\n }\n\n var version = \"\" + _bowser.version;\n for (var browser in minVersions) {\n if (minVersions.hasOwnProperty(browser)) {\n if (_bowser[browser]) {\n if (typeof minVersions[browser] !== 'string') {\n throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions));\n }\n\n // browser version and min supported version.\n return compareVersions([version, minVersions[browser]]) < 0;\n }\n }\n }\n\n return strictMode; // not found\n }\n\n /**\n * Check if browser is supported\n *\n * @param {Object} minVersions map of minimal version to browser\n * @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map\n * @param {String} [ua] user agent string\n * @return {Boolean}\n */\n function check(minVersions, strictMode, ua) {\n return !isUnsupportedBrowser(minVersions, strictMode, ua);\n }\n\n bowser.isUnsupportedBrowser = isUnsupportedBrowser;\n bowser.compareVersions = compareVersions;\n bowser.check = check;\n\n /*\n * Set our detect method to the main bowser object so we can\n * reuse it to test other user agents.\n * This is needed to implement future tests.\n */\n bowser._detect = detect;\n\n return bowser\n});\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ../~/bowser/bowser.js\n ** module id = 1\n ** module chunks = 0\n **/","module.exports = function() { throw new Error(\"define cannot be used indirect\"); };\r\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ../~/webpack/buildin/amd-define.js\n ** module id = 2\n ** module chunks = 0\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 isYaBrowser = 0;\n var isFireFox = 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 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\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.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\n cadesplugin.LOG_LEVEL_DEBUG = 4;\n cadesplugin.LOG_LEVEL_INFO = 2;\n cadesplugin.LOG_LEVEL_ERROR = 1;\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 retVal;\n }\n\n function isIOS() {\n var retVal = (navigator.userAgent.match(/ipod/i) ||\n navigator.userAgent.match(/ipad/i) ||\n navigator.userAgent.match(/iphone/i));\n return retVal;\n }\n\n function isNativeMessageSupported()\n {\n var retVal_chrome = navigator.userAgent.match(/chrome/i);\n isOpera = navigator.userAgent.match(/opr/i);\n isYaBrowser = navigator.userAgent.match(/YaBrowser/i);\n isFireFox = navigator.userAgent.match(/Firefox/i);\n\n if(isFireFox && window.allow_firefox_cadesplugin_async)\n return true;\n\n if(retVal_chrome == null) // В IE работаем через NPAPI\n return false;\n else\n {\n // В Chrome и Opera работаем через асинхронную версию\n if(retVal_chrome.length > 0 || isOpera != null )\n {\n return true;\n }\n }\n return false;\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 создаются через CX509EnrollmentWebClassFactory\n var objCertEnrollClassFactory = document.getElementById(\"certEnrollClassFactory\");\n return objCertEnrollClassFactory.CreateObject(name);\n }\n catch (e) {\n throw(\"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS\");\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 // В Firefox, Safari создаются объекты 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 // Функция активации асинхронных объектов КриптоПро ЭЦП 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 //Выводим окно поверх других с предложением установить расширение для 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_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)\n {\n // Для Firefox вместе с сообщением 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_nmcades_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n\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\n function load_extension()\n {\n\n if(isFireFox){\n // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера.\n nmcades_api_onload();\n return;\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 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(\"iecheck\").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 window.addEventListener(\"load\", function (event) {\n load_npapi_plugin();\n check_npapi_plugin();\n }, false);\n }\n }\n\n function set_pluginObject(obj)\n {\n pluginObject = obj;\n }\n\n //Export\n cadesplugin.JSModuleVersion = \"2.1.0\";\n cadesplugin.async_spawn = async_spawn;\n cadesplugin.set = set_pluginObject;\n cadesplugin.set_log_level = set_log_level;\n cadesplugin.getLastError = getLastError;\n\n if(isNativeMessageSupported())\n {\n cadesplugin.CreateObjectAsync = CreateObjectAsync;\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\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ../vendor/cadesplugin_api.js\n ** module id = 3\n ** module chunks = 0\n **/"],"sourceRoot":""} \ No newline at end of file diff --git a/example/cert-list.js b/example/cert-list.js index 1e78b0f..47bcfff 100644 --- a/example/cert-list.js +++ b/example/cert-list.js @@ -3,6 +3,8 @@ var $certs = document.querySelector('#certList'); + window.CryptoPro.call('isValidEDSSettings'); + /** * Пример получения списка сертификатов * */ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6d84e38..7241487 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,845 +1,2043 @@ { "name": "crypto-pro", "version": "1.0.11", + "lockfileVersion": 1, + "requires": true, "dependencies": { "acorn": { "version": "3.3.0", - "from": "acorn@>=3.0.0 <4.0.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true }, "align-text": { "version": "0.1.4", - "from": "align-text@>=0.1.3 <0.2.0", "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "dev": true + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.1.0", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } }, "amdefine": { "version": "1.0.1", - "from": "amdefine@>=0.0.4", "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", "dev": true }, "anymatch": { "version": "1.3.0", - "from": "anymatch@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", - "dev": true + "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=", + "dev": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "2.3.11" + } }, "arr-diff": { "version": "2.0.0", - "from": "arr-diff@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "dev": true + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.0.1" + } }, "arr-flatten": { "version": "1.0.1", - "from": "arr-flatten@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.1.tgz", + "integrity": "sha1-5f/lTUXhnzLyFukeuZyM6JK7YEs=", "dev": true }, "array-unique": { "version": "0.2.1", - "from": "array-unique@>=0.2.1 <0.3.0", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", "dev": true }, "arrify": { "version": "1.0.1", - "from": "arrify@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "assert": { "version": "1.4.1", - "from": "assert@>=1.1.1 <2.0.0", "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "dev": true + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } }, "async": { "version": "1.5.2", - "from": "async@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "dev": true }, "async-each": { "version": "1.0.1", - "from": "async-each@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", "dev": true }, "balanced-match": { "version": "0.4.2", - "from": "balanced-match@>=0.4.1 <0.5.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", "dev": true }, "Base64": { "version": "0.2.1", - "from": "Base64@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz", + "integrity": "sha1-ujpCMHCOGGcFBl5mur3Uw1z2ACg=", "dev": true }, "base64-js": { "version": "1.2.0", - "from": "base64-js@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", "dev": true }, "big.js": { "version": "3.1.3", - "from": "big.js@>=3.1.3 <4.0.0", "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.1.3.tgz", + "integrity": "sha1-TK2iGTZS6zyp7I5VyQFWacmAaXg=", "dev": true }, "binary-extensions": { "version": "1.8.0", - "from": "binary-extensions@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", + "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=", "dev": true }, "bowser": { "version": "1.5.0", - "from": "bowser@1.5.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.5.0.tgz" + "resolved": "https://registry.npmjs.org/bowser/-/bowser-1.5.0.tgz", + "integrity": "sha1-uXQUusvGMfGfHi4RRmVm7BkySYM=" }, "brace-expansion": { "version": "1.1.6", - "from": "brace-expansion@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "dev": true + "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } }, "braces": { "version": "1.8.5", - "from": "braces@>=1.8.2 <2.0.0", "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "dev": true + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } }, "browserify-zlib": { "version": "0.1.4", - "from": "browserify-zlib@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "dev": true + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } }, "buffer": { "version": "4.9.1", - "from": "buffer@>=4.9.0 <5.0.0", "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", - "dev": true + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "1.2.0", + "ieee754": "1.1.8", + "isarray": "1.0.0" + } }, "buffer-shims": { "version": "1.0.0", - "from": "buffer-shims@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", + "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=", "dev": true }, "camelcase": { "version": "1.2.1", - "from": "camelcase@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", "dev": true }, "center-align": { "version": "0.1.3", - "from": "center-align@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "dev": true + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } }, "chokidar": { "version": "1.6.1", - "from": "chokidar@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.6.1.tgz", - "dev": true + "integrity": "sha1-L0RHq16W5Q+z14n9kNTHLg5McMI=", + "dev": true, + "requires": { + "anymatch": "1.3.0", + "async-each": "1.0.1", + "fsevents": "1.1.3", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + } }, "cliui": { "version": "2.1.0", - "from": "cliui@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, "dependencies": { "wordwrap": { "version": "0.0.2", - "from": "wordwrap@0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", "dev": true } } }, "clone": { "version": "1.0.2", - "from": "clone@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", "dev": true }, "concat-map": { "version": "0.0.1", - "from": "concat-map@0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-browserify": { "version": "1.1.0", - "from": "console-browserify@>=1.1.0 <2.0.0", "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "dev": true + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } }, "constants-browserify": { "version": "0.0.1", - "from": "constants-browserify@0.0.1", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-0.0.1.tgz", + "integrity": "sha1-kld9tSe6bEzwpFaNhLwDH0QeIfI=", "dev": true }, "core-util-is": { "version": "1.0.2", - "from": "core-util-is@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, "crypto-browserify": { "version": "3.2.8", - "from": "crypto-browserify@>=3.2.6 <3.3.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.2.8.tgz", - "dev": true + "integrity": "sha1-ubEdvm2WUd2IKgHmzEZ99xjs8Yk=", + "dev": true, + "requires": { + "pbkdf2-compat": "2.0.1", + "ripemd160": "0.2.0", + "sha.js": "2.2.6" + } }, "date-now": { "version": "0.1.4", - "from": "date-now@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", "dev": true }, "decamelize": { "version": "1.2.0", - "from": "decamelize@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "domain-browser": { "version": "1.1.7", - "from": "domain-browser@>=1.1.1 <2.0.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", "dev": true }, "emojis-list": { "version": "2.1.0", - "from": "emojis-list@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, "enhanced-resolve": { "version": "0.9.1", - "from": "enhanced-resolve@>=0.9.0 <0.10.0", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", + "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=", "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "memory-fs": "0.2.0", + "tapable": "0.1.10" + }, "dependencies": { "memory-fs": { "version": "0.2.0", - "from": "memory-fs@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", + "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=", "dev": true } } }, "errno": { "version": "0.1.4", - "from": "errno@>=0.1.3 <0.2.0", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", - "dev": true + "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=", + "dev": true, + "requires": { + "prr": "0.0.0" + } }, "events": { "version": "1.1.1", - "from": "events@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", "dev": true }, "expand-brackets": { "version": "0.1.5", - "from": "expand-brackets@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "dev": true + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } }, "expand-range": { "version": "1.8.2", - "from": "expand-range@>=1.8.1 <2.0.0", "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "dev": true + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } }, "extglob": { "version": "0.3.2", - "from": "extglob@>=0.3.1 <0.4.0", "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "dev": true + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } }, "filename-regex": { "version": "2.0.0", - "from": "filename-regex@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.0.tgz", + "integrity": "sha1-mW4+gEebmLmJfxWopYs9CE6SZ3U=", "dev": true }, "fill-range": { "version": "2.2.3", - "from": "fill-range@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "dev": true + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.6", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } }, "for-in": { "version": "0.1.6", - "from": "for-in@>=0.1.5 <0.2.0", "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.6.tgz", + "integrity": "sha1-yfluib+tGKVFr17D7TUqHZ5bTcg=", "dev": true }, "for-own": { "version": "0.1.4", - "from": "for-own@>=0.1.4 <0.2.0", "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.4.tgz", - "dev": true + "integrity": "sha1-AUm0GjkIjHUV9R6+HBOG1F+TUHI=", + "dev": true, + "requires": { + "for-in": "0.1.6" + } + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } }, "glob-base": { "version": "0.3.0", - "from": "glob-base@>=0.3.0 <0.4.0", "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "dev": true + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } }, "glob-parent": { "version": "2.0.0", - "from": "glob-parent@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "dev": true + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } }, "graceful-fs": { "version": "4.1.11", - "from": "graceful-fs@>=4.1.2 <5.0.0", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, "has-flag": { "version": "1.0.0", - "from": "has-flag@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, "http-browserify": { "version": "1.7.0", - "from": "http-browserify@>=1.3.2 <2.0.0", "resolved": "https://registry.npmjs.org/http-browserify/-/http-browserify-1.7.0.tgz", - "dev": true + "integrity": "sha1-M3la3nLfiKz7/TZ3PO/tp2RzWyA=", + "dev": true, + "requires": { + "Base64": "0.2.1", + "inherits": "2.0.3" + } }, "https-browserify": { "version": "0.0.0", - "from": "https-browserify@0.0.0", "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.0.tgz", + "integrity": "sha1-s//f5zSyo9Sp79WOhlTJH86G6v0=", "dev": true }, "ieee754": { "version": "1.1.8", - "from": "ieee754@>=1.1.4 <2.0.0", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", "dev": true }, "indexof": { "version": "0.0.1", - "from": "indexof@0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", "dev": true }, "inherits": { "version": "2.0.3", - "from": "inherits@>=2.0.1 <2.1.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "interpret": { "version": "0.6.6", - "from": "interpret@>=0.6.4 <0.7.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", + "integrity": "sha1-/s16GOfOXKar+5U+H4YhOknxYls=", "dev": true }, "is-binary-path": { "version": "1.0.1", - "from": "is-binary-path@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "dev": true + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.8.0" + } }, "is-buffer": { "version": "1.1.4", - "from": "is-buffer@>=1.0.2 <2.0.0", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.4.tgz", + "integrity": "sha1-z8hszV3FpS+oBIkRHGkgxFfi2Ys=", "dev": true }, "is-dotfile": { "version": "1.0.2", - "from": "is-dotfile@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.2.tgz", + "integrity": "sha1-LBMjg/ORmfjtwmjKAbmwB9IFzE0=", "dev": true }, "is-equal-shallow": { "version": "0.1.3", - "from": "is-equal-shallow@>=0.1.3 <0.2.0", "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "dev": true + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } }, "is-extendable": { "version": "0.1.1", - "from": "is-extendable@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", "dev": true }, "is-extglob": { "version": "1.0.0", - "from": "is-extglob@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", "dev": true }, "is-glob": { "version": "2.0.1", - "from": "is-glob@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "dev": true + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } }, "is-number": { "version": "2.1.0", - "from": "is-number@>=2.1.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "dev": true + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.1.0" + } }, "is-posix-bracket": { "version": "0.1.1", - "from": "is-posix-bracket@>=0.1.0 <0.2.0", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", "dev": true }, "is-primitive": { "version": "2.0.0", - "from": "is-primitive@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, "isarray": { "version": "1.0.0", - "from": "isarray@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, "isobject": { "version": "2.1.0", - "from": "isobject@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "dev": true + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } }, "json5": { "version": "0.5.1", - "from": "json5@>=0.5.0 <0.6.0", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, "kind-of": { "version": "3.1.0", - "from": "kind-of@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.1.0.tgz", - "dev": true + "integrity": "sha1-R11pil5J/15T0U4+cyQp3Iv0z0c=", + "dev": true, + "requires": { + "is-buffer": "1.1.4" + } }, "lazy-cache": { "version": "1.0.4", - "from": "lazy-cache@>=1.0.3 <2.0.0", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", "dev": true }, "loader-utils": { "version": "0.2.16", - "from": "loader-utils@>=0.2.11 <0.3.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.16.tgz", - "dev": true + "integrity": "sha1-8IYyBm7YKCg13/iN+1JwR2Wt7m0=", + "dev": true, + "requires": { + "big.js": "3.1.3", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } }, "longest": { "version": "1.0.1", - "from": "longest@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", "dev": true }, "memory-fs": { "version": "0.3.0", - "from": "memory-fs@>=0.3.0 <0.4.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", - "dev": true + "integrity": "sha1-e8xrYp46Q+hx1+Kaymrop/FcuyA=", + "dev": true, + "requires": { + "errno": "0.1.4", + "readable-stream": "2.2.2" + } }, "micromatch": { "version": "2.3.11", - "from": "micromatch@>=2.1.5 <3.0.0", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "dev": true + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.0", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.1.0", + "normalize-path": "2.0.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.3" + } }, "minimatch": { "version": "3.0.3", - "from": "minimatch@>=3.0.2 <4.0.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "dev": true + "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "dev": true, + "requires": { + "brace-expansion": "1.1.6" + } }, "minimist": { "version": "0.0.8", - "from": "minimist@0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", - "from": "mkdirp@>=0.5.0 <0.6.0", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "dev": true + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": true }, "node-libs-browser": { "version": "0.6.0", - "from": "node-libs-browser@>=0.6.0 <0.7.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.6.0.tgz", + "integrity": "sha1-JEgG1E0xngSLyGB7XMTq+aKdLjw=", "dev": true, + "requires": { + "assert": "1.4.1", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "console-browserify": "1.1.0", + "constants-browserify": "0.0.1", + "crypto-browserify": "3.2.8", + "domain-browser": "1.1.7", + "events": "1.1.1", + "http-browserify": "1.7.0", + "https-browserify": "0.0.0", + "os-browserify": "0.1.2", + "path-browserify": "0.0.0", + "process": "0.11.9", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "readable-stream": "1.1.14", + "stream-browserify": "1.0.0", + "string_decoder": "0.10.31", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.10.3", + "util": "0.10.3", + "vm-browserify": "0.0.4" + }, "dependencies": { "isarray": { "version": "0.0.1", - "from": "isarray@0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { "version": "1.1.14", - "from": "readable-stream@>=1.1.13 <2.0.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "dev": true + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } } } }, "normalize-path": { "version": "2.0.1", - "from": "normalize-path@>=2.0.1 <3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz", + "integrity": "sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o=", "dev": true }, "object-assign": { "version": "4.1.1", - "from": "object-assign@>=4.0.1 <5.0.0", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, "object.omit": { "version": "2.0.1", - "from": "object.omit@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "dev": true + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.4", + "is-extendable": "0.1.1" + } }, "optimist": { "version": "0.6.1", - "from": "optimist@>=0.6.0 <0.7.0", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "dev": true + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + } }, "os-browserify": { "version": "0.1.2", - "from": "os-browserify@>=0.1.2 <0.2.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", "dev": true }, "pako": { "version": "0.2.9", - "from": "pako@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", "dev": true }, "parse-glob": { "version": "3.0.4", - "from": "parse-glob@>=3.0.4 <4.0.0", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "dev": true + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.2", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } }, "path-browserify": { "version": "0.0.0", - "from": "path-browserify@0.0.0", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, "path-is-absolute": { "version": "1.0.1", - "from": "path-is-absolute@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, "pbkdf2-compat": { "version": "2.0.1", - "from": "pbkdf2-compat@2.0.1", "resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz", + "integrity": "sha1-tuDI+plJTZTgURV1gCpZpcFC8og=", "dev": true }, "preserve": { "version": "0.2.0", - "from": "preserve@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, "process": { "version": "0.11.9", - "from": "process@>=0.11.0 <0.12.0", "resolved": "https://registry.npmjs.org/process/-/process-0.11.9.tgz", + "integrity": "sha1-e9WtIapiU+fahoImTx4R0RwDGME=", "dev": true }, "process-nextick-args": { "version": "1.0.7", - "from": "process-nextick-args@>=1.0.6 <1.1.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", "dev": true }, "prr": { "version": "0.0.0", - "from": "prr@>=0.0.0 <0.1.0", "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", "dev": true }, "punycode": { "version": "1.4.1", - "from": "punycode@>=1.2.4 <2.0.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true }, "querystring": { "version": "0.2.0", - "from": "querystring@0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", "dev": true }, "querystring-es3": { "version": "0.2.1", - "from": "querystring-es3@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, "randomatic": { "version": "1.1.6", - "from": "randomatic@>=1.1.3 <2.0.0", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.6.tgz", - "dev": true + "integrity": "sha1-EQ3Kv/OX6dz/fAeJzMCkmt8exbs=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "kind-of": "3.1.0" + } }, "readable-stream": { "version": "2.2.2", - "from": "readable-stream@>=2.0.1 <3.0.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz", - "dev": true + "integrity": "sha1-qeb+w8fdqF+LsbO6cChgRVb8gl4=", + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } }, "readdirp": { "version": "2.1.0", - "from": "readdirp@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "dev": true + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.3", + "readable-stream": "2.2.2", + "set-immediate-shim": "1.0.1" + } }, "regex-cache": { "version": "0.4.3", - "from": "regex-cache@>=0.4.2 <0.5.0", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "dev": true + "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3", + "is-primitive": "2.0.0" + } }, "repeat-element": { "version": "1.1.2", - "from": "repeat-element@>=1.1.2 <2.0.0", "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", "dev": true }, "repeat-string": { "version": "1.6.1", - "from": "repeat-string@>=1.5.2 <2.0.0", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", "dev": true }, "right-align": { "version": "0.1.3", - "from": "right-align@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "dev": true + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "0.1.4" + } }, "ripemd160": { "version": "0.2.0", - "from": "ripemd160@0.2.0", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", + "integrity": "sha1-K/GYveFnys+lHAqSjoS2i74XH84=", "dev": true }, "set-immediate-shim": { "version": "1.0.1", - "from": "set-immediate-shim@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, "sha.js": { "version": "2.2.6", - "from": "sha.js@2.2.6", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz", + "integrity": "sha1-F93t3F9yL7ZlAWWIlUYZd4ZzFbo=", "dev": true }, "source-list-map": { "version": "0.1.8", - "from": "source-list-map@>=0.1.7 <0.2.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", + "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", "dev": true }, "source-map": { "version": "0.5.6", - "from": "source-map@>=0.5.1 <0.6.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.6.tgz", + "integrity": "sha1-dc449SvwczxafwwRjYEzSiu19BI=", "dev": true }, "stream-browserify": { "version": "1.0.0", - "from": "stream-browserify@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-1.0.0.tgz", + "integrity": "sha1-v5tKv7QrJ011FHnkTg/yZWtvEZM=", "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "1.1.14" + }, "dependencies": { "isarray": { "version": "0.0.1", - "from": "isarray@0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", "dev": true }, "readable-stream": { "version": "1.1.14", - "from": "readable-stream@>=1.0.27-1 <2.0.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "dev": true + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } } } }, "string_decoder": { "version": "0.10.31", - "from": "string_decoder@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, "supports-color": { "version": "3.2.3", - "from": "supports-color@>=3.1.0 <4.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "dev": true + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } }, "tapable": { "version": "0.1.10", - "from": "tapable@>=0.1.8 <0.2.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", + "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", "dev": true }, "timers-browserify": { "version": "1.4.2", - "from": "timers-browserify@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "dev": true + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "0.11.9" + } }, "tty-browserify": { "version": "0.0.0", - "from": "tty-browserify@0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, "uglify-js": { "version": "2.6.4", - "from": "uglify-js@>=2.6.0 <2.7.0", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.6.4.tgz", + "integrity": "sha1-ZeovswWck5RpLxX+2HwrNsFrmt8=", "dev": true, + "requires": { + "async": "0.2.10", + "source-map": "0.5.6", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, "dependencies": { "async": { "version": "0.2.10", - "from": "async@>=0.2.6 <0.3.0", "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", "dev": true } } }, "uglify-to-browserify": { "version": "1.0.2", - "from": "uglify-to-browserify@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", "dev": true }, "url": { "version": "0.10.3", - "from": "url@>=0.10.1 <0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, "dependencies": { "punycode": { "version": "1.3.2", - "from": "punycode@1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", "dev": true } } }, "util": { "version": "0.10.3", - "from": "util@>=0.10.3 <0.11.0", "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, + "requires": { + "inherits": "2.0.1" + }, "dependencies": { "inherits": { "version": "2.0.1", - "from": "inherits@2.0.1", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", "dev": true } } }, "util-deprecate": { "version": "1.0.2", - "from": "util-deprecate@>=1.0.1 <1.1.0", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, "vm-browserify": { "version": "0.0.4", - "from": "vm-browserify@0.0.4", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "dev": true + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } }, "watchpack": { "version": "0.2.9", - "from": "watchpack@>=0.2.1 <0.3.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-0.2.9.tgz", + "integrity": "sha1-Yuqkq15bo1/fwBgnVibjwPXj+ws=", "dev": true, + "requires": { + "async": "0.9.2", + "chokidar": "1.6.1", + "graceful-fs": "4.1.11" + }, "dependencies": { "async": { "version": "0.9.2", - "from": "async@>=0.9.0 <0.10.0", "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", "dev": true } } }, "webpack": { "version": "1.13.2", - "from": "webpack@1.13.2", "resolved": "https://registry.npmjs.org/webpack/-/webpack-1.13.2.tgz", - "dev": true + "integrity": "sha1-8RqW9FjrdSlwqGq+dGwHBPq6+vM=", + "dev": true, + "requires": { + "acorn": "3.3.0", + "async": "1.5.2", + "clone": "1.0.2", + "enhanced-resolve": "0.9.1", + "interpret": "0.6.6", + "loader-utils": "0.2.16", + "memory-fs": "0.3.0", + "mkdirp": "0.5.1", + "node-libs-browser": "0.6.0", + "optimist": "0.6.1", + "supports-color": "3.2.3", + "tapable": "0.1.10", + "uglify-js": "2.6.4", + "watchpack": "0.2.9", + "webpack-core": "0.6.9" + } }, "webpack-core": { "version": "0.6.9", - "from": "webpack-core@>=0.6.0 <0.7.0", "resolved": "https://registry.npmjs.org/webpack-core/-/webpack-core-0.6.9.tgz", + "integrity": "sha1-/FcViMhVjad76e+23r3Fo7FyvcI=", "dev": true, + "requires": { + "source-list-map": "0.1.8", + "source-map": "0.4.4" + }, "dependencies": { "source-map": { "version": "0.4.4", - "from": "source-map@>=0.4.1 <0.5.0", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "dev": true + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } } } }, "window-size": { "version": "0.1.0", - "from": "window-size@0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", "dev": true }, "wordwrap": { "version": "0.0.3", - "from": "wordwrap@>=0.0.2 <0.1.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", "dev": true }, "yargs": { "version": "3.10.0", - "from": "yargs@>=3.10.0 <3.11.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "dev": true + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } } } } diff --git a/src/apiAsync.js b/src/apiAsync.js index 32d2551..2fa4779 100755 --- a/src/apiAsync.js +++ b/src/apiAsync.js @@ -169,11 +169,11 @@ Certificate.prototype.hasExtendedKeyUsage = cryptoCommon.hasExtendedKeyUsage; * */ function isValidEDSSettings() { return new Promise(function (resolve, reject) { - cadesplugin.async_spawn(function* () { + cryptoCommon.execute(function () { var result; try { - result = yield cadesplugin.CreateObjectAsync('CAdESCOM.About'); + result = cryptoCommon.createObj('CAdESCOM.About'); } catch (error) { reject('Настройки ЭП на данной машине не верны'); } diff --git a/src/common.js b/src/common.js index d440614..59adc50 100755 --- a/src/common.js +++ b/src/common.js @@ -37,6 +37,28 @@ var subjectNameTagsTranslations = [ {possibleNames: ['L'], translation: 'Город'} ]; +function execute(cb) { + if (cadesplugin.CreateObjectAsync) { + var GeneratorFunction = (new Function('', 'return Object.getPrototypeOf(function*(){}).constructor'))(); + + cb = String(cb); + + var args = cb.match(/^function\s*?\((.*?)\)/); + + args = (args && args[1]) || ''; + + cb = cb.replace(/^.*?{([\s\S]*?)}$/, '$1'); + + cadesplugin.async_spawn(new GeneratorFunction(args, cb)); + } +} + +function createObj(type) { + if (cadesplugin.CreateObjectAsync) { + return (new Function('', 'return yield cadesplugin.CreateObjectAsync(' + type + ')'))(); + } +} + /** * Парсит информацию из строки с информацией о сертификате * */ @@ -264,6 +286,8 @@ function isValidCadesVersion(version) { } module.exports = { + execute: execute, + createObj: createObj, subjectNameTagsTranslations: subjectNameTagsTranslations, issuerNameTagsTranslations: issuerNameTagsTranslations, parseCertInfo: parseCertInfo,