From 6d96ca5182afdd1264432cb71182a5388b9bef37 Mon Sep 17 00:00:00 2001 From: vgoma Date: Sun, 29 Mar 2020 10:05:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20bower=20=D1=81=D0=B1=D0=BE?= =?UTF-8?q?=D1=80=D0=BA=D0=B0=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D0=BE=D0=B4=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D1=8C=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=B0=D0=B2=D0=BB=D0=B8=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=20=D0=BD=D0=B0?= =?UTF-8?q?=D0=BF=D1=80=D1=8F=D0=BC=D1=83=D1=8E=20=D1=81=20github?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 - dist/api/certificate/certificate.d.ts | 22 + dist/api/certificate/exportBase64.d.ts | 6 + dist/api/certificate/getAlgorithm.d.ts | 11 + dist/api/certificate/getCadesProp.d.ts | 7 + .../getDecodedExtendedKeyUsage.d.ts | 9 + dist/api/certificate/getExtendedKeyUsage.d.ts | 6 + dist/api/certificate/getInfo.d.ts | 10 + dist/api/certificate/hasExtendedKeyUsage.d.ts | 7 + dist/api/certificate/index.d.ts | 1 + dist/api/certificate/isValid.d.ts | 6 + dist/api/createSignature.d.ts | 9 + dist/api/getCertificate.d.ts | 8 + dist/api/getSystemInfo.d.ts | 10 + dist/api/getUserCertificates.d.ts | 8 + dist/api/index.d.ts | 6 + dist/api/isValidSystemSetup.d.ts | 6 + dist/constants/cades-constants.d.ts | 149 + dist/constants/index.d.ts | 4 + dist/constants/issuer-tags-translations.d.ts | 2 + dist/constants/oids-dictionary.d.ts | 44 + dist/constants/subject-tags-translations.d.ts | 2 + dist/constants/tags-translations.d.ts | 4 + dist/crypto-pro.d.ts | 7 + dist/crypto-pro.js | 2530 +++++++++++++++++ dist/crypto-pro.js.map | 1 + dist/crypto-pro.min.js | 2 + dist/crypto-pro.min.js.map | 1 + dist/helpers/_afterPluginsLoaded.d.ts | 3 + dist/helpers/_extractCommonName.d.ts | 1 + .../_extractMeaningfulErrorMessage.d.ts | 1 + dist/helpers/_generateCadesFn.d.ts | 3 + dist/helpers/_getCadesCert.d.ts | 7 + dist/helpers/_getDateObj.d.ts | 7 + dist/helpers/_isSupportedCSPVersion.d.ts | 1 + dist/helpers/_isSupportedCadesVersion.d.ts | 1 + dist/helpers/_parseCertInfo.d.ts | 14 + lib/api/certificate/certificate.d.ts | 22 + lib/api/certificate/exportBase64.d.ts | 6 + lib/api/certificate/getAlgorithm.d.ts | 11 + lib/api/certificate/getCadesProp.d.ts | 7 + .../getDecodedExtendedKeyUsage.d.ts | 9 + lib/api/certificate/getExtendedKeyUsage.d.ts | 6 + lib/api/certificate/getInfo.d.ts | 10 + lib/api/certificate/hasExtendedKeyUsage.d.ts | 7 + lib/api/certificate/index.d.ts | 1 + lib/api/certificate/isValid.d.ts | 6 + lib/api/createSignature.d.ts | 9 + lib/api/getCertificate.d.ts | 8 + lib/api/getSystemInfo.d.ts | 10 + lib/api/getUserCertificates.d.ts | 8 + lib/api/index.d.ts | 6 + lib/api/isValidSystemSetup.d.ts | 6 + lib/constants/cades-constants.d.ts | 149 + lib/constants/index.d.ts | 4 + lib/constants/issuer-tags-translations.d.ts | 2 + lib/constants/oids-dictionary.d.ts | 44 + lib/constants/subject-tags-translations.d.ts | 2 + lib/constants/tags-translations.d.ts | 4 + lib/crypto-pro.d.ts | 5 + lib/crypto-pro.js | 2257 +++++++++++++++ lib/crypto-pro.js.map | 1 + lib/helpers/_afterPluginsLoaded.d.ts | 3 + lib/helpers/_extractCommonName.d.ts | 1 + .../_extractMeaningfulErrorMessage.d.ts | 1 + lib/helpers/_generateCadesFn.d.ts | 3 + lib/helpers/_getCadesCert.d.ts | 7 + lib/helpers/_getDateObj.d.ts | 7 + lib/helpers/_isSupportedCSPVersion.d.ts | 1 + lib/helpers/_isSupportedCadesVersion.d.ts | 1 + lib/helpers/_parseCertInfo.d.ts | 14 + 71 files changed, 5554 insertions(+), 2 deletions(-) create mode 100644 dist/api/certificate/certificate.d.ts create mode 100644 dist/api/certificate/exportBase64.d.ts create mode 100644 dist/api/certificate/getAlgorithm.d.ts create mode 100644 dist/api/certificate/getCadesProp.d.ts create mode 100644 dist/api/certificate/getDecodedExtendedKeyUsage.d.ts create mode 100644 dist/api/certificate/getExtendedKeyUsage.d.ts create mode 100644 dist/api/certificate/getInfo.d.ts create mode 100644 dist/api/certificate/hasExtendedKeyUsage.d.ts create mode 100644 dist/api/certificate/index.d.ts create mode 100644 dist/api/certificate/isValid.d.ts create mode 100644 dist/api/createSignature.d.ts create mode 100644 dist/api/getCertificate.d.ts create mode 100644 dist/api/getSystemInfo.d.ts create mode 100644 dist/api/getUserCertificates.d.ts create mode 100644 dist/api/index.d.ts create mode 100644 dist/api/isValidSystemSetup.d.ts create mode 100644 dist/constants/cades-constants.d.ts create mode 100644 dist/constants/index.d.ts create mode 100644 dist/constants/issuer-tags-translations.d.ts create mode 100644 dist/constants/oids-dictionary.d.ts create mode 100644 dist/constants/subject-tags-translations.d.ts create mode 100644 dist/constants/tags-translations.d.ts create mode 100644 dist/crypto-pro.d.ts create mode 100644 dist/crypto-pro.js create mode 100644 dist/crypto-pro.js.map create mode 100644 dist/crypto-pro.min.js create mode 100644 dist/crypto-pro.min.js.map create mode 100644 dist/helpers/_afterPluginsLoaded.d.ts create mode 100644 dist/helpers/_extractCommonName.d.ts create mode 100644 dist/helpers/_extractMeaningfulErrorMessage.d.ts create mode 100644 dist/helpers/_generateCadesFn.d.ts create mode 100644 dist/helpers/_getCadesCert.d.ts create mode 100644 dist/helpers/_getDateObj.d.ts create mode 100644 dist/helpers/_isSupportedCSPVersion.d.ts create mode 100644 dist/helpers/_isSupportedCadesVersion.d.ts create mode 100644 dist/helpers/_parseCertInfo.d.ts create mode 100644 lib/api/certificate/certificate.d.ts create mode 100644 lib/api/certificate/exportBase64.d.ts create mode 100644 lib/api/certificate/getAlgorithm.d.ts create mode 100644 lib/api/certificate/getCadesProp.d.ts create mode 100644 lib/api/certificate/getDecodedExtendedKeyUsage.d.ts create mode 100644 lib/api/certificate/getExtendedKeyUsage.d.ts create mode 100644 lib/api/certificate/getInfo.d.ts create mode 100644 lib/api/certificate/hasExtendedKeyUsage.d.ts create mode 100644 lib/api/certificate/index.d.ts create mode 100644 lib/api/certificate/isValid.d.ts create mode 100644 lib/api/createSignature.d.ts create mode 100644 lib/api/getCertificate.d.ts create mode 100644 lib/api/getSystemInfo.d.ts create mode 100644 lib/api/getUserCertificates.d.ts create mode 100644 lib/api/index.d.ts create mode 100644 lib/api/isValidSystemSetup.d.ts create mode 100644 lib/constants/cades-constants.d.ts create mode 100644 lib/constants/index.d.ts create mode 100644 lib/constants/issuer-tags-translations.d.ts create mode 100644 lib/constants/oids-dictionary.d.ts create mode 100644 lib/constants/subject-tags-translations.d.ts create mode 100644 lib/constants/tags-translations.d.ts create mode 100644 lib/crypto-pro.d.ts create mode 100644 lib/crypto-pro.js create mode 100644 lib/crypto-pro.js.map create mode 100644 lib/helpers/_afterPluginsLoaded.d.ts create mode 100644 lib/helpers/_extractCommonName.d.ts create mode 100644 lib/helpers/_extractMeaningfulErrorMessage.d.ts create mode 100644 lib/helpers/_generateCadesFn.d.ts create mode 100644 lib/helpers/_getCadesCert.d.ts create mode 100644 lib/helpers/_getDateObj.d.ts create mode 100644 lib/helpers/_isSupportedCSPVersion.d.ts create mode 100644 lib/helpers/_isSupportedCadesVersion.d.ts create mode 100644 lib/helpers/_parseCertInfo.d.ts diff --git a/.gitignore b/.gitignore index b17d3e5..01dbc1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ .idea node_modules/ -lib/ -dist/ package/ coverage/ diff --git a/dist/api/certificate/certificate.d.ts b/dist/api/certificate/certificate.d.ts new file mode 100644 index 0000000..5bddd6b --- /dev/null +++ b/dist/api/certificate/certificate.d.ts @@ -0,0 +1,22 @@ +import { TagTranslation } from '../../helpers/_parseCertInfo'; +import { ExtendedKeysTranslations } from './getDecodedExtendedKeyUsage'; +export declare type CadesCertificate = any; +export declare class Certificate { + _cadesCertificate: CadesCertificate; + name: string; + issuerName: string; + subjectName: string; + thumbprint: string; + validFrom: string; + validTo: string; + constructor(_cadesCertificate: CadesCertificate, name: string, issuerName: string, subjectName: string, thumbprint: string, validFrom: string, validTo: string); + getOwnerInfo(): Promise; + getIssuerInfo(): Promise; + getExtendedKeyUsage(): Promise; + getDecodedExtendedKeyUsage(): Promise; + getAlgorithm(): Promise; + getCadesProp(propName: any): Promise; + isValid(): Promise; + exportBase64(): Promise; + hasExtendedKeyUsage(oids: any): Promise; +} diff --git a/dist/api/certificate/exportBase64.d.ts b/dist/api/certificate/exportBase64.d.ts new file mode 100644 index 0000000..e531560 --- /dev/null +++ b/dist/api/certificate/exportBase64.d.ts @@ -0,0 +1,6 @@ +/** + * Экспортирует сертификат в формате base64 + * + * @returns сертификат в формате base64 + */ +export declare const exportBase64: () => Promise; diff --git a/dist/api/certificate/getAlgorithm.d.ts b/dist/api/certificate/getAlgorithm.d.ts new file mode 100644 index 0000000..79f94da --- /dev/null +++ b/dist/api/certificate/getAlgorithm.d.ts @@ -0,0 +1,11 @@ +interface AlgorithmInfo { + algorithm: string; + oid: string; +} +/** + * Возвращает информацию об алгоритме сертификата + * + * @returns информацию об алгоритме и его OID'е + */ +export declare const getAlgorithm: () => Promise; +export {}; diff --git a/dist/api/certificate/getCadesProp.d.ts b/dist/api/certificate/getCadesProp.d.ts new file mode 100644 index 0000000..0ff1c59 --- /dev/null +++ b/dist/api/certificate/getCadesProp.d.ts @@ -0,0 +1,7 @@ +/** + * Возвращает указанное внутренее свойство у сертификата в формате Cades + * + * @param propName = наименование свойства + * @returns значение запрошенного свойства + */ +export declare const getCadesProp: (propName: string) => Promise; diff --git a/dist/api/certificate/getDecodedExtendedKeyUsage.d.ts b/dist/api/certificate/getDecodedExtendedKeyUsage.d.ts new file mode 100644 index 0000000..478f67b --- /dev/null +++ b/dist/api/certificate/getDecodedExtendedKeyUsage.d.ts @@ -0,0 +1,9 @@ +export interface ExtendedKeysTranslations { + [key: string]: string | null; +} +/** + * Возвращает расшифрованные ОИД'ы сертификата + * + * @returns словарь расшифрованных ОИД'ов + */ +export declare const getDecodedExtendedKeyUsage: () => Promise; diff --git a/dist/api/certificate/getExtendedKeyUsage.d.ts b/dist/api/certificate/getExtendedKeyUsage.d.ts new file mode 100644 index 0000000..fe83e38 --- /dev/null +++ b/dist/api/certificate/getExtendedKeyUsage.d.ts @@ -0,0 +1,6 @@ +/** + * Возвращает ОИД'ы сертификата + * + * @returns список ОИД'ов + */ +export declare const getExtendedKeyUsage: () => Promise; diff --git a/dist/api/certificate/getInfo.d.ts b/dist/api/certificate/getInfo.d.ts new file mode 100644 index 0000000..84a34b4 --- /dev/null +++ b/dist/api/certificate/getInfo.d.ts @@ -0,0 +1,10 @@ +import { TagsTranslations } from '../../constants/tags-translations'; +import { TagTranslation } from '../../helpers/_parseCertInfo'; +/** + * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам + * + * @param tags = словарь + * @param entitiesPath = путь к разбираемой сущности + * @returns расшифрованная информация по отдельным тэгам + */ +export declare const getInfo: (tags: TagsTranslations[], entitiesPath: string) => Promise; diff --git a/dist/api/certificate/hasExtendedKeyUsage.d.ts b/dist/api/certificate/hasExtendedKeyUsage.d.ts new file mode 100644 index 0000000..dbd41ef --- /dev/null +++ b/dist/api/certificate/hasExtendedKeyUsage.d.ts @@ -0,0 +1,7 @@ +/** + * Проверяет наличие ОИД'а (ОИД'ов) у сертификата + * + * @param oids - ОИД'ы для проверки + * @returns флаг наличия ОИД'ов у сертификата + */ +export declare const hasExtendedKeyUsage: (oids: string | string[]) => Promise; diff --git a/dist/api/certificate/index.d.ts b/dist/api/certificate/index.d.ts new file mode 100644 index 0000000..cea7596 --- /dev/null +++ b/dist/api/certificate/index.d.ts @@ -0,0 +1 @@ +export * from './certificate'; diff --git a/dist/api/certificate/isValid.d.ts b/dist/api/certificate/isValid.d.ts new file mode 100644 index 0000000..69814c8 --- /dev/null +++ b/dist/api/certificate/isValid.d.ts @@ -0,0 +1,6 @@ +/** + * Проверяет действительность сертификата + * + * @returns флаг валидности + */ +export declare const isValid: () => Promise; diff --git a/dist/api/createSignature.d.ts b/dist/api/createSignature.d.ts new file mode 100644 index 0000000..29bc69e --- /dev/null +++ b/dist/api/createSignature.d.ts @@ -0,0 +1,9 @@ +/** + * Создает подпись base64 строки по отпечатку сертификата + * + * @param thumbprint - отпечаток сертификата + * @param dataBase64 - строковые данные в формате base64 + * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false) + * @returns подпись + */ +export declare const createSignature: (thumbprint: string, dataBase64: string, detachedSignature?: boolean) => Promise; diff --git a/dist/api/getCertificate.d.ts b/dist/api/getCertificate.d.ts new file mode 100644 index 0000000..8213f30 --- /dev/null +++ b/dist/api/getCertificate.d.ts @@ -0,0 +1,8 @@ +import { Certificate } from './certificate'; +/** + * Возвращает сертификат по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат + */ +export declare const getCertificate: (thumbprint: string) => Promise; diff --git a/dist/api/getSystemInfo.d.ts b/dist/api/getSystemInfo.d.ts new file mode 100644 index 0000000..9d39042 --- /dev/null +++ b/dist/api/getSystemInfo.d.ts @@ -0,0 +1,10 @@ +export interface SystemInfo { + cadesVersion: string; + cspVersion: string; +} +/** + * Предоставляет информацию о системе + * + * @returns информацию о CSP и плагине + */ +export declare const getSystemInfo: () => Promise; diff --git a/dist/api/getUserCertificates.d.ts b/dist/api/getUserCertificates.d.ts new file mode 100644 index 0000000..571f403 --- /dev/null +++ b/dist/api/getUserCertificates.d.ts @@ -0,0 +1,8 @@ +import { Certificate } from './certificate'; +/** + * Возвращает список сертификатов, доступных пользователю в системе + * + * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов + * @returns список сертификатов + */ +export declare const getUserCertificates: (resetCache?: boolean) => Promise; diff --git a/dist/api/index.d.ts b/dist/api/index.d.ts new file mode 100644 index 0000000..2fd4070 --- /dev/null +++ b/dist/api/index.d.ts @@ -0,0 +1,6 @@ +export * from './getCertificate'; +export * from './getUserCertificates'; +export * from './getSystemInfo'; +export * from './isValidSystemSetup'; +export * from './createSignature'; +export * from './certificate'; diff --git a/dist/api/isValidSystemSetup.d.ts b/dist/api/isValidSystemSetup.d.ts new file mode 100644 index 0000000..5b3afaf --- /dev/null +++ b/dist/api/isValidSystemSetup.d.ts @@ -0,0 +1,6 @@ +/** + * Проверяет корректность настроек ЭП на машине + * + * @returns флаг корректности настроек + */ +export declare const isValidSystemSetup: () => Promise; diff --git a/dist/constants/cades-constants.d.ts b/dist/constants/cades-constants.d.ts new file mode 100644 index 0000000..8e36560 --- /dev/null +++ b/dist/constants/cades-constants.d.ts @@ -0,0 +1,149 @@ +export declare const CADESCOM_ATTRIBUTE_OTHER = -1; +export declare const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +export declare const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +export declare const CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +export declare const CADESCOM_AllowNoOutstandingRequest = 1; +export declare const CADESCOM_AllowNone = 0; +export declare const CADESCOM_AllowUntrustedCertificate = 2; +export declare const CADESCOM_AllowUntrustedRoot = 4; +export declare const CADESCOM_BASE64_TO_BINARY = 1; +export declare const CADESCOM_CADES_BES = 1; +export declare const CADESCOM_CADES_DEFAULT = 0; +export declare const CADESCOM_CADES_T = 5; +export declare const CADESCOM_CADES_X_LONG_TYPE_1 = 93; +export declare const CADESCOM_CONTAINER_STORE = 100; +export declare const CADESCOM_CURRENT_USER_STORE = 2; +export declare const CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2; +export declare const CADESCOM_DISPLAY_DATA_CONTENT = 1; +export declare const CADESCOM_DISPLAY_DATA_NONE = 0; +export declare const CADESCOM_ENCODE_ANY = -1; +export declare const CADESCOM_ENCODE_BASE64 = 0; +export declare const CADESCOM_ENCODE_BINARY = 1; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110; +export declare const CADESCOM_HASH_ALGORITHM_MD2 = 1; +export declare const CADESCOM_HASH_ALGORITHM_MD4 = 2; +export declare const CADESCOM_HASH_ALGORITHM_MD5 = 3; +export declare const CADESCOM_HASH_ALGORITHM_SHA1 = 0; +export declare const CADESCOM_HASH_ALGORITHM_SHA_256 = 4; +export declare const CADESCOM_HASH_ALGORITHM_SHA_384 = 5; +export declare const CADESCOM_HASH_ALGORITHM_SHA_512 = 6; +export declare const CADESCOM_LOCAL_MACHINE_STORE = 1; +export declare const CADESCOM_PKCS7_TYPE = 65535; +export declare const CADESCOM_STRING_TO_UCS2LE = 0; +export declare const CADESCOM_SkipInstallToStore = 268435456; +export declare const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0; +export declare const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1; +export declare const CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2; +export declare const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3; +export declare const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +export declare const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +export declare const CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +export declare const CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7; +export declare const CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8; +export declare const CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6; +export declare const CAPICOM_CERTIFICATE_FIND_EXTENSION = 5; +export declare const CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2; +export declare const CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12; +export declare const CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3; +export declare const CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0; +export declare const CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; +export declare const CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4; +export declare const CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11; +export declare const CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10; +export declare const CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9; +export declare const CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0; +export declare const CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2; +export declare const CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1; +export declare const CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1; +export declare const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0; +export declare const CAPICOM_CURRENT_USER_STORE = 2; +export declare const CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128; +export declare const CAPICOM_EKU_CLIENT_AUTH = 2; +export declare const CAPICOM_EKU_OTHER = 0; +export declare const CAPICOM_EKU_SMARTCARD_LOGON = 5; +export declare const CAPICOM_LOCAL_MACHINE_STORE = 1; +export declare const CAPICOM_MEMORY_STORE = 0; +export declare const CAPICOM_MY_STORE = "My"; +export declare const CAPICOM_OID_KEY_USAGE_EXTENSION = 10; +export declare const CAPICOM_OID_OTHER = 0; +export declare const CAPICOM_PROPID_ACCESS_STATE = 14; +export declare const CAPICOM_PROPID_ARCHIVED = 19; +export declare const CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65; +export declare const CAPICOM_PROPID_AUTO_ENROLL = 21; +export declare const CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23; +export declare const CAPICOM_PROPID_CTL_USAGE = 9; +export declare const CAPICOM_PROPID_DATE_STAMP = 27; +export declare const CAPICOM_PROPID_DESCRIPTION = 13; +export declare const CAPICOM_PROPID_EFS = 17; +export declare const CAPICOM_PROPID_ENHKEY_USAGE = 9; +export declare const CAPICOM_PROPID_ENROLLMENT = 26; +export declare const CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30; +export declare const CAPICOM_PROPID_FIRST_RESERVED = 66; +export declare const CAPICOM_PROPID_FIRST_USER = 32768; +export declare const CAPICOM_PROPID_FORTEZZA_DATA = 18; +export declare const CAPICOM_PROPID_FRIENDLY_NAME = 11; +export declare const CAPICOM_PROPID_HASH_PROP = 3; +export declare const CAPICOM_PROPID_IE30_RESERVED = 7; +export declare const CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24; +export declare const CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28; +export declare const CAPICOM_PROPID_KEY_CONTEXT = 5; +export declare const CAPICOM_PROPID_KEY_IDENTIFIER = 20; +export declare const CAPICOM_PROPID_KEY_PROV_HANDLE = 1; +export declare const CAPICOM_PROPID_KEY_PROV_INFO = 2; +export declare const CAPICOM_PROPID_KEY_SPEC = 6; +export declare const CAPICOM_PROPID_LAST_RESERVED = 32767; +export declare const CAPICOM_PROPID_LAST_USER = 65535; +export declare const CAPICOM_PROPID_MD5_HASH = 4; +export declare const CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10; +export declare const CAPICOM_PROPID_PUBKEY_ALG_PARA = 22; +export declare const CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8; +export declare const CAPICOM_PROPID_PVK_FILE = 12; +export declare const CAPICOM_PROPID_RENEWAL = 64; +export declare const CAPICOM_PROPID_SHA1_HASH = 3; +export declare const CAPICOM_PROPID_SIGNATURE_HASH = 15; +export declare const CAPICOM_PROPID_SMART_CARD_DATA = 16; +export declare const CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29; +export declare const CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25; +export declare const CAPICOM_PROPID_UNKNOWN = 0; +export declare const CAPICOM_SMART_CARD_USER_STORE = 4; +export declare const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128; +export declare const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256; +export declare const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; +export declare const CAPICOM_STORE_OPEN_READ_ONLY = 0; +export declare const CAPICOM_STORE_OPEN_READ_WRITE = 1; +export declare const CHECK_NONE = 0; +export declare const CHECK_OFFLINE_REVOCATION_STATUS = 16; +export declare const CHECK_ONLINE_REVOCATION_STATUS = 8; +export declare const CHECK_SIGNATURE_VALIDITY = 4; +export declare const CHECK_TIME_VALIDITY = 2; +export declare const CHECK_TRUSTED_ROOT = 1; +export declare const LOG_LEVEL_DEBUG = 4; +export declare const LOG_LEVEL_ERROR = 1; +export declare const LOG_LEVEL_INFO = 2; +export declare const TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144; +export declare const TRUST_CTL_IS_NOT_TIME_VALID = 131072; +export declare const TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288; +export declare const TRUST_IS_CYCLIC = 128; +export declare const TRUST_IS_NOT_SIGNATURE_VALID = 8; +export declare const TRUST_IS_NOT_TIME_NESTED = 2; +export declare const TRUST_IS_NOT_TIME_VALID = 1; +export declare const TRUST_IS_NOT_VALID_FOR_USAGE = 16; +export declare const TRUST_IS_PARTIAL_CHAIN = 65536; +export declare const TRUST_IS_REVOKED = 4; +export declare const TRUST_IS_UNTRUSTED_ROOT = 32; +export declare const TRUST_REVOCATION_STATUS_UNKNOWN = 64; +export declare const XmlDsigGost3410Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411"; +export declare const XmlDsigGost3410UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411"; +export declare const XmlDsigGost3411Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411"; +export declare const XmlDsigGost3411UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr3411"; diff --git a/dist/constants/index.d.ts b/dist/constants/index.d.ts new file mode 100644 index 0000000..4f7f7dd --- /dev/null +++ b/dist/constants/index.d.ts @@ -0,0 +1,4 @@ +export * from './cades-constants'; +export * from './issuer-tags-translations'; +export * from './oids-dictionary'; +export * from './subject-tags-translations'; diff --git a/dist/constants/issuer-tags-translations.d.ts b/dist/constants/issuer-tags-translations.d.ts new file mode 100644 index 0000000..12e0f7d --- /dev/null +++ b/dist/constants/issuer-tags-translations.d.ts @@ -0,0 +1,2 @@ +import { TagsTranslations } from './tags-translations'; +export declare const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[]; diff --git a/dist/constants/oids-dictionary.d.ts b/dist/constants/oids-dictionary.d.ts new file mode 100644 index 0000000..cedee7d --- /dev/null +++ b/dist/constants/oids-dictionary.d.ts @@ -0,0 +1,44 @@ +export declare const OIDS_DICTIONARY: { + '1.2.643.2.2.34.6': string; + '1.2.643.2.39.1.1': string; + '1.2.643.3.131.1.1': string; + '1.2.643.3.141.1.1': string; + '1.2.643.3.141.1.2': string; + '1.2.643.3.2.100.65.13.11': string; + '1.2.643.3.8.100.1': string; + '1.2.643.3.8.100.1.1': string; + '1.2.643.3.8.100.1.10': string; + '1.2.643.3.8.100.1.11': string; + '1.2.643.3.8.100.1.12': string; + '1.2.643.3.8.100.1.13': string; + '1.2.643.3.8.100.1.14': string; + '1.2.643.3.8.100.1.2': string; + '1.2.643.3.8.100.1.3': string; + '1.2.643.3.8.100.1.4': string; + '1.2.643.3.8.100.1.5': string; + '1.2.643.3.8.100.1.6': string; + '1.2.643.3.8.100.1.7': string; + '1.2.643.3.8.100.1.8': string; + '1.2.643.3.8.100.1.9': string; + '1.2.643.5.1.24.2.1.3': string; + '1.2.643.5.1.24.2.1.3.1': string; + '1.2.643.5.1.24.2.2.2': string; + '1.2.643.5.1.24.2.2.3': string; + '1.2.643.6.2.1.7.1': string; + '1.2.643.6.2.1.7.2': string; + '1.2.643.6.3': string; + '1.2.643.6.3.1.1': string; + '1.2.643.6.3.1.2.1': string; + '1.2.643.6.3.1.2.2': string; + '1.2.643.6.3.1.2.3': string; + '1.2.643.6.3.1.3.1': string; + '1.2.643.6.3.1.4.1': string; + '1.2.643.6.3.1.4.2': string; + '1.2.643.6.3.1.4.3': string; + '1.2.840.113549.1.9.2': string; + '1.3.6.1.4.1.24138.1.1.8.1': string; + '1.3.6.1.4.1.29919.21': string; + '1.3.6.1.5.5.7.3.2': string; + '1.3.6.1.5.5.7.3.4': string; + '1.3.643.3.8.100.15': string; +}; diff --git a/dist/constants/subject-tags-translations.d.ts b/dist/constants/subject-tags-translations.d.ts new file mode 100644 index 0000000..0a4a6c2 --- /dev/null +++ b/dist/constants/subject-tags-translations.d.ts @@ -0,0 +1,2 @@ +import { TagsTranslations } from './tags-translations'; +export declare const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[]; diff --git a/dist/constants/tags-translations.d.ts b/dist/constants/tags-translations.d.ts new file mode 100644 index 0000000..5c791bd --- /dev/null +++ b/dist/constants/tags-translations.d.ts @@ -0,0 +1,4 @@ +export interface TagsTranslations { + possibleNames: string[]; + translation: string; +} diff --git a/dist/crypto-pro.d.ts b/dist/crypto-pro.d.ts new file mode 100644 index 0000000..dfb99b7 --- /dev/null +++ b/dist/crypto-pro.d.ts @@ -0,0 +1,7 @@ +// Type definitions for crypto-pro 2.0.0 +// Project: crypto-pro +// Definitions by: Vitalii Goma https://github.com/vgoma + +export as namespace cryptoPro; + +export * from './api'; diff --git a/dist/crypto-pro.js b/dist/crypto-pro.js new file mode 100644 index 0000000..9ad8a29 --- /dev/null +++ b/dist/crypto-pro.js @@ -0,0 +1,2530 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("cryptoPro", [], factory); + else if(typeof exports === 'object') + exports["cryptoPro"] = factory(); + else + root["cryptoPro"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./crypto-pro.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./api/certificate/certificate.ts": +/*!****************************************!*\ + !*** ./api/certificate/certificate.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var constants_1 = __webpack_require__(/*! ../../constants */ "./constants/index.ts"); +var exportBase64_1 = __webpack_require__(/*! ./exportBase64 */ "./api/certificate/exportBase64.ts"); +var getAlgorithm_1 = __webpack_require__(/*! ./getAlgorithm */ "./api/certificate/getAlgorithm.ts"); +var getCadesProp_1 = __webpack_require__(/*! ./getCadesProp */ "./api/certificate/getCadesProp.ts"); +var getDecodedExtendedKeyUsage_1 = __webpack_require__(/*! ./getDecodedExtendedKeyUsage */ "./api/certificate/getDecodedExtendedKeyUsage.ts"); +var getExtendedKeyUsage_1 = __webpack_require__(/*! ./getExtendedKeyUsage */ "./api/certificate/getExtendedKeyUsage.ts"); +var getInfo_1 = __webpack_require__(/*! ./getInfo */ "./api/certificate/getInfo.ts"); +var hasExtendedKeyUsage_1 = __webpack_require__(/*! ./hasExtendedKeyUsage */ "./api/certificate/hasExtendedKeyUsage.ts"); +var isValid_1 = __webpack_require__(/*! ./isValid */ "./api/certificate/isValid.ts"); +var Certificate = /** @class */ (function () { + function Certificate(_cadesCertificate, name, issuerName, subjectName, thumbprint, validFrom, validTo) { + this._cadesCertificate = _cadesCertificate; + this.name = name; + this.issuerName = issuerName; + this.subjectName = subjectName; + this.thumbprint = thumbprint; + this.validFrom = validFrom; + this.validTo = validTo; + } + Certificate.prototype.getOwnerInfo = function () { + return getInfo_1.getInfo.call(this, constants_1.SUBJECT_TAGS_TRANSLATIONS, 'SubjectName'); + }; + Certificate.prototype.getIssuerInfo = function () { + return getInfo_1.getInfo.call(this, constants_1.ISSUER_TAGS_TRANSLATIONS, 'IssuerName'); + }; + Certificate.prototype.getExtendedKeyUsage = function () { + return getExtendedKeyUsage_1.getExtendedKeyUsage.call(this); + }; + Certificate.prototype.getDecodedExtendedKeyUsage = function () { + return getDecodedExtendedKeyUsage_1.getDecodedExtendedKeyUsage.call(this); + }; + Certificate.prototype.getAlgorithm = function () { + return getAlgorithm_1.getAlgorithm.call(this); + }; + Certificate.prototype.getCadesProp = function (propName) { + return getCadesProp_1.getCadesProp.call(this, propName); + }; + Certificate.prototype.isValid = function () { + return isValid_1.isValid.call(this); + }; + Certificate.prototype.exportBase64 = function () { + return exportBase64_1.exportBase64.call(this); + }; + Certificate.prototype.hasExtendedKeyUsage = function (oids) { + return hasExtendedKeyUsage_1.hasExtendedKeyUsage.call(this, oids); + }; + return Certificate; +}()); +exports.Certificate = Certificate; + + +/***/ }), + +/***/ "./api/certificate/exportBase64.ts": +/*!*****************************************!*\ + !*** ./api/certificate/exportBase64.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Экспортирует сертификат в формате base64 + * + * @returns сертификат в формате base64 + */ +exports.exportBase64 = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + var cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function exportBase64() { + var base64; + try { + base64 = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.Export(0); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при экспорте сертификата'); + } + return base64; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getAlgorithm.ts": +/*!*****************************************!*\ + !*** ./api/certificate/getAlgorithm.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает информацию об алгоритме сертификата + * + * @returns информацию об алгоритме и его OID'е + */ +exports.getAlgorithm = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + var cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function getAlgorithm() { + var algorithmInfo = { + algorithm: null, + oid: null, + }; + var cadesPublicKey; + try { + cadesPublicKey = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.PublicKey(); + cadesPublicKey = _generateCadesFn_1.__cadesAsyncToken__ + cadesPublicKey.Algorithm; + algorithmInfo.algorithm = _generateCadesFn_1.__cadesAsyncToken__ + cadesPublicKey.FriendlyName; + algorithmInfo.oid = _generateCadesFn_1.__cadesAsyncToken__ + cadesPublicKey.Value; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при получении алгоритма'); + } + return algorithmInfo; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getCadesProp.ts": +/*!*****************************************!*\ + !*** ./api/certificate/getCadesProp.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает указанное внутренее свойство у сертификата в формате Cades + * + * @param propName = наименование свойства + * @returns значение запрошенного свойства + */ +exports.getCadesProp = _afterPluginsLoaded_1._afterPluginsLoaded(function (propName) { + var cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function getCadesProp() { + var propertyValue; + try { + propertyValue = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate[propName]; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при обращении к свойству сертификата'); + } + return propertyValue; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getDecodedExtendedKeyUsage.ts": +/*!*******************************************************!*\ + !*** ./api/certificate/getDecodedExtendedKeyUsage.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var constants_1 = __webpack_require__(/*! ../../constants */ "./constants/index.ts"); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +/** + * Возвращает расшифрованные ОИД'ы сертификата + * + * @returns словарь расшифрованных ОИД'ов + */ +exports.getDecodedExtendedKeyUsage = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + return __awaiter(this, void 0, void 0, function () { + var certificateOids; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.getExtendedKeyUsage()]; + case 1: + certificateOids = _a.sent(); + return [2 /*return*/, certificateOids.reduce(function (decodedOids, oidCode) { + var _a; + return (__assign(__assign({}, decodedOids), (_a = {}, _a[oidCode] = constants_1.OIDS_DICTIONARY[oidCode] || null, _a))); + }, {})]; + } + }); + }); +}); + + +/***/ }), + +/***/ "./api/certificate/getExtendedKeyUsage.ts": +/*!************************************************!*\ + !*** ./api/certificate/getExtendedKeyUsage.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает ОИД'ы сертификата + * + * @returns список ОИД'ов + */ +exports.getExtendedKeyUsage = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + var cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function getExtendedKeyUsage() { + var OIDS = []; + var count; + try { + count = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage(); + count = _generateCadesFn_1.__cadesAsyncToken__ + count.EKUs; + count = _generateCadesFn_1.__cadesAsyncToken__ + count.Count; + if (count > 0) { + while (count > 0) { + var cadesExtendedKeyUsage = void 0; + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage(); + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesExtendedKeyUsage.EKUs; + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesExtendedKeyUsage.Item(count); + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesExtendedKeyUsage.OID; + OIDS.push(cadesExtendedKeyUsage); + count--; + } + } + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || "Ошибка при получении ОИД'ов"); + } + return OIDS; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getInfo.ts": +/*!************************************!*\ + !*** ./api/certificate/getInfo.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _parseCertInfo_1 = __webpack_require__(/*! ../../helpers/_parseCertInfo */ "./helpers/_parseCertInfo.ts"); +var getCadesProp_1 = __webpack_require__(/*! ./getCadesProp */ "./api/certificate/getCadesProp.ts"); +/** + * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам + * + * @param tags = словарь + * @param entitiesPath = путь к разбираемой сущности + * @returns расшифрованная информация по отдельным тэгам + */ +exports.getInfo = _afterPluginsLoaded_1._afterPluginsLoaded(function (tags, entitiesPath) { + return __awaiter(this, void 0, void 0, function () { + var entities, error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, getCadesProp_1.getCadesProp.call(this, entitiesPath)]; + case 1: + entities = _a.sent(); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + console.error(error_1); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error_1) || 'Ошибка при извлечении информации из сертификата'); + case 3: return [2 /*return*/, _parseCertInfo_1._parseCertInfo(tags, entities)]; + } + }); + }); +}); + + +/***/ }), + +/***/ "./api/certificate/hasExtendedKeyUsage.ts": +/*!************************************************!*\ + !*** ./api/certificate/hasExtendedKeyUsage.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +/** + * Проверяет наличие ОИД'а (ОИД'ов) у сертификата + * + * @param oids - ОИД'ы для проверки + * @returns флаг наличия ОИД'ов у сертификата + */ +exports.hasExtendedKeyUsage = _afterPluginsLoaded_1._afterPluginsLoaded(function (oids) { + return __awaiter(this, void 0, void 0, function () { + var certOids, result; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.getExtendedKeyUsage()]; + case 1: + certOids = _a.sent(); + if (Array.isArray(oids)) { + result = oids.every(function (oidToCheck) { return certOids.some(function (certOid) { return certOid === oidToCheck; }); }); + } + else { + result = certOids.some(function (certOid) { return certOid === oids; }); + } + return [2 /*return*/, result]; + } + }); + }); +}); + + +/***/ }), + +/***/ "./api/certificate/index.ts": +/*!**********************************!*\ + !*** ./api/certificate/index.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./certificate */ "./api/certificate/certificate.ts")); + + +/***/ }), + +/***/ "./api/certificate/isValid.ts": +/*!************************************!*\ + !*** ./api/certificate/isValid.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Проверяет действительность сертификата + * + * @returns флаг валидности + */ +exports.isValid = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + var cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function isValid() { + var isValid; + try { + isValid = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.IsValid(); + isValid = _generateCadesFn_1.__cadesAsyncToken__ + isValid.Result; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при проверке сертификата'); + } + return Boolean(isValid); + })); +}); + + +/***/ }), + +/***/ "./api/createSignature.ts": +/*!********************************!*\ + !*** ./api/createSignature.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var constants_1 = __webpack_require__(/*! ../constants */ "./constants/index.ts"); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +var _getCadesCert_1 = __webpack_require__(/*! ../helpers/_getCadesCert */ "./helpers/_getCadesCert.ts"); +var _getDateObj_1 = __webpack_require__(/*! ../helpers/_getDateObj */ "./helpers/_getDateObj.ts"); +/** + * Создает подпись base64 строки по отпечатку сертификата + * + * @param thumbprint - отпечаток сертификата + * @param dataBase64 - строковые данные в формате base64 + * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false) + * @returns подпись + */ +exports.createSignature = _afterPluginsLoaded_1._afterPluginsLoaded(function (thumbprint, dataBase64, detachedSignature) { + if (detachedSignature === void 0) { detachedSignature = true; } + return __awaiter(void 0, void 0, void 0, function () { + var cadesplugin, cadesCertificate; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + cadesplugin = window.cadesplugin; + return [4 /*yield*/, _getCadesCert_1._getCadesCert(thumbprint)]; + case 1: + cadesCertificate = _a.sent(); + return [2 /*return*/, eval(_generateCadesFn_1._generateCadesFn(function signData() { + var cadesAttrs; + var cadesSignedData; + var cadesSigner; + try { + cadesAttrs = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CADESCOM.CPAttribute'); + cadesSignedData = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.CadesSignedData'); + cadesSigner = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.CPSigner'); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи'); + } + var currentTime = _getDateObj_1._getDateObj(new Date()); + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesAttrs.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи'); + } + var cadesAuthAttrs; + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate)); + cadesAuthAttrs = _generateCadesFn_1.__cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2; + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSignedData.propset_Content(dataBase64)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи'); + } + var signature; + try { + signature = + _generateCadesFn_1.__cadesAsyncToken__ + + cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_CADES_BES, detachedSignature); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных'); + } + return signature; + }))]; + } + }); + }); +}); + + +/***/ }), + +/***/ "./api/getCertificate.ts": +/*!*******************************!*\ + !*** ./api/getCertificate.ts ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var getUserCertificates_1 = __webpack_require__(/*! ./getUserCertificates */ "./api/getUserCertificates.ts"); +/** + * Возвращает сертификат по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат + */ +exports.getCertificate = _afterPluginsLoaded_1._afterPluginsLoaded(function (thumbprint) { return __awaiter(void 0, void 0, void 0, function () { + var availableCertificates, foundCertificate; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!thumbprint) { + throw new Error('Отпечаток не указан'); + } + return [4 /*yield*/, getUserCertificates_1.getUserCertificates()]; + case 1: + availableCertificates = _a.sent(); + foundCertificate = availableCertificates.find(function (cert) { return cert.thumbprint === thumbprint; }); + if (!foundCertificate) { + throw new Error("\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442 \u0441 \u043E\u0442\u043F\u0435\u0447\u0430\u0442\u043A\u043E\u043C: \"" + thumbprint + "\" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D"); + } + return [2 /*return*/, foundCertificate]; + } + }); +}); }); + + +/***/ }), + +/***/ "./api/getSystemInfo.ts": +/*!******************************!*\ + !*** ./api/getSystemInfo.ts ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Предоставляет информацию о системе + * + * @returns информацию о CSP и плагине + */ +exports.getSystemInfo = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + var sysInfo = { + cadesVersion: null, + cspVersion: null, + }; + return eval(_generateCadesFn_1._generateCadesFn(function getSystemInfo() { + var cadesAbout; + try { + cadesAbout = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.About'); + sysInfo.cadesVersion = _generateCadesFn_1.__cadesAsyncToken__ + cadesAbout.PluginVersion; + sysInfo.cspVersion = _generateCadesFn_1.__cadesAsyncToken__ + cadesAbout.CSPVersion(); + if (!sysInfo.cadesVersion) { + sysInfo.cadesVersion = _generateCadesFn_1.__cadesAsyncToken__ + cadesAbout.Version; + } + sysInfo.cadesVersion = _generateCadesFn_1.__cadesAsyncToken__ + sysInfo.cadesVersion.toString(); + sysInfo.cspVersion = _generateCadesFn_1.__cadesAsyncToken__ + sysInfo.cspVersion.toString(); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при получении информации о системе'); + } + return sysInfo; + })); +}); + + +/***/ }), + +/***/ "./api/getUserCertificates.ts": +/*!************************************!*\ + !*** ./api/getUserCertificates.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var certificate_1 = __webpack_require__(/*! ./certificate */ "./api/certificate/index.ts"); +var constants_1 = __webpack_require__(/*! ../constants */ "./constants/index.ts"); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractCommonName_1 = __webpack_require__(/*! ../helpers/_extractCommonName */ "./helpers/_extractCommonName.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +var certificatesCache; +/** + * Возвращает список сертификатов, доступных пользователю в системе + * + * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов + * @returns список сертификатов + */ +exports.getUserCertificates = _afterPluginsLoaded_1._afterPluginsLoaded(function (resetCache) { + if (resetCache === void 0) { resetCache = false; } + var cadesplugin = window.cadesplugin; + if (!resetCache && certificatesCache) { + return certificatesCache; + } + return eval(_generateCadesFn_1._generateCadesFn(function getCertsList() { + var cadesStore; + try { + cadesStore = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.Store'); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу'); + } + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + + cadesStore.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE, cadesplugin.CAPICOM_MY_STORE, cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища'); + } + var cadesCertificates; + var cadesCertificatesCount; + try { + cadesCertificates = _generateCadesFn_1.__cadesAsyncToken__ + cadesStore.Certificates; + if (cadesCertificates) { + cadesCertificates = + _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID); + /** + * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ + * или не действительны на данный момент + */ + cadesCertificates = + _generateCadesFn_1.__cadesAsyncToken__ + + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY, constants_1.CAPICOM_PROPID_KEY_PROV_INFO); + cadesCertificatesCount = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificates.Count; + } + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов'); + } + if (!cadesCertificatesCount) { + throw new Error('Нет доступных сертификатов'); + } + var certificateList = []; + try { + while (cadesCertificatesCount) { + var cadesCertificate = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificates.Item(cadesCertificatesCount); + certificateList.push(new certificate_1.Certificate(cadesCertificate, _extractCommonName_1._extractCommonName(_generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.SubjectName), _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.IssuerName, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.SubjectName, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.Thumbprint, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ValidFromDate, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ValidToDate)); + cadesCertificatesCount--; + } + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка обработки сертификатов'); + } + cadesStore.Close(); + certificatesCache = certificateList; + return certificatesCache; + })); +}); + + +/***/ }), + +/***/ "./api/index.ts": +/*!**********************!*\ + !*** ./api/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./getCertificate */ "./api/getCertificate.ts")); +__export(__webpack_require__(/*! ./getUserCertificates */ "./api/getUserCertificates.ts")); +__export(__webpack_require__(/*! ./getSystemInfo */ "./api/getSystemInfo.ts")); +__export(__webpack_require__(/*! ./isValidSystemSetup */ "./api/isValidSystemSetup.ts")); +__export(__webpack_require__(/*! ./createSignature */ "./api/createSignature.ts")); +__export(__webpack_require__(/*! ./certificate */ "./api/certificate/index.ts")); + + +/***/ }), + +/***/ "./api/isValidSystemSetup.ts": +/*!***********************************!*\ + !*** ./api/isValidSystemSetup.ts ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _isSupportedCadesVersion_1 = __webpack_require__(/*! ../helpers/_isSupportedCadesVersion */ "./helpers/_isSupportedCadesVersion.ts"); +var _isSupportedCSPVersion_1 = __webpack_require__(/*! ../helpers/_isSupportedCSPVersion */ "./helpers/_isSupportedCSPVersion.ts"); +var getSystemInfo_1 = __webpack_require__(/*! ./getSystemInfo */ "./api/getSystemInfo.ts"); +/** + * Проверяет корректность настроек ЭП на машине + * + * @returns флаг корректности настроек + */ +exports.isValidSystemSetup = _afterPluginsLoaded_1._afterPluginsLoaded(function () { return __awaiter(void 0, void 0, void 0, function () { + var systemInfo, error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + _a.trys.push([0, 2, , 3]); + return [4 /*yield*/, getSystemInfo_1.getSystemInfo()]; + case 1: + systemInfo = _a.sent(); + return [3 /*break*/, 3]; + case 2: + error_1 = _a.sent(); + console.error(error_1); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error_1) || 'Настройки ЭП на данной машине не верны'); + case 3: + if (!_isSupportedCadesVersion_1._isSupportedCadesVersion(systemInfo.cadesVersion)) { + throw new Error('Не поддерживаемая версия плагина'); + } + if (!_isSupportedCSPVersion_1._isSupportedCSPVersion(systemInfo.cspVersion)) { + throw new Error('Не поддерживаемая версия CSP'); + } + return [2 /*return*/, true]; + } + }); +}); }); + + +/***/ }), + +/***/ "./constants/cades-constants.ts": +/*!**************************************!*\ + !*** ./constants/cades-constants.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CADESCOM_ATTRIBUTE_OTHER = -1; +exports.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +exports.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +exports.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +exports.CADESCOM_AllowNoOutstandingRequest = 1; +exports.CADESCOM_AllowNone = 0; +exports.CADESCOM_AllowUntrustedCertificate = 2; +exports.CADESCOM_AllowUntrustedRoot = 4; +exports.CADESCOM_BASE64_TO_BINARY = 0x01; +exports.CADESCOM_CADES_BES = 1; +exports.CADESCOM_CADES_DEFAULT = 0; +exports.CADESCOM_CADES_T = 5; +exports.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d; +exports.CADESCOM_CONTAINER_STORE = 100; +exports.CADESCOM_CURRENT_USER_STORE = 2; +exports.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2; +exports.CADESCOM_DISPLAY_DATA_CONTENT = 1; +exports.CADESCOM_DISPLAY_DATA_NONE = 0; +exports.CADESCOM_ENCODE_ANY = -1; +exports.CADESCOM_ENCODE_BASE64 = 0; +exports.CADESCOM_ENCODE_BINARY = 1; +exports.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3; +exports.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4; +exports.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2; +exports.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25; +exports.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0; +exports.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110; +exports.CADESCOM_HASH_ALGORITHM_MD2 = 1; +exports.CADESCOM_HASH_ALGORITHM_MD4 = 2; +exports.CADESCOM_HASH_ALGORITHM_MD5 = 3; +exports.CADESCOM_HASH_ALGORITHM_SHA1 = 0; +exports.CADESCOM_HASH_ALGORITHM_SHA_256 = 4; +exports.CADESCOM_HASH_ALGORITHM_SHA_384 = 5; +exports.CADESCOM_HASH_ALGORITHM_SHA_512 = 6; +exports.CADESCOM_LOCAL_MACHINE_STORE = 1; +exports.CADESCOM_PKCS7_TYPE = 65535; +exports.CADESCOM_STRING_TO_UCS2LE = 0x00; +exports.CADESCOM_SkipInstallToStore = 268435456; +exports.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0; +exports.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1; +exports.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2; +exports.CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3; +exports.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +exports.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +exports.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +exports.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7; +exports.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8; +exports.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6; +exports.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5; +exports.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2; +exports.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12; +exports.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3; +exports.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0; +exports.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; +exports.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4; +exports.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11; +exports.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10; +exports.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9; +exports.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0; +exports.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2; +exports.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1; +exports.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1; +exports.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0; +exports.CAPICOM_CURRENT_USER_STORE = 2; +exports.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128; +exports.CAPICOM_EKU_CLIENT_AUTH = 2; +exports.CAPICOM_EKU_OTHER = 0; +exports.CAPICOM_EKU_SMARTCARD_LOGON = 5; +exports.CAPICOM_LOCAL_MACHINE_STORE = 1; +exports.CAPICOM_MEMORY_STORE = 0; +exports.CAPICOM_MY_STORE = 'My'; +exports.CAPICOM_OID_KEY_USAGE_EXTENSION = 10; +exports.CAPICOM_OID_OTHER = 0; +exports.CAPICOM_PROPID_ACCESS_STATE = 14; +exports.CAPICOM_PROPID_ARCHIVED = 19; +exports.CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65; +exports.CAPICOM_PROPID_AUTO_ENROLL = 21; +exports.CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23; +exports.CAPICOM_PROPID_CTL_USAGE = 9; +exports.CAPICOM_PROPID_DATE_STAMP = 27; +exports.CAPICOM_PROPID_DESCRIPTION = 13; +exports.CAPICOM_PROPID_EFS = 17; +exports.CAPICOM_PROPID_ENHKEY_USAGE = 9; +exports.CAPICOM_PROPID_ENROLLMENT = 26; +exports.CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30; +exports.CAPICOM_PROPID_FIRST_RESERVED = 66; +exports.CAPICOM_PROPID_FIRST_USER = 0x00008000; +exports.CAPICOM_PROPID_FORTEZZA_DATA = 18; +exports.CAPICOM_PROPID_FRIENDLY_NAME = 11; +exports.CAPICOM_PROPID_HASH_PROP = 3; +exports.CAPICOM_PROPID_IE30_RESERVED = 7; +exports.CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24; +exports.CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28; +exports.CAPICOM_PROPID_KEY_CONTEXT = 5; +exports.CAPICOM_PROPID_KEY_IDENTIFIER = 20; +exports.CAPICOM_PROPID_KEY_PROV_HANDLE = 1; +exports.CAPICOM_PROPID_KEY_PROV_INFO = 2; +exports.CAPICOM_PROPID_KEY_SPEC = 6; +exports.CAPICOM_PROPID_LAST_RESERVED = 0x00007fff; +exports.CAPICOM_PROPID_LAST_USER = 0x0000ffff; +exports.CAPICOM_PROPID_MD5_HASH = 4; +exports.CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10; +exports.CAPICOM_PROPID_PUBKEY_ALG_PARA = 22; +exports.CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8; +exports.CAPICOM_PROPID_PVK_FILE = 12; +exports.CAPICOM_PROPID_RENEWAL = 64; +exports.CAPICOM_PROPID_SHA1_HASH = 3; +exports.CAPICOM_PROPID_SIGNATURE_HASH = 15; +exports.CAPICOM_PROPID_SMART_CARD_DATA = 16; +exports.CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29; +exports.CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25; +exports.CAPICOM_PROPID_UNKNOWN = 0; +exports.CAPICOM_SMART_CARD_USER_STORE = 4; +exports.CAPICOM_STORE_OPEN_EXISTING_ONLY = 128; +exports.CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256; +exports.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; +exports.CAPICOM_STORE_OPEN_READ_ONLY = 0; +exports.CAPICOM_STORE_OPEN_READ_WRITE = 1; +exports.CHECK_NONE = 0; +exports.CHECK_OFFLINE_REVOCATION_STATUS = 16; +exports.CHECK_ONLINE_REVOCATION_STATUS = 8; +exports.CHECK_SIGNATURE_VALIDITY = 4; +exports.CHECK_TIME_VALIDITY = 2; +exports.CHECK_TRUSTED_ROOT = 1; +exports.LOG_LEVEL_DEBUG = 4; +exports.LOG_LEVEL_ERROR = 1; +exports.LOG_LEVEL_INFO = 2; +exports.TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144; +exports.TRUST_CTL_IS_NOT_TIME_VALID = 131072; +exports.TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288; +exports.TRUST_IS_CYCLIC = 128; +exports.TRUST_IS_NOT_SIGNATURE_VALID = 8; +exports.TRUST_IS_NOT_TIME_NESTED = 2; +exports.TRUST_IS_NOT_TIME_VALID = 1; +exports.TRUST_IS_NOT_VALID_FOR_USAGE = 16; +exports.TRUST_IS_PARTIAL_CHAIN = 65536; +exports.TRUST_IS_REVOKED = 4; +exports.TRUST_IS_UNTRUSTED_ROOT = 32; +exports.TRUST_REVOCATION_STATUS_UNKNOWN = 64; +exports.XmlDsigGost3410Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411'; +exports.XmlDsigGost3410UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411'; +exports.XmlDsigGost3411Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411'; +exports.XmlDsigGost3411UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr3411'; + + +/***/ }), + +/***/ "./constants/index.ts": +/*!****************************!*\ + !*** ./constants/index.ts ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./cades-constants */ "./constants/cades-constants.ts")); +__export(__webpack_require__(/*! ./issuer-tags-translations */ "./constants/issuer-tags-translations.ts")); +__export(__webpack_require__(/*! ./oids-dictionary */ "./constants/oids-dictionary.ts")); +__export(__webpack_require__(/*! ./subject-tags-translations */ "./constants/subject-tags-translations.ts")); + + +/***/ }), + +/***/ "./constants/issuer-tags-translations.ts": +/*!***********************************************!*\ + !*** ./constants/issuer-tags-translations.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ISSUER_TAGS_TRANSLATIONS = [ + { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' }, + { possibleNames: ['CN'], translation: 'Удостоверяющий центр' }, + { possibleNames: ['C'], translation: 'Страна' }, + { possibleNames: ['S'], translation: 'Регион' }, + { possibleNames: ['STREET'], translation: 'Адрес' }, + { possibleNames: ['O'], translation: 'Компания' }, + { possibleNames: ['OU'], translation: 'Тип' }, + { possibleNames: ['T'], translation: 'Должность' }, + { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' }, + { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' }, + { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' }, + { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' }, + { possibleNames: ['E'], translation: 'Email' }, + { possibleNames: ['L'], translation: 'Город' }, +]; + + +/***/ }), + +/***/ "./constants/oids-dictionary.ts": +/*!**************************************!*\ + !*** ./constants/oids-dictionary.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OIDS_DICTIONARY = { + '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации', + '1.2.643.2.39.1.1': 'Использование в программных продуктах системы "1С:Предприятие 8"', + '1.2.643.3.131.1.1': 'ИНН', + '1.2.643.3.141.1.1': 'РНС ФСС', + '1.2.643.3.141.1.2': 'КП ФСС', + '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС "Госзакупки" Сахалинской области.', + '1.2.643.3.8.100.1': 'Сертификат типа "ekey-ГОСТ"', + '1.2.643.3.8.100.1.1': 'Общее использование в системах ИОК без права заверения финансовых документов', + '1.2.643.3.8.100.1.10': 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы', + '1.2.643.3.8.100.1.11': 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области', + '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области', + '1.2.643.3.8.100.1.13': 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края', + '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке "Тендер"', + '1.2.643.3.8.100.1.2': 'Передача отчетности по ТКС', + '1.2.643.3.8.100.1.3': 'Оформление взаимных обязательств, соглашений, договоров, актов и т.п.', + '1.2.643.3.8.100.1.4': 'Внутрикорпоративный документооборот', + '1.2.643.3.8.100.1.5': 'Использование в системах электронной торговли', + '1.2.643.3.8.100.1.6': 'Использование в торгово-закупочной системе "ЭЛЕКТРА"', + '1.2.643.3.8.100.1.7': 'Использование в системе Портал государственных закупок Ставропольского края.', + '1.2.643.3.8.100.1.8': 'Использование в Единой системе электронной торговли B2B-Center и B2G.', + '1.2.643.3.8.100.1.9': 'Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа', + '1.2.643.5.1.24.2.1.3': 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя', + '1.2.643.5.1.24.2.1.3.1': 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя', + '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав', + '1.2.643.5.1.24.2.2.3': 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя', + '1.2.643.6.2.1.7.1': 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций', + '1.2.643.6.2.1.7.2': 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов', + '1.2.643.6.3': 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений', + '1.2.643.6.3.1.1': 'Использование на электронных площадок отобранных для проведения аукционах в электронной форме', + '1.2.643.6.3.1.2.1': 'Тип участника - Юридическое лицо', + '1.2.643.6.3.1.2.2': 'Тип участника - Физическое лицо', + '1.2.643.6.3.1.2.3': 'Тип участника - Индивидуальный предприниматель', + '1.2.643.6.3.1.3.1': 'Участник размещения заказа', + '1.2.643.6.3.1.4.1': 'Администратор организации', + '1.2.643.6.3.1.4.2': 'Уполномоченный специалист', + '1.2.643.6.3.1.4.3': 'Специалист с правом подписи контракта', + '1.2.840.113549.1.9.2': 'Неструктурированное имя', + '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе "Электронная Торговая Площадка"', + '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области "Рефери".', + '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента', + '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта', + '1.3.643.3.8.100.15': 'Использование в ЭТП "uTender"', +}; + + +/***/ }), + +/***/ "./constants/subject-tags-translations.ts": +/*!************************************************!*\ + !*** ./constants/subject-tags-translations.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SUBJECT_TAGS_TRANSLATIONS = [ + { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' }, + { possibleNames: ['CN'], translation: 'Владелец' }, + { possibleNames: ['SN'], translation: 'Фамилия' }, + { possibleNames: ['G'], translation: 'Имя Отчество' }, + { possibleNames: ['C'], translation: 'Страна' }, + { possibleNames: ['S'], translation: 'Регион' }, + { possibleNames: ['STREET'], translation: 'Адрес' }, + { possibleNames: ['O'], translation: 'Компания' }, + { possibleNames: ['OU'], translation: 'Отдел/подразделение' }, + { possibleNames: ['T'], translation: 'Должность' }, + { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' }, + { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' }, + { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' }, + { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' }, + { possibleNames: ['E'], translation: 'Email' }, + { possibleNames: ['L'], translation: 'Город' }, +]; + + +/***/ }), + +/***/ "./crypto-pro.ts": +/*!***********************!*\ + !*** ./crypto-pro.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./api */ "./api/index.ts")); + + +/***/ }), + +/***/ "./helpers/_afterPluginsLoaded.ts": +/*!****************************************!*\ + !*** ./helpers/_afterPluginsLoaded.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ./_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var isSetLogLevel = false; +var isPluginLoaded = false; +exports._afterPluginsLoaded = function (fn) { + var canPromise = Boolean(window.Promise); + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return __awaiter(this, void 0, void 0, function () { + var cadesplugin, error_1; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!isPluginLoaded) { + try { + __webpack_require__(/*! ../vendor/cadesplugin_api */ "./vendor/cadesplugin_api.js"); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при подключении модуля для работы с Cades plugin'); + } + isPluginLoaded = true; + } + cadesplugin = window.cadesplugin; + if (!canPromise) { + throw new Error('Необходим полифилл для Promise'); + } + if (!cadesplugin) { + throw new Error('Не подключен модуль для работы с Cades plugin'); + } + if (!isSetLogLevel) { + cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR); + isSetLogLevel = true; + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, cadesplugin]; + case 2: + _a.sent(); + return [3 /*break*/, 4]; + case 3: + error_1 = _a.sent(); + console.error(error_1); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error_1) || 'Ошибка при инициализации модуля для работы с Cades plugin'); + case 4: return [4 /*yield*/, fn.apply(this, args)]; + case 5: return [2 /*return*/, _a.sent()]; + } + }); + }); + }; +}; + + +/***/ }), + +/***/ "./helpers/_extractCommonName.ts": +/*!***************************************!*\ + !*** ./helpers/_extractCommonName.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports._extractCommonName = function (subjectName) { var _a; return (_a = subjectName.match(/CN=(.+?)(?:,|$)/)) === null || _a === void 0 ? void 0 : _a[1]; }; + + +/***/ }), + +/***/ "./helpers/_extractMeaningfulErrorMessage.ts": +/*!***************************************************!*\ + !*** ./helpers/_extractMeaningfulErrorMessage.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports._extractMeaningfulErrorMessage = function (error) { + var _a; + var errorContainer = ((_a = window.cadesplugin) === null || _a === void 0 ? void 0 : _a.getLastError) && window.cadesplugin.getLastError(error); + if (!(errorContainer === null || errorContainer === void 0 ? void 0 : errorContainer.message)) { + if (!error.message) { + return null; + } + errorContainer = error; + } + var containsRussianLetters = /[а-яА-Я]/.test(errorContainer.message); + if (!containsRussianLetters) { + return null; + } + var searchResult = errorContainer.message.match(/^(.*?)(?:(?:\.?\s?\(?0x)|(?:\.?$))/); + return searchResult ? searchResult[1] : null; +}; + + +/***/ }), + +/***/ "./helpers/_generateCadesFn.ts": +/*!*************************************!*\ + !*** ./helpers/_generateCadesFn.ts ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +// синтетические переменные, которые подменяются в рантайме +exports.__cadesAsyncToken__ = {}; +exports.__createCadesPluginObject__ = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return ({}); +}; +function getGeneratorConstructor() { + return new Function('', 'return Object.getPrototypeOf(function*(){}).constructor')(); +} +exports._generateCadesFn = function (callback) { + var _a; + var cadesplugin = window.cadesplugin; + var cadesGeneratorsAPI = Boolean(cadesplugin.CreateObjectAsync); + var callbackName = callback.name || 'dynamicFn'; + var callbackLiteral = String(callback); + var callbackArguments = ((_a = callbackLiteral.match(/^function[\s\w]*?\((.*?)\)/)) === null || _a === void 0 ? void 0 : _a[1]) || ''; + var callbackBody = callbackLiteral.replace(/^.*?{([\s\S]*?)}$/, '$1'); + var crossEnvCallbackLiteral = String(new (cadesGeneratorsAPI ? getGeneratorConstructor() : Function)(callbackArguments, callbackBody)); + crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/\w+?\.__createCadesPluginObject__(\([\s\S]*?\))/gm, "cadesplugin.CreateObject" + (cadesGeneratorsAPI ? 'Async' : '') + "$1"); + crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/\w+?\.__cadesAsyncToken__\s*?\+\s*?\b/gm, cadesGeneratorsAPI ? 'yield ' : ''); + if (!cadesGeneratorsAPI) { + crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/propset_(.*?)\((.*?)\)/gm, '$1 = $2'); + } + return [ + cadesGeneratorsAPI ? "cadesplugin.async_spawn(" + crossEnvCallbackLiteral + ");" : "(" + crossEnvCallbackLiteral + ")();", + "//# sourceURL=crypto-pro_" + callbackName + ".js", + ].join(''); +}; + + +/***/ }), + +/***/ "./helpers/_getCadesCert.ts": +/*!**********************************!*\ + !*** ./helpers/_getCadesCert.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var _afterPluginsLoaded_1 = __webpack_require__(/*! ./_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +var _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ./_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +var _generateCadesFn_1 = __webpack_require__(/*! ./_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает сертификат в формате Cades по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат в формате Cades + */ +exports._getCadesCert = _afterPluginsLoaded_1._afterPluginsLoaded(function (thumbprint) { + var cadesplugin = window.cadesplugin; + return eval(_generateCadesFn_1._generateCadesFn(function _getCadesCert() { + var cadesStore; + try { + cadesStore = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.Store'); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу'); + } + if (!cadesStore) { + throw new Error('Не удалось получить доступ к хранилищу сертификатов'); + } + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + + cadesStore.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE, cadesplugin.CAPICOM_MY_STORE, cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища'); + } + var cadesCertificateList; + var certificatesCount; + try { + cadesCertificateList = _generateCadesFn_1.__cadesAsyncToken__ + cadesStore.Certificates; + certificatesCount = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Count; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов'); + } + if (!certificatesCount) { + throw new Error('Нет доступных сертификатов'); + } + var cadesCertificate; + try { + cadesCertificateList = + _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint); + var count = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Count; + if (!count) { + throw new Error("\u0421\u0435\u0440\u0442\u0438\u0444\u0438\u043A\u0430\u0442 \u0441 \u043E\u0442\u043F\u0435\u0447\u0430\u0442\u043A\u043E\u043C: \"" + thumbprint + "\" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D"); + } + cadesCertificate = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Item(1); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата'); + } + cadesStore.Close(); + return cadesCertificate; + })); +}); + + +/***/ }), + +/***/ "./helpers/_getDateObj.ts": +/*!********************************!*\ + !*** ./helpers/_getDateObj.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера. + * + * В IE необходимо использовать специфичный формат "VT_DATE" + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate + */ +exports._getDateObj = function (dateObj) { return (dateObj.getVarDate ? dateObj.getVarDate() : dateObj); }; + + +/***/ }), + +/***/ "./helpers/_isSupportedCSPVersion.ts": +/*!*******************************************!*\ + !*** ./helpers/_isSupportedCSPVersion.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var oldestSupportedCSPVersion = 4.0; +exports._isSupportedCSPVersion = function (version) { + var _a; + version = (_a = version.match(/\d+?\b(?:\.\d+)?/)) === null || _a === void 0 ? void 0 : _a[0]; + return Number(version) >= oldestSupportedCSPVersion; +}; + + +/***/ }), + +/***/ "./helpers/_isSupportedCadesVersion.ts": +/*!*********************************************!*\ + !*** ./helpers/_isSupportedCadesVersion.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports._isSupportedCadesVersion = function (version) { + var match = version.match(/(\d+)\.(\d+)\.(\d+)/); + if (!match) { + return false; + } + var major = match[1], minor = match[2], patch = match[3]; + if (Number(major) < 2) { + return false; + } + if (Number(major) === 2 && Number(patch) < 12438) { + return false; + } + return true; +}; + + +/***/ }), + +/***/ "./helpers/_parseCertInfo.ts": +/*!***********************************!*\ + !*** ./helpers/_parseCertInfo.ts ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var constants_1 = __webpack_require__(/*! ../constants */ "./constants/index.ts"); +/** + * Парсит информацию из строки с информацией о сертификате + * + * @param tagsTranslations - словарь с расшифровками тэгов + * @param rawInfo - данные для парсинга + * @returns расшифрованная информация по отдельным тэгам + */ +exports._parseCertInfo = function (tagsTranslations, rawInfo) { + var extractedEntities = rawInfo.match(/([а-яА-Яa-zA-Z0-9.]+)=(?:("[^"]+?")|(.+?))(?:,|$)/g); + if (extractedEntities) { + return extractedEntities.map(function (group) { + var _a, _b, _c; + var segmentsMatch = group.match(/^([а-яА-Яa-zA-Z0-9.]+)=(.+?),?$/); + var title = segmentsMatch === null || segmentsMatch === void 0 ? void 0 : segmentsMatch[1]; + // Вырезаем лишние кавычки + var description = (_b = (_a = segmentsMatch === null || segmentsMatch === void 0 ? void 0 : segmentsMatch[2]) === null || _a === void 0 ? void 0 : _a.replace(/^"(.*)"/, '$1')) === null || _b === void 0 ? void 0 : _b.replace(/"{2}/g, '"'); + var oidIdentifierMatch = title === null || title === void 0 ? void 0 : title.match(/^OID\.(.*)/); + var oidIdentifier = oidIdentifierMatch === null || oidIdentifierMatch === void 0 ? void 0 : oidIdentifierMatch[1]; + var isTranslated = false; + // Если нашли в тайтле ОИД, пытаемся его расшифровать + if (oidIdentifier) { + var oidTranslation = constants_1.OIDS_DICTIONARY[oidIdentifier]; + if (oidTranslation) { + title = oidTranslation; + isTranslated = true; + } + } + var tagTranslation = (_c = tagsTranslations.find(function (tag) { return tag.possibleNames.find(function (name) { return name === title; }); })) === null || _c === void 0 ? void 0 : _c.translation; + if (tagTranslation) { + title = tagTranslation; + isTranslated = true; + } + return { description: description, title: title, isTranslated: isTranslated }; + }); + } +}; + + +/***/ }), + +/***/ "./vendor/cadesplugin_api.js": +/*!***********************************!*\ + !*** ./vendor/cadesplugin_api.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +;(function () { + //already loaded + if(window.cadesplugin) + return; + + var pluginObject; + var plugin_resolved = 0; + var plugin_reject; + var plugin_resolve; + var isOpera = 0; + var isFireFox = 0; + var isEdge = 0; + var isSafari = 0; + var failed_extensions = 0; + + var canPromise = !!window.Promise; + var cadesplugin; + + if(canPromise) + { + cadesplugin = new Promise(function(resolve, reject) + { + plugin_resolve = resolve; + plugin_reject = reject; + }); + } else + { + cadesplugin = {}; + } + + function check_browser() { + var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; + if(/trident/i.test(M[1])){ + tem= /\brv[ :]+(\d+)/g.exec(ua) || []; + return {name:'IE',version:(tem[1] || '')}; + } + if(M[1]=== 'Chrome'){ + tem= ua.match(/\b(OPR|Edge)\/(\d+)/); + if(tem!= null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]}; + } + M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; + if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]); + return {name:M[0],version:M[1]}; + } + var browserSpecs = check_browser(); + + function cpcsp_console_log(level, msg){ + //IE9 не может писать в консоль если не открыта вкладка developer tools + if(typeof(console) === 'undefined') + return; + if (level <= cadesplugin.current_log_level ){ + if (level === cadesplugin.LOG_LEVEL_DEBUG) + console.log("DEBUG: %s", msg); + if (level === cadesplugin.LOG_LEVEL_INFO) + console.info("INFO: %s", msg); + if (level === cadesplugin.LOG_LEVEL_ERROR) + console.error("ERROR: %s", msg); + return; + } + } + + function set_log_level(level){ + if (!((level === cadesplugin.LOG_LEVEL_DEBUG) || + (level === cadesplugin.LOG_LEVEL_INFO) || + (level === cadesplugin.LOG_LEVEL_ERROR))){ + cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR, "cadesplugin_api.js: Incorrect log_level: " + level); + return; + } + cadesplugin.current_log_level = level; + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG) + cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, "cadesplugin_api.js: log_level = DEBUG"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO) + cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, "cadesplugin_api.js: log_level = INFO"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR) + cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, "cadesplugin_api.js: log_level = ERROR"); + if(isNativeMessageSupported()) + { + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG) + window.postMessage("set_log_level=debug", "*"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO) + window.postMessage("set_log_level=info", "*"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR) + window.postMessage("set_log_level=error", "*"); + } + } + + function set_constantValues() + { + cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1; + cadesplugin.CAPICOM_CURRENT_USER_STORE = 2; + cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1; + cadesplugin.CADESCOM_CURRENT_USER_STORE = 2; + cadesplugin.CADESCOM_CONTAINER_STORE = 100; + + cadesplugin.CAPICOM_MY_STORE = "My"; + + cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; + + cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; + + cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0; + cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1; + cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2; + + cadesplugin.XmlDsigGost3410UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411"; + cadesplugin.XmlDsigGost3411UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr3411"; + cadesplugin.XmlDsigGost3410Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411"; + cadesplugin.XmlDsigGost3411Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411"; + + cadesplugin.CADESCOM_CADES_DEFAULT = 0; + cadesplugin.CADESCOM_CADES_BES = 1; + cadesplugin.CADESCOM_CADES_T = 0x5; + cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d; + cadesplugin.CADESCOM_PKCS7_TYPE = 0xffff; + + cadesplugin.CADESCOM_ENCODE_BASE64 = 0; + cadesplugin.CADESCOM_ENCODE_BINARY = 1; + cadesplugin.CADESCOM_ENCODE_ANY = -1; + + cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0; + cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1; + cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2; + + cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0; + cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1; + + cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0; + cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; + cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2; + cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4; + cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5; + cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6; + cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7; + cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11; + cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12; + + cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128; + + cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE = 9; + + cadesplugin.CAPICOM_OID_OTHER = 0; + cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION = 10; + + cadesplugin.CAPICOM_EKU_CLIENT_AUTH = 2; + cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON = 5; + cadesplugin.CAPICOM_EKU_OTHER = 0; + + cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; + cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; + cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; + cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; + cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; + cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; + cadesplugin.CADESCOM_ATTRIBUTE_OTHER = -1; + + cadesplugin.CADESCOM_STRING_TO_UCS2LE = 0; + cadesplugin.CADESCOM_BASE64_TO_BINARY = 1; + + cadesplugin.CADESCOM_DISPLAY_DATA_NONE = 0; + cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT = 1; + cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2; + + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25; + + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1 = 0; + cadesplugin.CADESCOM_HASH_ALGORITHM_MD2 = 1; + cadesplugin.CADESCOM_HASH_ALGORITHM_MD4 = 2; + cadesplugin.CADESCOM_HASH_ALGORITHM_MD5 = 3; + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256 = 4; + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384 = 5; + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512 = 6; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112; + + cadesplugin.LOG_LEVEL_DEBUG = 4; + cadesplugin.LOG_LEVEL_INFO = 2; + cadesplugin.LOG_LEVEL_ERROR = 1; + + cadesplugin.CADESCOM_AllowNone = 0; + cadesplugin.CADESCOM_AllowNoOutstandingRequest = 0x1; + cadesplugin.CADESCOM_AllowUntrustedCertificate = 0x2; + cadesplugin.CADESCOM_AllowUntrustedRoot = 0x4; + cadesplugin.CADESCOM_SkipInstallToStore = 0x10000000; + } + + function async_spawn(generatorFunc) { + function continuer(verb, arg) { + var result; + try { + result = generator[verb](arg); + } catch (err) { + return Promise.reject(err); + } + if (result.done) { + return result.value; + } else { + return Promise.resolve(result.value).then(onFulfilled, onRejected); + } + } + var generator = generatorFunc(Array.prototype.slice.call(arguments, 1)); + var onFulfilled = continuer.bind(continuer, "next"); + var onRejected = continuer.bind(continuer, "throw"); + return onFulfilled(); + } + + function isIE() { + // var retVal = (("Microsoft Internet Explorer" == navigator.appName) || // IE < 11 + // navigator.userAgent.match(/Trident\/./i)); // IE 11 + return (browserSpecs.name === 'IE' || browserSpecs.name === 'MSIE'); + } + + function isIOS() { + return (navigator.userAgent.match(/ipod/i) || + navigator.userAgent.match(/ipad/i) || + navigator.userAgent.match(/iphone/i)); + } + + function isNativeMessageSupported() + { + // В IE работаем через NPAPI + if(isIE()) + return false; + // В Edge работаем через NativeMessage + if(browserSpecs.name === 'Edge') { + isEdge = true; + return true; + } + // В Chrome, Firefox, Safari и Opera работаем через асинхронную версию в зависимости от версии + if(browserSpecs.name === 'Opera') { + isOpera = true; + if(browserSpecs.version >= 33){ + return true; + } + else{ + return false; + } + } + if(browserSpecs.name === 'Firefox') { + isFireFox = true; + if(browserSpecs.version >= 52){ + return true; + } + else{ + return false; + } + } + if(browserSpecs.name === 'Chrome') { + if(browserSpecs.version >= 42){ + return true; + } + else{ + return false; + } + } + //В Сафари начиная с 12 версии нет NPAPI + if(browserSpecs.name === 'Safari') { + isSafari = true; + if(browserSpecs.version >= 12) { + return true; + } else { + return false; + } + } + } + + // Функция активации объектов КриптоПро ЭЦП Browser plug-in + function CreateObject(name) { + if (isIOS()) { + // На iOS для создания объектов используется функция + // call_ru_cryptopro_npcades_10_native_bridge, определенная в IOS_npcades_supp.js + return call_ru_cryptopro_npcades_10_native_bridge("CreateObject", [name]); + } + if (isIE()) { + // В Internet Explorer создаются COM-объекты + if (name.match(/X509Enrollment/i)) { + try { + // Объекты CertEnroll пробуем создавать через нашу фабрику, + // если не получилось то через CX509EnrollmentWebClassFactory + var objCertEnrollClassFactory = document.getElementById("webClassFactory"); + return objCertEnrollClassFactory.CreateObject(name); + } + catch (e) { + try { + var objWebClassFactory = document.getElementById("certEnrollClassFactory"); + return objWebClassFactory.CreateObject(name); + } + catch (err) { + throw ("Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS"); + } + } + } + // Объекты CAPICOM и CAdESCOM создаются через CAdESCOM.WebClassFactory + try { + var objWebClassFactory = document.getElementById("webClassFactory"); + return objWebClassFactory.CreateObject(name); + } + catch (e) { + // Для версий плагина ниже 2.0.12538 + return new ActiveXObject(name); + } + } + // создаются объекты NPAPI + return pluginObject.CreateObject(name); + } + + function decimalToHexString(number) { + if (number < 0) { + number = 0xFFFFFFFF + number + 1; + } + + return number.toString(16).toUpperCase(); + } + + function GetMessageFromException(e) { + var err = e.message; + if (!err) { + err = e; + } else if (e.number) { + err += " (0x" + decimalToHexString(e.number) + ")"; + } + return err; + } + + function getLastError(exception) { + if(isNativeMessageSupported() || isIE() || isIOS() ) { + return GetMessageFromException(exception); + } + + try { + return pluginObject.getLastError(); + } catch(e) { + return GetMessageFromException(exception); + } + } + + // Функция для удаления созданных объектов + function ReleasePluginObjects() { + return cpcsp_chrome_nmcades.ReleasePluginObjects(); + } + + // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in + function CreateObjectAsync(name) { + return pluginObject.CreateObjectAsync(name); + } + + //Функции для IOS + var ru_cryptopro_npcades_10_native_bridge = { + callbacksCount : 1, + callbacks : {}, + + // Automatically called by native layer when a result is available + resultForCallback : function resultForCallback(callbackId, resultArray) { + var callback = ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId]; + if (!callback) return; + callback.apply(null,resultArray); + }, + + // Use this in javascript to request native objective-c code + // functionName : string (I think the name is explicit :p) + // args : array of arguments + // callback : function with n-arguments that is going to be called when the native code returned + call : function call(functionName, args, callback) { + var hasCallback = callback && typeof callback === "function"; + var callbackId = hasCallback ? ru_cryptopro_npcades_10_native_bridge.callbacksCount++ : 0; + + if (hasCallback) + ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId] = callback; + + var iframe = document.createElement("IFRAME"); + var arrObjs = new Array("_CPNP_handle"); + try{ + iframe.setAttribute("src", "cpnp-js-call:" + functionName + ":" + callbackId+ ":" + encodeURIComponent(JSON.stringify(args, arrObjs))); + } catch(e){ + alert(e); + } + document.documentElement.appendChild(iframe); + iframe.parentNode.removeChild(iframe); + iframe = null; + } + }; + + function call_ru_cryptopro_npcades_10_native_bridge(functionName, array){ + var tmpobj; + var ex; + ru_cryptopro_npcades_10_native_bridge.call(functionName, array, function(e, response){ + ex = e; + var str='tmpobj='+response; + eval(str); + if (typeof (tmpobj) === "string"){ + tmpobj = tmpobj.replace(/\\\n/gm, "\n"); + tmpobj = tmpobj.replace(/\\\r/gm, "\r"); + } + }); + if(ex) + throw ex; + return tmpobj; + } + + function show_firefox_missing_extension_dialog() + { + if (!window.cadesplugin_skip_extension_install) + { + var ovr = document.createElement('div'); + ovr.id = "cadesplugin_ovr"; + ovr.style = "visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)"; + ovr.innerHTML = "
" + + "" + + "

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

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

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

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

" + + "
"; + document.getElementsByTagName("Body")[0].appendChild(ovr); + var btn_install = document.getElementById("cadesplugin_install"); + btn_install.addEventListener('click', function(event) { + opr.addons.installExtension("epebfcehmdedogndhlcacafjaacknbcm", + function() + { + document.getElementById("cadesplugin_ovr").style.visibility = 'hidden'; + location.reload(); + }, + function(){}) + }); + document.getElementById("cadesplugin_close_install").addEventListener('click',function() + { + plugin_loaded_error("Плагин недоступен"); + document.getElementById("cadesplugin_ovr").style.visibility = 'hidden'; + }); + + ovr.addEventListener('click',function() + { + plugin_loaded_error("Плагин недоступен"); + document.getElementById("cadesplugin_ovr").style.visibility = 'hidden'; + }); + ovr.style.visibility="visible"; + document.getElementById("cadesplugin_ovr_item").addEventListener('click',function(e){ + e.stopPropagation(); + }); + }); + }else + { + plugin_loaded_error("Плагин недоступен"); + } + } + + function firefox_or_edge_nmcades_onload() { + cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error); + } + + function nmcades_api_onload () { + window.postMessage("cadesplugin_echo_request", "*"); + window.addEventListener("message", function (event){ + if (typeof(event.data) !== "string" || !event.data.match("cadesplugin_loaded")) + return; + if(isFireFox || isEdge || isSafari) + { + // Для Firefox, Сафари, Edge вместе с сообщением cadesplugin_loaded прилетает url для загрузки nmcades_plugin_api.js + var url = event.data.substring(event.data.indexOf("url:") + 4); + var fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", url); + fileref.onerror = plugin_loaded_error; + fileref.onload = firefox_or_edge_nmcades_onload; + document.getElementsByTagName("head")[0].appendChild(fileref); + // Для Firefox, Safari и Edge у нас только по одному расширению. + failed_extensions++; + }else { + cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error); + } + }, false); + } + + //Загружаем расширения для Chrome, Opera, YaBrowser, FireFox, Edge, Safari + function load_extension() + { + + if(isFireFox || isEdge || isSafari){ + // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера. + nmcades_api_onload(); + } else { + // в асинхронном варианте для chrome и opera подключаем оба расширения + var fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", "chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js"); + fileref.onerror = plugin_loaded_error; + fileref.onload = nmcades_api_onload; + document.getElementsByTagName("head")[0].appendChild(fileref); + fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", "chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js"); + fileref.onerror = plugin_loaded_error; + fileref.onload = nmcades_api_onload; + document.getElementsByTagName("head")[0].appendChild(fileref); + } + } + + //Загружаем плагин для NPAPI + function load_npapi_plugin() + { + var elem = document.createElement('object'); + elem.setAttribute("id", "cadesplugin_object"); + elem.setAttribute("type", "application/x-cades"); + elem.setAttribute("style", "visibility: hidden"); + document.getElementsByTagName("body")[0].appendChild(elem); + pluginObject = document.getElementById("cadesplugin_object"); + if(isIE()) + { + var elem1 = document.createElement('object'); + elem1.setAttribute("id", "certEnrollClassFactory"); + elem1.setAttribute("classid", "clsid:884e2049-217d-11da-b2a4-000e7bbb2b09"); + elem1.setAttribute("style", "visibility: hidden"); + document.getElementsByTagName("body")[0].appendChild(elem1); + var elem2 = document.createElement('object'); + elem2.setAttribute("id", "webClassFactory"); + elem2.setAttribute("classid", "clsid:B04C8637-10BD-484E-B0DA-B8A039F60024"); + elem2.setAttribute("style", "visibility: hidden"); + document.getElementsByTagName("body")[0].appendChild(elem2); + } + } + + //Отправляем событие что все ок. + function plugin_loaded() + { + plugin_resolved = 1; + if(canPromise) + { + plugin_resolve(); + }else { + window.postMessage("cadesplugin_loaded", "*"); + } + } + + //Отправляем событие что сломались. + function plugin_loaded_error(msg) + { + if(isNativeMessageSupported()) + { + //в асинхронном варианте подключаем оба расширения, если сломались оба пробуем установить для Opera + failed_extensions++; + if(failed_extensions<2) + return; + if(isOpera && (typeof(msg) === 'undefined'|| typeof(msg) === 'object')) + { + install_opera_extension(); + return; + } + } + if(typeof(msg) === 'undefined' || typeof(msg) === 'object') + msg = "Плагин недоступен"; + plugin_resolved = 1; + if(canPromise) + { + plugin_reject(msg); + } else { + window.postMessage("cadesplugin_load_error", "*"); + } + } + + //проверяем что у нас хоть какое то событие ушло, и если не уходило кидаем еще раз ошибку + function check_load_timeout() + { + if(plugin_resolved === 1) + return; + if(isFireFox) + { + show_firefox_missing_extension_dialog(); + } + plugin_resolved = 1; + if(canPromise) + { + plugin_reject("Истекло время ожидания загрузки плагина"); + } else { + window.postMessage("cadesplugin_load_error", "*"); + } + + } + + //Вспомогательная функция для NPAPI + function createPromise(arg) + { + return new Promise(arg); + } + + function check_npapi_plugin (){ + try { + var oAbout = CreateObject("CAdESCOM.About"); + plugin_loaded(); + } + catch (err) { + document.getElementById("cadesplugin_object").style.display = 'none'; + // Объект создать не удалось, проверим, установлен ли + // вообще плагин. Такая возможность есть не во всех браузерах + var mimetype = navigator.mimeTypes["application/x-cades"]; + if (mimetype) { + var plugin = mimetype.enabledPlugin; + if (plugin) { + plugin_loaded_error("Плагин загружен, но не создаются обьекты"); + }else + { + plugin_loaded_error("Ошибка при загрузке плагина"); + } + }else + { + plugin_loaded_error("Плагин недоступен"); + } + } + } + + //Проверяем работает ли плагин + function check_plugin_working() + { + var div = document.createElement("div"); + div.innerHTML = ""; + var isIeLessThan9 = (div.getElementsByTagName("i").length === 1); + if (isIeLessThan9) { + plugin_loaded_error("Internet Explorer версии 8 и ниже не поддерживается"); + return; + } + + if(isNativeMessageSupported()) + { + load_extension(); + }else if(!canPromise) { + window.addEventListener("message", function (event){ + if (event.data !== "cadesplugin_echo_request") + return; + load_npapi_plugin(); + check_npapi_plugin(); + }, + false); + }else + { + if(document.readyState === "complete"){ + load_npapi_plugin(); + check_npapi_plugin(); + } else { + window.addEventListener("load", function (event) { + load_npapi_plugin(); + check_npapi_plugin(); + }, false); + } + } + } + + function set_pluginObject(obj) + { + pluginObject = obj; + } + + function is_capilite_enabled() + { + if ((typeof (cadesplugin.EnableInternalCSP) !== 'undefined') && cadesplugin.EnableInternalCSP) + return true; + return false; + }; + + //Export + cadesplugin.JSModuleVersion = "2.1.2"; + cadesplugin.async_spawn = async_spawn; + cadesplugin.set = set_pluginObject; + cadesplugin.set_log_level = set_log_level; + cadesplugin.getLastError = getLastError; + cadesplugin.is_capilite_enabled = is_capilite_enabled; + + if(isNativeMessageSupported()) + { + cadesplugin.CreateObjectAsync = CreateObjectAsync; + cadesplugin.ReleasePluginObjects = ReleasePluginObjects; + } + + if(!isNativeMessageSupported()) + { + cadesplugin.CreateObject = CreateObject; + } + + if(window.cadesplugin_load_timeout) + { + setTimeout(check_load_timeout, window.cadesplugin_load_timeout); + } + else + { + setTimeout(check_load_timeout, 20000); + } + + set_constantValues(); + + cadesplugin.current_log_level = cadesplugin.LOG_LEVEL_ERROR; + window.cadesplugin = cadesplugin; + check_plugin_working(); +}()); + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=crypto-pro.js.map \ No newline at end of file diff --git a/dist/crypto-pro.js.map b/dist/crypto-pro.js.map new file mode 100644 index 0000000..e9e02c7 --- /dev/null +++ b/dist/crypto-pro.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://cryptoPro/webpack/universalModuleDefinition","webpack://cryptoPro/webpack/bootstrap","webpack://cryptoPro/./api/certificate/certificate.ts","webpack://cryptoPro/./api/certificate/exportBase64.ts","webpack://cryptoPro/./api/certificate/getAlgorithm.ts","webpack://cryptoPro/./api/certificate/getCadesProp.ts","webpack://cryptoPro/./api/certificate/getDecodedExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getInfo.ts","webpack://cryptoPro/./api/certificate/hasExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/index.ts","webpack://cryptoPro/./api/certificate/isValid.ts","webpack://cryptoPro/./api/createSignature.ts","webpack://cryptoPro/./api/getCertificate.ts","webpack://cryptoPro/./api/getSystemInfo.ts","webpack://cryptoPro/./api/getUserCertificates.ts","webpack://cryptoPro/./api/index.ts","webpack://cryptoPro/./api/isValidSystemSetup.ts","webpack://cryptoPro/./constants/cades-constants.ts","webpack://cryptoPro/./constants/index.ts","webpack://cryptoPro/./constants/issuer-tags-translations.ts","webpack://cryptoPro/./constants/oids-dictionary.ts","webpack://cryptoPro/./constants/subject-tags-translations.ts","webpack://cryptoPro/./crypto-pro.ts","webpack://cryptoPro/./helpers/_afterPluginsLoaded.ts","webpack://cryptoPro/./helpers/_extractCommonName.ts","webpack://cryptoPro/./helpers/_extractMeaningfulErrorMessage.ts","webpack://cryptoPro/./helpers/_generateCadesFn.ts","webpack://cryptoPro/./helpers/_getCadesCert.ts","webpack://cryptoPro/./helpers/_getDateObj.ts","webpack://cryptoPro/./helpers/_isSupportedCSPVersion.ts","webpack://cryptoPro/./helpers/_isSupportedCadesVersion.ts","webpack://cryptoPro/./helpers/_parseCertInfo.ts","webpack://cryptoPro/./vendor/cadesplugin_api.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA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CAAC;YAEhB,IAAI,cAAc,EAAE;gBAClB,KAAK,GAAG,cAAc,CAAC;gBACvB,YAAY,GAAG,IAAI,CAAC;aACrB;YAED,OAAO,EAAE,WAAW,eAAE,KAAK,SAAE,YAAY,gBAAE,CAAC;QAC9C,CAAC,CAAC,CAAC;KACJ;AACH,CAAC,CAAC;;;;;;;;;;;;AClDF,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA,gBAAgB;AAChB;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;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;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,yDAAyD;AACzD;AACA;;AAEA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB,WAAW,UAAU,YAAY,aAAa;AAC3G,qFAAqF,aAAa,mBAAmB,uBAAuB,uBAAuB,cAAc,mBAAmB,YAAY;AAChN,4EAA4E,iBAAiB,yBAAyB,WAAW;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,iBAAiB,WAAW,UAAU,YAAY,aAAa;AAC/G,yFAAyF,aAAa,mBAAmB,uBAAuB,uBAAuB,cAAc,mBAAmB,YAAY;AACpN,gFAAgF,iBAAiB,yBAAyB,WAAW;AACrI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,oCAAoC;AACpC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;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,SAAS;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,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,CAAC","file":"crypto-pro.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cryptoPro\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cryptoPro\"] = factory();\n\telse\n\t\troot[\"cryptoPro\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./crypto-pro.ts\");\n","import { ISSUER_TAGS_TRANSLATIONS, SUBJECT_TAGS_TRANSLATIONS } from '../../constants';\nimport { TagTranslation } from '../../helpers/_parseCertInfo';\nimport { exportBase64 } from './exportBase64';\nimport { getAlgorithm } from './getAlgorithm';\nimport { getCadesProp } from './getCadesProp';\nimport { getDecodedExtendedKeyUsage, ExtendedKeysTranslations } from './getDecodedExtendedKeyUsage';\nimport { getExtendedKeyUsage } from './getExtendedKeyUsage';\nimport { getInfo } from './getInfo';\nimport { hasExtendedKeyUsage } from './hasExtendedKeyUsage';\nimport { isValid } from './isValid';\n\nexport type CadesCertificate = any;\n\nexport class Certificate {\n constructor(\n public _cadesCertificate: CadesCertificate,\n public name: string,\n public issuerName: string,\n public subjectName: string,\n public thumbprint: string,\n public validFrom: string,\n public validTo: string,\n ) {}\n\n public getOwnerInfo(): Promise {\n return getInfo.call(this, SUBJECT_TAGS_TRANSLATIONS, 'SubjectName');\n }\n\n public getIssuerInfo(): Promise {\n return getInfo.call(this, ISSUER_TAGS_TRANSLATIONS, 'IssuerName');\n }\n\n public getExtendedKeyUsage(): Promise {\n return getExtendedKeyUsage.call(this);\n }\n\n public getDecodedExtendedKeyUsage(): Promise {\n return getDecodedExtendedKeyUsage.call(this);\n }\n\n public getAlgorithm(): Promise {\n return getAlgorithm.call(this);\n }\n\n public getCadesProp(propName): Promise {\n return getCadesProp.call(this, propName);\n }\n\n public isValid(): Promise {\n return isValid.call(this);\n }\n\n public exportBase64(): Promise {\n return exportBase64.call(this);\n }\n\n public hasExtendedKeyUsage(oids): Promise {\n return hasExtendedKeyUsage.call(this, oids);\n }\n}\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Экспортирует сертификат в формате base64\n *\n * @returns сертификат в формате base64\n */\nexport const exportBase64 = _afterPluginsLoaded(function (): string {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function exportBase64(): string {\n let base64: string;\n\n try {\n base64 = __cadesAsyncToken__ + cadesCertificate.Export(0);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при экспорте сертификата');\n }\n\n return base64;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\ninterface AlgorithmInfo {\n algorithm: string;\n oid: string;\n}\n\n/**\n * Возвращает информацию об алгоритме сертификата\n *\n * @returns информацию об алгоритме и его OID'е\n */\nexport const getAlgorithm = _afterPluginsLoaded(function (): AlgorithmInfo {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getAlgorithm(): AlgorithmInfo {\n const algorithmInfo: AlgorithmInfo = {\n algorithm: null,\n oid: null,\n };\n let cadesPublicKey;\n\n try {\n cadesPublicKey = __cadesAsyncToken__ + cadesCertificate.PublicKey();\n cadesPublicKey = __cadesAsyncToken__ + cadesPublicKey.Algorithm;\n algorithmInfo.algorithm = __cadesAsyncToken__ + cadesPublicKey.FriendlyName;\n algorithmInfo.oid = __cadesAsyncToken__ + cadesPublicKey.Value;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении алгоритма');\n }\n\n return algorithmInfo;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает указанное внутренее свойство у сертификата в формате Cades\n *\n * @param propName = наименование свойства\n * @returns значение запрошенного свойства\n */\nexport const getCadesProp = _afterPluginsLoaded(function (propName: string): any {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getCadesProp() {\n let propertyValue;\n\n try {\n propertyValue = __cadesAsyncToken__ + cadesCertificate[propName];\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при обращении к свойству сертификата');\n }\n\n return propertyValue;\n }),\n );\n});\n","import { OIDS_DICTIONARY } from '../../constants';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\nexport interface ExtendedKeysTranslations {\n [key: string]: string | null;\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы сертификата\n *\n * @returns словарь расшифрованных ОИД'ов\n */\nexport const getDecodedExtendedKeyUsage = _afterPluginsLoaded(async function (): Promise {\n const certificateOids = await (this as Certificate).getExtendedKeyUsage();\n\n return certificateOids.reduce(\n (decodedOids, oidCode) => ({\n ...decodedOids,\n [oidCode]: OIDS_DICTIONARY[oidCode] || null,\n }),\n {},\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает ОИД'ы сертификата\n *\n * @returns список ОИД'ов\n */\nexport const getExtendedKeyUsage = _afterPluginsLoaded(function (): string[] {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getExtendedKeyUsage(): string[] {\n const OIDS: string[] = [];\n let count: any;\n\n try {\n count = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n count = __cadesAsyncToken__ + count.EKUs;\n count = __cadesAsyncToken__ + count.Count;\n\n if (count > 0) {\n while (count > 0) {\n let cadesExtendedKeyUsage;\n\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.EKUs;\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.Item(count);\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.OID;\n\n OIDS.push(cadesExtendedKeyUsage);\n\n count--;\n }\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || \"Ошибка при получении ОИД'ов\");\n }\n\n return OIDS;\n }),\n );\n});\n","import { TagsTranslations } from '../../constants/tags-translations';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { _parseCertInfo, TagTranslation } from '../../helpers/_parseCertInfo';\nimport { getCadesProp } from './getCadesProp';\n\n/**\n * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам\n *\n * @param tags = словарь\n * @param entitiesPath = путь к разбираемой сущности\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const getInfo = _afterPluginsLoaded(async function (\n tags: TagsTranslations[],\n entitiesPath: string,\n): Promise {\n let entities: string;\n\n try {\n entities = await getCadesProp.call(this, entitiesPath);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при извлечении информации из сертификата');\n }\n\n return _parseCertInfo(tags, entities);\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет наличие ОИД'а (ОИД'ов) у сертификата\n *\n * @param oids - ОИД'ы для проверки\n * @returns флаг наличия ОИД'ов у сертификата\n */\nexport const hasExtendedKeyUsage = _afterPluginsLoaded(async function (oids: string | string[]): Promise {\n const certOids = await (this as Certificate).getExtendedKeyUsage();\n\n let result: boolean;\n\n if (Array.isArray(oids)) {\n result = oids.every((oidToCheck) => certOids.some((certOid) => certOid === oidToCheck));\n } else {\n result = certOids.some((certOid) => certOid === oids);\n }\n\n return result;\n});\n","export * from './certificate';\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет действительность сертификата\n *\n * @returns флаг валидности\n */\nexport const isValid = _afterPluginsLoaded(function (): boolean {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function isValid() {\n let isValid;\n\n try {\n isValid = __cadesAsyncToken__ + cadesCertificate.IsValid();\n isValid = __cadesAsyncToken__ + isValid.Result;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при проверке сертификата');\n }\n\n return Boolean(isValid);\n }),\n );\n});\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Создает подпись base64 строки по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param dataBase64 - строковые данные в формате base64\n * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false)\n * @returns подпись\n */\nexport const createSignature = _afterPluginsLoaded(\n async (thumbprint: string, dataBase64: string, detachedSignature: boolean = true): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function signData(): string {\n let cadesAttrs;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesSignedData.propset_Content(dataBase64));\n void (\n __cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n signature =\n __cadesAsyncToken__ +\n cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_CADES_BES, detachedSignature);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { Certificate } from './certificate';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { getUserCertificates } from './getUserCertificates';\n\n/**\n * Возвращает сертификат по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат\n */\nexport const getCertificate = _afterPluginsLoaded(\n async (thumbprint: string): Promise => {\n if (!thumbprint) {\n throw new Error('Отпечаток не указан');\n }\n\n const availableCertificates: Certificate[] = await getUserCertificates();\n const foundCertificate: Certificate = availableCertificates.find((cert) => cert.thumbprint === thumbprint);\n\n if (!foundCertificate) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n return foundCertificate;\n },\n);\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nexport interface SystemInfo {\n cadesVersion: string;\n cspVersion: string;\n}\n\n/**\n * Предоставляет информацию о системе\n *\n * @returns информацию о CSP и плагине\n */\nexport const getSystemInfo = _afterPluginsLoaded(\n (): SystemInfo => {\n const sysInfo = {\n cadesVersion: null,\n cspVersion: null,\n };\n\n return eval(\n _generateCadesFn(function getSystemInfo(): SystemInfo {\n let cadesAbout;\n\n try {\n cadesAbout = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.About');\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.PluginVersion;\n sysInfo.cspVersion = __cadesAsyncToken__ + cadesAbout.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.Version;\n }\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = __cadesAsyncToken__ + sysInfo.cspVersion.toString();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении информации о системе');\n }\n\n return sysInfo;\n }),\n );\n },\n);\n","import { CadesCertificate, Certificate } from './certificate';\nimport { CAPICOM_PROPID_KEY_PROV_INFO } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractCommonName } from '../helpers/_extractCommonName';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nlet certificatesCache: Certificate[];\n\n/**\n * Возвращает список сертификатов, доступных пользователю в системе\n *\n * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов\n * @returns список сертификатов\n */\nexport const getUserCertificates = _afterPluginsLoaded((resetCache: boolean = false): Certificate[] => {\n const { cadesplugin } = window;\n\n if (!resetCache && certificatesCache) {\n return certificatesCache;\n }\n\n return eval(\n _generateCadesFn(function getCertsList(): Certificate[] {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificates;\n let cadesCertificatesCount;\n\n try {\n cadesCertificates = __cadesAsyncToken__ + cadesStore.Certificates;\n\n if (cadesCertificates) {\n cadesCertificates =\n __cadesAsyncToken__ + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n */\n cadesCertificates =\n __cadesAsyncToken__ +\n cadesCertificates.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n CAPICOM_PROPID_KEY_PROV_INFO,\n );\n\n cadesCertificatesCount = __cadesAsyncToken__ + cadesCertificates.Count;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!cadesCertificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n const certificateList: Certificate[] = [];\n\n try {\n while (cadesCertificatesCount) {\n const cadesCertificate: CadesCertificate =\n __cadesAsyncToken__ + cadesCertificates.Item(cadesCertificatesCount);\n\n certificateList.push(\n new Certificate(\n cadesCertificate,\n _extractCommonName(__cadesAsyncToken__ + cadesCertificate.SubjectName),\n __cadesAsyncToken__ + cadesCertificate.IssuerName,\n __cadesAsyncToken__ + cadesCertificate.SubjectName,\n __cadesAsyncToken__ + cadesCertificate.Thumbprint,\n __cadesAsyncToken__ + cadesCertificate.ValidFromDate,\n __cadesAsyncToken__ + cadesCertificate.ValidToDate,\n ),\n );\n\n cadesCertificatesCount--;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка обработки сертификатов');\n }\n\n cadesStore.Close();\n\n certificatesCache = certificateList;\n\n return certificatesCache;\n }),\n );\n});\n","export * from './getCertificate';\nexport * from './getUserCertificates';\nexport * from './getSystemInfo';\nexport * from './isValidSystemSetup';\nexport * from './createSignature';\nexport * from './certificate';\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { _isSupportedCadesVersion } from '../helpers/_isSupportedCadesVersion';\nimport { _isSupportedCSPVersion } from '../helpers/_isSupportedCSPVersion';\nimport { getSystemInfo, SystemInfo } from './getSystemInfo';\n\n/**\n * Проверяет корректность настроек ЭП на машине\n *\n * @returns флаг корректности настроек\n */\nexport const isValidSystemSetup = _afterPluginsLoaded(\n async (): Promise => {\n let systemInfo: SystemInfo;\n\n try {\n systemInfo = await getSystemInfo();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Настройки ЭП на данной машине не верны');\n }\n\n if (!_isSupportedCadesVersion(systemInfo.cadesVersion)) {\n throw new Error('Не поддерживаемая версия плагина');\n }\n\n if (!_isSupportedCSPVersion(systemInfo.cspVersion)) {\n throw new Error('Не поддерживаемая версия CSP');\n }\n\n return true;\n },\n);\n","export const CADESCOM_ATTRIBUTE_OTHER = -1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CADESCOM_AllowNoOutstandingRequest = 1;\nexport const CADESCOM_AllowNone = 0;\nexport const CADESCOM_AllowUntrustedCertificate = 2;\nexport const CADESCOM_AllowUntrustedRoot = 4;\nexport const CADESCOM_BASE64_TO_BINARY = 0x01;\nexport const CADESCOM_CADES_BES = 1;\nexport const CADESCOM_CADES_DEFAULT = 0;\nexport const CADESCOM_CADES_T = 5;\nexport const CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\nexport const CADESCOM_CONTAINER_STORE = 100;\nexport const CADESCOM_CURRENT_USER_STORE = 2;\nexport const CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\nexport const CADESCOM_DISPLAY_DATA_CONTENT = 1;\nexport const CADESCOM_DISPLAY_DATA_NONE = 0;\nexport const CADESCOM_ENCODE_ANY = -1;\nexport const CADESCOM_ENCODE_BASE64 = 0;\nexport const CADESCOM_ENCODE_BINARY = 1;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\nexport const CADESCOM_HASH_ALGORITHM_MD2 = 1;\nexport const CADESCOM_HASH_ALGORITHM_MD4 = 2;\nexport const CADESCOM_HASH_ALGORITHM_MD5 = 3;\nexport const CADESCOM_HASH_ALGORITHM_SHA1 = 0;\nexport const CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\nexport const CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\nexport const CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\nexport const CADESCOM_LOCAL_MACHINE_STORE = 1;\nexport const CADESCOM_PKCS7_TYPE = 65535;\nexport const CADESCOM_STRING_TO_UCS2LE = 0x00;\nexport const CADESCOM_SkipInstallToStore = 268435456;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\nexport const CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\nexport const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\nexport const CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\nexport const CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\nexport const CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\nexport const CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\nexport const CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\nexport const CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\nexport const CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\nexport const CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\nexport const CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\nexport const CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\nexport const CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\nexport const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\nexport const CAPICOM_CURRENT_USER_STORE = 2;\nexport const CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\nexport const CAPICOM_EKU_CLIENT_AUTH = 2;\nexport const CAPICOM_EKU_OTHER = 0;\nexport const CAPICOM_EKU_SMARTCARD_LOGON = 5;\nexport const CAPICOM_LOCAL_MACHINE_STORE = 1;\nexport const CAPICOM_MEMORY_STORE = 0;\nexport const CAPICOM_MY_STORE = 'My';\nexport const CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\nexport const CAPICOM_OID_OTHER = 0;\nexport const CAPICOM_PROPID_ACCESS_STATE = 14;\nexport const CAPICOM_PROPID_ARCHIVED = 19;\nexport const CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65;\nexport const CAPICOM_PROPID_AUTO_ENROLL = 21;\nexport const CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23;\nexport const CAPICOM_PROPID_CTL_USAGE = 9;\nexport const CAPICOM_PROPID_DATE_STAMP = 27;\nexport const CAPICOM_PROPID_DESCRIPTION = 13;\nexport const CAPICOM_PROPID_EFS = 17;\nexport const CAPICOM_PROPID_ENHKEY_USAGE = 9;\nexport const CAPICOM_PROPID_ENROLLMENT = 26;\nexport const CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30;\nexport const CAPICOM_PROPID_FIRST_RESERVED = 66;\nexport const CAPICOM_PROPID_FIRST_USER = 0x00008000;\nexport const CAPICOM_PROPID_FORTEZZA_DATA = 18;\nexport const CAPICOM_PROPID_FRIENDLY_NAME = 11;\nexport const CAPICOM_PROPID_HASH_PROP = 3;\nexport const CAPICOM_PROPID_IE30_RESERVED = 7;\nexport const CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24;\nexport const CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28;\nexport const CAPICOM_PROPID_KEY_CONTEXT = 5;\nexport const CAPICOM_PROPID_KEY_IDENTIFIER = 20;\nexport const CAPICOM_PROPID_KEY_PROV_HANDLE = 1;\nexport const CAPICOM_PROPID_KEY_PROV_INFO = 2;\nexport const CAPICOM_PROPID_KEY_SPEC = 6;\nexport const CAPICOM_PROPID_LAST_RESERVED = 0x00007fff;\nexport const CAPICOM_PROPID_LAST_USER = 0x0000ffff;\nexport const CAPICOM_PROPID_MD5_HASH = 4;\nexport const CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10;\nexport const CAPICOM_PROPID_PUBKEY_ALG_PARA = 22;\nexport const CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8;\nexport const CAPICOM_PROPID_PVK_FILE = 12;\nexport const CAPICOM_PROPID_RENEWAL = 64;\nexport const CAPICOM_PROPID_SHA1_HASH = 3;\nexport const CAPICOM_PROPID_SIGNATURE_HASH = 15;\nexport const CAPICOM_PROPID_SMART_CARD_DATA = 16;\nexport const CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29;\nexport const CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25;\nexport const CAPICOM_PROPID_UNKNOWN = 0;\nexport const CAPICOM_SMART_CARD_USER_STORE = 4;\nexport const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128;\nexport const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256;\nexport const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\nexport const CAPICOM_STORE_OPEN_READ_ONLY = 0;\nexport const CAPICOM_STORE_OPEN_READ_WRITE = 1;\nexport const CHECK_NONE = 0;\nexport const CHECK_OFFLINE_REVOCATION_STATUS = 16;\nexport const CHECK_ONLINE_REVOCATION_STATUS = 8;\nexport const CHECK_SIGNATURE_VALIDITY = 4;\nexport const CHECK_TIME_VALIDITY = 2;\nexport const CHECK_TRUSTED_ROOT = 1;\nexport const LOG_LEVEL_DEBUG = 4;\nexport const LOG_LEVEL_ERROR = 1;\nexport const LOG_LEVEL_INFO = 2;\nexport const TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144;\nexport const TRUST_CTL_IS_NOT_TIME_VALID = 131072;\nexport const TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288;\nexport const TRUST_IS_CYCLIC = 128;\nexport const TRUST_IS_NOT_SIGNATURE_VALID = 8;\nexport const TRUST_IS_NOT_TIME_NESTED = 2;\nexport const TRUST_IS_NOT_TIME_VALID = 1;\nexport const TRUST_IS_NOT_VALID_FOR_USAGE = 16;\nexport const TRUST_IS_PARTIAL_CHAIN = 65536;\nexport const TRUST_IS_REVOKED = 4;\nexport const TRUST_IS_UNTRUSTED_ROOT = 32;\nexport const TRUST_REVOCATION_STATUS_UNKNOWN = 64;\nexport const XmlDsigGost3410Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411';\nexport const XmlDsigGost3410UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411';\nexport const XmlDsigGost3411Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411';\nexport const XmlDsigGost3411UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr3411';\n","export * from './cades-constants';\nexport * from './issuer-tags-translations';\nexport * from './oids-dictionary';\nexport * from './subject-tags-translations';\n","import { TagsTranslations } from './tags-translations';\n\nexport const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Удостоверяющий центр' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Тип' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","export const OIDS_DICTIONARY = {\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\n '1.2.643.3.8.100.1': 'Сертификат типа \"ekey-ГОСТ\"',\n '1.2.643.3.8.100.1.1': 'Общее использование в системах ИОК без права заверения финансовых документов',\n '1.2.643.3.8.100.1.10':\n 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11':\n 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13':\n 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.3.8.100.1.2': 'Передача отчетности по ТКС',\n '1.2.643.3.8.100.1.3': 'Оформление взаимных обязательств, соглашений, договоров, актов и т.п.',\n '1.2.643.3.8.100.1.4': 'Внутрикорпоративный документооборот',\n '1.2.643.3.8.100.1.5': 'Использование в системах электронной торговли',\n '1.2.643.3.8.100.1.6': 'Использование в торгово-закупочной системе \"ЭЛЕКТРА\"',\n '1.2.643.3.8.100.1.7': 'Использование в системе Портал государственных закупок Ставропольского края.',\n '1.2.643.3.8.100.1.8': 'Использование в Единой системе электронной торговли B2B-Center и B2G.',\n '1.2.643.3.8.100.1.9':\n 'Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа',\n '1.2.643.5.1.24.2.1.3':\n 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1':\n 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3':\n 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\n '1.2.643.6.2.1.7.1':\n 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.2.643.6.2.1.7.2':\n 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.3':\n 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.6.3.1.1': 'Использование на электронных площадок отобранных для проведения аукционах в электронной форме',\n '1.2.643.6.3.1.2.1': 'Тип участника - Юридическое лицо',\n '1.2.643.6.3.1.2.2': 'Тип участника - Физическое лицо',\n '1.2.643.6.3.1.2.3': 'Тип участника - Индивидуальный предприниматель',\n '1.2.643.6.3.1.3.1': 'Участник размещения заказа',\n '1.2.643.6.3.1.4.1': 'Администратор организации',\n '1.2.643.6.3.1.4.2': 'Уполномоченный специалист',\n '1.2.643.6.3.1.4.3': 'Специалист с правом подписи контракта',\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\n '1.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"',\n};\n","import { TagsTranslations } from './tags-translations';\n\nexport const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Владелец' },\n { possibleNames: ['SN'], translation: 'Фамилия' },\n { possibleNames: ['G'], translation: 'Имя Отчество' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Отдел/подразделение' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","export * from './api';\n","import { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\n\ntype Unpromisify = T extends Promise ? R : T;\n\nlet isSetLogLevel = false;\nlet isPluginLoaded = false;\n\nexport const _afterPluginsLoaded = any>(\n fn: T,\n): ((...args: Parameters) => Promise>>) => {\n const canPromise = Boolean(window.Promise);\n\n return async function (...args: Parameters): Promise>> {\n if (!isPluginLoaded) {\n try {\n require('../vendor/cadesplugin_api');\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при подключении модуля для работы с Cades plugin',\n );\n }\n\n isPluginLoaded = true;\n }\n\n const { cadesplugin } = window;\n\n if (!canPromise) {\n throw new Error('Необходим полифилл для Promise');\n }\n\n if (!cadesplugin) {\n throw new Error('Не подключен модуль для работы с Cades plugin');\n }\n\n if (!isSetLogLevel) {\n cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR);\n\n isSetLogLevel = true;\n }\n\n try {\n await cadesplugin;\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации модуля для работы с Cades plugin',\n );\n }\n\n return await fn.apply(this, args);\n };\n};\n","export const _extractCommonName = (subjectName: string): string | undefined =>\n subjectName.match(/CN=(.+?)(?:,|$)/)?.[1];\n","export const _extractMeaningfulErrorMessage = (error: Error): string | null => {\n let errorContainer = window.cadesplugin?.getLastError && window.cadesplugin.getLastError(error);\n\n if (!errorContainer?.message) {\n if (!error.message) {\n return null;\n }\n\n errorContainer = error;\n }\n\n const containsRussianLetters = /[а-яА-Я]/.test(errorContainer.message);\n\n if (!containsRussianLetters) {\n return null;\n }\n\n const searchResult = errorContainer.message.match(/^(.*?)(?:(?:\\.?\\s?\\(?0x)|(?:\\.?$))/);\n\n return searchResult ? searchResult[1] : null;\n};\n","// синтетические переменные, которые подменяются в рантайме\nexport const __cadesAsyncToken__ = {};\nexport const __createCadesPluginObject__ = (...args): any => ({});\n\nfunction getGeneratorConstructor(): GeneratorFunction {\n return new Function('', 'return Object.getPrototypeOf(function*(){}).constructor')();\n}\n\nexport const _generateCadesFn = (callback: Function): string => {\n const { cadesplugin } = window;\n const cadesGeneratorsAPI = Boolean(cadesplugin.CreateObjectAsync);\n const callbackName = callback.name || 'dynamicFn';\n const callbackLiteral = String(callback);\n const callbackArguments = callbackLiteral.match(/^function[\\s\\w]*?\\((.*?)\\)/)?.[1] || '';\n const callbackBody = callbackLiteral.replace(/^.*?{([\\s\\S]*?)}$/, '$1');\n let crossEnvCallbackLiteral = String(\n new (cadesGeneratorsAPI ? getGeneratorConstructor() : Function)(callbackArguments, callbackBody),\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__createCadesPluginObject__(\\([\\s\\S]*?\\))/gm,\n `cadesplugin.CreateObject${cadesGeneratorsAPI ? 'Async' : ''}$1`,\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__cadesAsyncToken__\\s*?\\+\\s*?\\b/gm,\n cadesGeneratorsAPI ? 'yield ' : '',\n );\n\n if (!cadesGeneratorsAPI) {\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/propset_(.*?)\\((.*?)\\)/gm, '$1 = $2');\n }\n\n return [\n cadesGeneratorsAPI ? `cadesplugin.async_spawn(${crossEnvCallbackLiteral});` : `(${crossEnvCallbackLiteral})();`,\n `//# sourceURL=crypto-pro_${callbackName}.js`,\n ].join('');\n};\n","import { CadesCertificate } from '../api/certificate';\nimport { _afterPluginsLoaded } from './_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from './_generateCadesFn';\n\n/**\n * Возвращает сертификат в формате Cades по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат в формате Cades\n */\nexport const _getCadesCert = _afterPluginsLoaded(\n (thumbprint: string): CadesCertificate => {\n const { cadesplugin } = window;\n\n return eval(\n _generateCadesFn(function _getCadesCert() {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n if (!cadesStore) {\n throw new Error('Не удалось получить доступ к хранилищу сертификатов');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificateList;\n let certificatesCount;\n\n try {\n cadesCertificateList = __cadesAsyncToken__ + cadesStore.Certificates;\n certificatesCount = __cadesAsyncToken__ + cadesCertificateList.Count;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!certificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n let cadesCertificate: CadesCertificate;\n\n try {\n cadesCertificateList =\n __cadesAsyncToken__ + cadesCertificateList.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint);\n\n const count = __cadesAsyncToken__ + cadesCertificateList.Count;\n\n if (!count) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n cadesCertificate = __cadesAsyncToken__ + cadesCertificateList.Item(1);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата');\n }\n\n cadesStore.Close();\n\n return cadesCertificate;\n }),\n );\n },\n);\n","/**\n * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера.\n *\n * В IE необходимо использовать специфичный формат \"VT_DATE\"\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate\n */\nexport const _getDateObj = (dateObj): Date => (dateObj.getVarDate ? dateObj.getVarDate() : dateObj);\n","const oldestSupportedCSPVersion = 4.0;\n\nexport const _isSupportedCSPVersion = (version: string): boolean => {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/)?.[0];\n\n return Number(version) >= oldestSupportedCSPVersion;\n};\n","export const _isSupportedCadesVersion = (version: string): boolean => {\n const match = version.match(/(\\d+)\\.(\\d+)\\.(\\d+)/);\n\n if (!match) {\n return false;\n }\n\n const [, major, minor, patch] = match;\n\n if (Number(major) < 2) {\n return false;\n }\n\n if (Number(major) === 2 && Number(patch) < 12438) {\n return false;\n }\n\n return true;\n};\n","import { OIDS_DICTIONARY } from '../constants';\nimport { TagsTranslations } from '../constants/tags-translations';\n\nexport interface TagTranslation {\n description: string;\n title: string;\n isTranslated: boolean;\n}\n\n/**\n * Парсит информацию из строки с информацией о сертификате\n *\n * @param tagsTranslations - словарь с расшифровками тэгов\n * @param rawInfo - данные для парсинга\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const _parseCertInfo = (tagsTranslations: TagsTranslations[], rawInfo: string): TagTranslation[] => {\n const extractedEntities: string[] = rawInfo.match(/([а-яА-Яa-zA-Z0-9.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (extractedEntities) {\n return extractedEntities.map((group) => {\n const segmentsMatch = group.match(/^([а-яА-Яa-zA-Z0-9.]+)=(.+?),?$/);\n let title = segmentsMatch?.[1];\n // Вырезаем лишние кавычки\n const description = segmentsMatch?.[2]?.replace(/^\"(.*)\"/, '$1')?.replace(/\"{2}/g, '\"');\n const oidIdentifierMatch = title?.match(/^OID\\.(.*)/);\n const oidIdentifier = oidIdentifierMatch?.[1];\n let isTranslated = false;\n\n // Если нашли в тайтле ОИД, пытаемся его расшифровать\n if (oidIdentifier) {\n const oidTranslation = OIDS_DICTIONARY[oidIdentifier];\n\n if (oidTranslation) {\n title = oidTranslation;\n isTranslated = true;\n }\n }\n\n const tagTranslation = tagsTranslations.find((tag) => tag.possibleNames.find((name) => name === title))\n ?.translation;\n\n if (tagTranslation) {\n title = tagTranslation;\n isTranslated = true;\n }\n\n return { description, title, isTranslated };\n });\n }\n};\n",";(function () {\n //already loaded\n if(window.cadesplugin)\n return;\n\n var pluginObject;\n var plugin_resolved = 0;\n var plugin_reject;\n var plugin_resolve;\n var isOpera = 0;\n var isFireFox = 0;\n var isEdge = 0;\n var isSafari = 0;\n var failed_extensions = 0;\n\n var canPromise = !!window.Promise;\n var cadesplugin;\n\n if(canPromise)\n {\n cadesplugin = new Promise(function(resolve, reject)\n {\n plugin_resolve = resolve;\n plugin_reject = reject;\n });\n } else\n {\n cadesplugin = {};\n }\n\n function check_browser() {\n var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem= /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1] || '')};\n }\n if(M[1]=== 'Chrome'){\n tem= ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem!= null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]};\n }\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n return {name:M[0],version:M[1]};\n }\n var browserSpecs = check_browser();\n\n function cpcsp_console_log(level, msg){\n //IE9 не может писать в консоль если не открыта вкладка developer tools\n if(typeof(console) === 'undefined')\n return;\n if (level <= cadesplugin.current_log_level ){\n if (level === cadesplugin.LOG_LEVEL_DEBUG)\n console.log(\"DEBUG: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_INFO)\n console.info(\"INFO: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_ERROR)\n console.error(\"ERROR: %s\", msg);\n return;\n }\n }\n\n function set_log_level(level){\n if (!((level === cadesplugin.LOG_LEVEL_DEBUG) ||\n (level === cadesplugin.LOG_LEVEL_INFO) ||\n (level === cadesplugin.LOG_LEVEL_ERROR))){\n cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR, \"cadesplugin_api.js: Incorrect log_level: \" + level);\n return;\n }\n cadesplugin.current_log_level = level;\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = DEBUG\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = INFO\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = ERROR\");\n if(isNativeMessageSupported())\n {\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n window.postMessage(\"set_log_level=debug\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n window.postMessage(\"set_log_level=info\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n window.postMessage(\"set_log_level=error\", \"*\");\n }\n }\n\n function set_constantValues()\n {\n cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CAPICOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CADESCOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_CONTAINER_STORE = 100;\n\n cadesplugin.CAPICOM_MY_STORE = \"My\";\n\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\n\n cadesplugin.XmlDsigGost3410UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr3411\";\n cadesplugin.XmlDsigGost3410Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411\";\n\n cadesplugin.CADESCOM_CADES_DEFAULT = 0;\n cadesplugin.CADESCOM_CADES_BES = 1;\n cadesplugin.CADESCOM_CADES_T = 0x5;\n cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\n cadesplugin.CADESCOM_PKCS7_TYPE = 0xffff;\n\n cadesplugin.CADESCOM_ENCODE_BASE64 = 0;\n cadesplugin.CADESCOM_ENCODE_BINARY = 1;\n cadesplugin.CADESCOM_ENCODE_ANY = -1;\n\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\n\n cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\n cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\n\n cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\n\n cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE = 9;\n\n cadesplugin.CAPICOM_OID_OTHER = 0;\n cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\n\n cadesplugin.CAPICOM_EKU_CLIENT_AUTH = 2;\n cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON = 5;\n cadesplugin.CAPICOM_EKU_OTHER = 0;\n\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_ATTRIBUTE_OTHER = -1;\n\n cadesplugin.CADESCOM_STRING_TO_UCS2LE = 0;\n cadesplugin.CADESCOM_BASE64_TO_BINARY = 1;\n\n cadesplugin.CADESCOM_DISPLAY_DATA_NONE = 0;\n cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT = 1;\n cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\n\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\n\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1 = 0;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD2 = 1;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD4 = 2;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD5 = 3;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\n\n cadesplugin.LOG_LEVEL_DEBUG = 4;\n cadesplugin.LOG_LEVEL_INFO = 2;\n cadesplugin.LOG_LEVEL_ERROR = 1;\n\n cadesplugin.CADESCOM_AllowNone = 0;\n cadesplugin.CADESCOM_AllowNoOutstandingRequest = 0x1;\n cadesplugin.CADESCOM_AllowUntrustedCertificate = 0x2;\n cadesplugin.CADESCOM_AllowUntrustedRoot = 0x4;\n cadesplugin.CADESCOM_SkipInstallToStore = 0x10000000;\n }\n\n function async_spawn(generatorFunc) {\n function continuer(verb, arg) {\n var result;\n try {\n result = generator[verb](arg);\n } catch (err) {\n return Promise.reject(err);\n }\n if (result.done) {\n return result.value;\n } else {\n return Promise.resolve(result.value).then(onFulfilled, onRejected);\n }\n }\n var generator = generatorFunc(Array.prototype.slice.call(arguments, 1));\n var onFulfilled = continuer.bind(continuer, \"next\");\n var onRejected = continuer.bind(continuer, \"throw\");\n return onFulfilled();\n }\n\n function isIE() {\n // var retVal = ((\"Microsoft Internet Explorer\" == navigator.appName) || // IE < 11\n // navigator.userAgent.match(/Trident\\/./i)); // IE 11\n return (browserSpecs.name === 'IE' || browserSpecs.name === 'MSIE');\n }\n\n function isIOS() {\n return (navigator.userAgent.match(/ipod/i) ||\n navigator.userAgent.match(/ipad/i) ||\n navigator.userAgent.match(/iphone/i));\n }\n\n function isNativeMessageSupported()\n {\n // В IE работаем через NPAPI\n if(isIE())\n return false;\n // В Edge работаем через NativeMessage\n if(browserSpecs.name === 'Edge') {\n isEdge = true;\n return true;\n }\n // В Chrome, Firefox, Safari и Opera работаем через асинхронную версию в зависимости от версии\n if(browserSpecs.name === 'Opera') {\n isOpera = true;\n if(browserSpecs.version >= 33){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Firefox') {\n isFireFox = true;\n if(browserSpecs.version >= 52){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Chrome') {\n if(browserSpecs.version >= 42){\n return true;\n }\n else{\n return false;\n }\n }\n //В Сафари начиная с 12 версии нет NPAPI\n if(browserSpecs.name === 'Safari') {\n isSafari = true;\n if(browserSpecs.version >= 12) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n // Функция активации объектов КриптоПро ЭЦП Browser plug-in\n function CreateObject(name) {\n if (isIOS()) {\n // На iOS для создания объектов используется функция\n // call_ru_cryptopro_npcades_10_native_bridge, определенная в IOS_npcades_supp.js\n return call_ru_cryptopro_npcades_10_native_bridge(\"CreateObject\", [name]);\n }\n if (isIE()) {\n // В Internet Explorer создаются COM-объекты\n if (name.match(/X509Enrollment/i)) {\n try {\n // Объекты CertEnroll пробуем создавать через нашу фабрику,\n // если не получилось то через CX509EnrollmentWebClassFactory\n var objCertEnrollClassFactory = document.getElementById(\"webClassFactory\");\n return objCertEnrollClassFactory.CreateObject(name);\n }\n catch (e) {\n try {\n var objWebClassFactory = document.getElementById(\"certEnrollClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (err) {\n throw (\"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS\");\n }\n }\n }\n // Объекты CAPICOM и CAdESCOM создаются через CAdESCOM.WebClassFactory\n try {\n var objWebClassFactory = document.getElementById(\"webClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (e) {\n // Для версий плагина ниже 2.0.12538\n return new ActiveXObject(name);\n }\n }\n // создаются объекты NPAPI\n return pluginObject.CreateObject(name);\n }\n\n function decimalToHexString(number) {\n if (number < 0) {\n number = 0xFFFFFFFF + number + 1;\n }\n\n return number.toString(16).toUpperCase();\n }\n\n function GetMessageFromException(e) {\n var err = e.message;\n if (!err) {\n err = e;\n } else if (e.number) {\n err += \" (0x\" + decimalToHexString(e.number) + \")\";\n }\n return err;\n }\n\n function getLastError(exception) {\n if(isNativeMessageSupported() || isIE() || isIOS() ) {\n return GetMessageFromException(exception);\n }\n\n try {\n return pluginObject.getLastError();\n } catch(e) {\n return GetMessageFromException(exception);\n }\n }\n\n // Функция для удаления созданных объектов\n function ReleasePluginObjects() {\n return cpcsp_chrome_nmcades.ReleasePluginObjects();\n }\n\n // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in\n function CreateObjectAsync(name) {\n return pluginObject.CreateObjectAsync(name);\n }\n\n //Функции для IOS\n var ru_cryptopro_npcades_10_native_bridge = {\n callbacksCount : 1,\n callbacks : {},\n\n // Automatically called by native layer when a result is available\n resultForCallback : function resultForCallback(callbackId, resultArray) {\n var callback = ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId];\n if (!callback) return;\n callback.apply(null,resultArray);\n },\n\n // Use this in javascript to request native objective-c code\n // functionName : string (I think the name is explicit :p)\n // args : array of arguments\n // callback : function with n-arguments that is going to be called when the native code returned\n call : function call(functionName, args, callback) {\n var hasCallback = callback && typeof callback === \"function\";\n var callbackId = hasCallback ? ru_cryptopro_npcades_10_native_bridge.callbacksCount++ : 0;\n\n if (hasCallback)\n ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId] = callback;\n\n var iframe = document.createElement(\"IFRAME\");\n var arrObjs = new Array(\"_CPNP_handle\");\n try{\n iframe.setAttribute(\"src\", \"cpnp-js-call:\" + functionName + \":\" + callbackId+ \":\" + encodeURIComponent(JSON.stringify(args, arrObjs)));\n } catch(e){\n alert(e);\n }\n document.documentElement.appendChild(iframe);\n iframe.parentNode.removeChild(iframe);\n iframe = null;\n }\n };\n\n function call_ru_cryptopro_npcades_10_native_bridge(functionName, array){\n var tmpobj;\n var ex;\n ru_cryptopro_npcades_10_native_bridge.call(functionName, array, function(e, response){\n ex = e;\n var str='tmpobj='+response;\n eval(str);\n if (typeof (tmpobj) === \"string\"){\n tmpobj = tmpobj.replace(/\\\\\\n/gm, \"\\n\");\n tmpobj = tmpobj.replace(/\\\\\\r/gm, \"\\r\");\n }\n });\n if(ex)\n throw ex;\n return tmpobj;\n }\n\n function show_firefox_missing_extension_dialog()\n {\n if (!window.cadesplugin_skip_extension_install)\n {\n var ovr = document.createElement('div');\n ovr.id = \"cadesplugin_ovr\";\n ovr.style = \"visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)\";\n ovr.innerHTML = \"
\" +\n \"\" +\n \"

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

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

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

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

\" +\n \"
\";\n document.getElementsByTagName(\"Body\")[0].appendChild(ovr);\n var btn_install = document.getElementById(\"cadesplugin_install\");\n btn_install.addEventListener('click', function(event) {\n opr.addons.installExtension(\"epebfcehmdedogndhlcacafjaacknbcm\",\n function()\n {\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n location.reload();\n },\n function(){})\n });\n document.getElementById(\"cadesplugin_close_install\").addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n\n ovr.addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n ovr.style.visibility=\"visible\";\n document.getElementById(\"cadesplugin_ovr_item\").addEventListener('click',function(e){\n e.stopPropagation();\n });\n });\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n\n function firefox_or_edge_nmcades_onload() {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n\n function nmcades_api_onload () {\n window.postMessage(\"cadesplugin_echo_request\", \"*\");\n window.addEventListener(\"message\", function (event){\n if (typeof(event.data) !== \"string\" || !event.data.match(\"cadesplugin_loaded\"))\n return;\n if(isFireFox || isEdge || isSafari)\n {\n // Для Firefox, Сафари, Edge вместе с сообщением cadesplugin_loaded прилетает url для загрузки nmcades_plugin_api.js\n var url = event.data.substring(event.data.indexOf(\"url:\") + 4);\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", url);\n fileref.onerror = plugin_loaded_error;\n fileref.onload = firefox_or_edge_nmcades_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n // Для Firefox, Safari и Edge у нас только по одному расширению.\n failed_extensions++;\n }else {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n }, false);\n }\n\n //Загружаем расширения для Chrome, Opera, YaBrowser, FireFox, Edge, Safari\n function load_extension()\n {\n\n if(isFireFox || isEdge || isSafari){\n // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера.\n nmcades_api_onload();\n } else {\n // в асинхронном варианте для chrome и opera подключаем оба расширения\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n }\n }\n\n //Загружаем плагин для NPAPI\n function load_npapi_plugin()\n {\n var elem = document.createElement('object');\n elem.setAttribute(\"id\", \"cadesplugin_object\");\n elem.setAttribute(\"type\", \"application/x-cades\");\n elem.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem);\n pluginObject = document.getElementById(\"cadesplugin_object\");\n if(isIE())\n {\n var elem1 = document.createElement('object');\n elem1.setAttribute(\"id\", \"certEnrollClassFactory\");\n elem1.setAttribute(\"classid\", \"clsid:884e2049-217d-11da-b2a4-000e7bbb2b09\");\n elem1.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem1);\n var elem2 = document.createElement('object');\n elem2.setAttribute(\"id\", \"webClassFactory\");\n elem2.setAttribute(\"classid\", \"clsid:B04C8637-10BD-484E-B0DA-B8A039F60024\");\n elem2.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem2);\n }\n }\n\n //Отправляем событие что все ок.\n function plugin_loaded()\n {\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_resolve();\n }else {\n window.postMessage(\"cadesplugin_loaded\", \"*\");\n }\n }\n\n //Отправляем событие что сломались.\n function plugin_loaded_error(msg)\n {\n if(isNativeMessageSupported())\n {\n //в асинхронном варианте подключаем оба расширения, если сломались оба пробуем установить для Opera\n failed_extensions++;\n if(failed_extensions<2)\n return;\n if(isOpera && (typeof(msg) === 'undefined'|| typeof(msg) === 'object'))\n {\n install_opera_extension();\n return;\n }\n }\n if(typeof(msg) === 'undefined' || typeof(msg) === 'object')\n msg = \"Плагин недоступен\";\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(msg);\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n }\n\n //проверяем что у нас хоть какое то событие ушло, и если не уходило кидаем еще раз ошибку\n function check_load_timeout()\n {\n if(plugin_resolved === 1)\n return;\n if(isFireFox)\n {\n show_firefox_missing_extension_dialog();\n }\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(\"Истекло время ожидания загрузки плагина\");\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n\n }\n\n //Вспомогательная функция для NPAPI\n function createPromise(arg)\n {\n return new Promise(arg);\n }\n\n function check_npapi_plugin (){\n try {\n var oAbout = CreateObject(\"CAdESCOM.About\");\n plugin_loaded();\n }\n catch (err) {\n document.getElementById(\"cadesplugin_object\").style.display = 'none';\n // Объект создать не удалось, проверим, установлен ли\n // вообще плагин. Такая возможность есть не во всех браузерах\n var mimetype = navigator.mimeTypes[\"application/x-cades\"];\n if (mimetype) {\n var plugin = mimetype.enabledPlugin;\n if (plugin) {\n plugin_loaded_error(\"Плагин загружен, но не создаются обьекты\");\n }else\n {\n plugin_loaded_error(\"Ошибка при загрузке плагина\");\n }\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n }\n\n //Проверяем работает ли плагин\n function check_plugin_working()\n {\n var div = document.createElement(\"div\");\n div.innerHTML = \"\";\n var isIeLessThan9 = (div.getElementsByTagName(\"i\").length === 1);\n if (isIeLessThan9) {\n plugin_loaded_error(\"Internet Explorer версии 8 и ниже не поддерживается\");\n return;\n }\n\n if(isNativeMessageSupported())\n {\n load_extension();\n }else if(!canPromise) {\n window.addEventListener(\"message\", function (event){\n if (event.data !== \"cadesplugin_echo_request\")\n return;\n load_npapi_plugin();\n check_npapi_plugin();\n },\n false);\n }else\n {\n if(document.readyState === \"complete\"){\n load_npapi_plugin();\n check_npapi_plugin();\n } else {\n window.addEventListener(\"load\", function (event) {\n load_npapi_plugin();\n check_npapi_plugin();\n }, false);\n }\n }\n }\n\n function set_pluginObject(obj)\n {\n pluginObject = obj;\n }\n\n function is_capilite_enabled()\n {\n if ((typeof (cadesplugin.EnableInternalCSP) !== 'undefined') && cadesplugin.EnableInternalCSP)\n return true;\n return false;\n };\n\n //Export\n cadesplugin.JSModuleVersion = \"2.1.2\";\n cadesplugin.async_spawn = async_spawn;\n cadesplugin.set = set_pluginObject;\n cadesplugin.set_log_level = set_log_level;\n cadesplugin.getLastError = getLastError;\n cadesplugin.is_capilite_enabled = is_capilite_enabled;\n\n if(isNativeMessageSupported())\n {\n cadesplugin.CreateObjectAsync = CreateObjectAsync;\n cadesplugin.ReleasePluginObjects = ReleasePluginObjects;\n }\n\n if(!isNativeMessageSupported())\n {\n cadesplugin.CreateObject = CreateObject;\n }\n\n if(window.cadesplugin_load_timeout)\n {\n setTimeout(check_load_timeout, window.cadesplugin_load_timeout);\n }\n else\n {\n setTimeout(check_load_timeout, 20000);\n }\n\n set_constantValues();\n\n cadesplugin.current_log_level = cadesplugin.LOG_LEVEL_ERROR;\n window.cadesplugin = cadesplugin;\n check_plugin_working();\n}());\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/crypto-pro.min.js b/dist/crypto-pro.min.js new file mode 100644 index 0000000..dc12ee4 --- /dev/null +++ b/dist/crypto-pro.min.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("cryptoPro",[],n):"object"==typeof exports?exports.cryptoPro=n():e.cryptoPro=n()}(window,(function(){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var _=n[r]={i:r,l:!1,exports:{}};return e[r].call(_.exports,_,_.exports,t),_.l=!0,_.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var _ in e)t.d(r,_,function(n){return e[n]}.bind(null,_));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=8)}([function(e,n,t){"use strict";var r=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(_,a){function s(e){try{o(r.next(e))}catch(e){a(e)}}function i(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){var n;e.done?_(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,i)}o((r=r.apply(e,n||[])).next())}))},_=this&&this.__generator||function(e,n){var t,r,_,a,s={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(_=2&a[0]?r.return:a[0]?r.throw||((_=r.return)&&_.call(r),0):r.next)&&!(_=_.call(r,a[1])).done)return _;switch(r=0,_&&(a=[2&a[0],_.value]),a[0]){case 0:case 1:_=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(_=s.trys,(_=_.length>0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(n,"__esModule",{value:!0});var a=t(1),s=!1,i=!1;n._afterPluginsLoaded=function(e){var n=Boolean(window.Promise);return function(){for(var o=[],c=0;c0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(n,"__esModule",{value:!0});var a=t(0),s=t(4);n.getCertificate=a._afterPluginsLoaded((function(e){return r(void 0,void 0,void 0,(function(){var n,t;return _(this,(function(r){switch(r.label){case 0:if(!e)throw new Error("Отпечаток не указан");return[4,s.getUserCertificates()];case 1:if(n=r.sent(),!(t=n.find((function(n){return n.thumbprint===e}))))throw new Error('Сертификат с отпечатком: "'+e+'" не найден');return[2,t]}}))}))}))},function(module,exports){!function(){if(!window.cadesplugin){var pluginObject,plugin_resolved=0,plugin_reject,plugin_resolve,isOpera=0,isFireFox=0,isEdge=0,isSafari=0,failed_extensions=0,canPromise=!!window.Promise,cadesplugin;cadesplugin=canPromise?new Promise((function(e,n){plugin_resolve=e,plugin_reject=n})):{};var browserSpecs=check_browser(),ru_cryptopro_npcades_10_native_bridge={callbacksCount:1,callbacks:{},resultForCallback:function(e,n){var t=ru_cryptopro_npcades_10_native_bridge.callbacks[e];t&&t.apply(null,n)},call:function(e,n,t){var r=t&&"function"==typeof t,_=r?ru_cryptopro_npcades_10_native_bridge.callbacksCount++:0;r&&(ru_cryptopro_npcades_10_native_bridge.callbacks[_]=t);var a=document.createElement("IFRAME"),s=new Array("_CPNP_handle");try{a.setAttribute("src","cpnp-js-call:"+e+":"+_+":"+encodeURIComponent(JSON.stringify(n,s)))}catch(e){alert(e)}document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null}};cadesplugin.JSModuleVersion="2.1.2",cadesplugin.async_spawn=async_spawn,cadesplugin.set=set_pluginObject,cadesplugin.set_log_level=set_log_level,cadesplugin.getLastError=getLastError,cadesplugin.is_capilite_enabled=is_capilite_enabled,isNativeMessageSupported()&&(cadesplugin.CreateObjectAsync=CreateObjectAsync,cadesplugin.ReleasePluginObjects=ReleasePluginObjects),isNativeMessageSupported()||(cadesplugin.CreateObject=CreateObject),window.cadesplugin_load_timeout?setTimeout(check_load_timeout,window.cadesplugin_load_timeout):setTimeout(check_load_timeout,2e4),set_constantValues(),cadesplugin.current_log_level=cadesplugin.LOG_LEVEL_ERROR,window.cadesplugin=cadesplugin,check_plugin_working()}function check_browser(){var e,n=navigator.userAgent,t=n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(t[1])?{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(n)||[])[1]||""}:"Chrome"===t[1]&&null!=(e=n.match(/\b(OPR|Edge)\/(\d+)/))?{name:e[1].replace("OPR","Opera"),version:e[2]}:(t=t[2]?[t[1],t[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=n.match(/version\/(\d+)/i))&&t.splice(1,1,e[1]),{name:t[0],version:t[1]})}function cpcsp_console_log(e,n){if("undefined"!=typeof console)return e<=cadesplugin.current_log_level?(e===cadesplugin.LOG_LEVEL_DEBUG&&console.log("DEBUG: %s",n),e===cadesplugin.LOG_LEVEL_INFO&&console.info("INFO: %s",n),void(e===cadesplugin.LOG_LEVEL_ERROR&&console.error("ERROR: %s",n))):void 0}function set_log_level(e){e===cadesplugin.LOG_LEVEL_DEBUG||e===cadesplugin.LOG_LEVEL_INFO||e===cadesplugin.LOG_LEVEL_ERROR?(cadesplugin.current_log_level=e,cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_DEBUG&&cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO,"cadesplugin_api.js: log_level = DEBUG"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_INFO&&cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO,"cadesplugin_api.js: log_level = INFO"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_ERROR&&cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO,"cadesplugin_api.js: log_level = ERROR"),isNativeMessageSupported()&&(cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_DEBUG&&window.postMessage("set_log_level=debug","*"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_INFO&&window.postMessage("set_log_level=info","*"),cadesplugin.current_log_level===cadesplugin.LOG_LEVEL_ERROR&&window.postMessage("set_log_level=error","*"))):cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR,"cadesplugin_api.js: Incorrect log_level: "+e)}function set_constantValues(){cadesplugin.CAPICOM_LOCAL_MACHINE_STORE=1,cadesplugin.CAPICOM_CURRENT_USER_STORE=2,cadesplugin.CADESCOM_LOCAL_MACHINE_STORE=1,cadesplugin.CADESCOM_CURRENT_USER_STORE=2,cadesplugin.CADESCOM_CONTAINER_STORE=100,cadesplugin.CAPICOM_MY_STORE="My",cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED=2,cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME=1,cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED=0,cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING=1,cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE=2,cadesplugin.XmlDsigGost3410UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411",cadesplugin.XmlDsigGost3411UrlObsolete="http://www.w3.org/2001/04/xmldsig-more#gostr3411",cadesplugin.XmlDsigGost3410Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411",cadesplugin.XmlDsigGost3411Url="urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411",cadesplugin.CADESCOM_CADES_DEFAULT=0,cadesplugin.CADESCOM_CADES_BES=1,cadesplugin.CADESCOM_CADES_T=5,cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1=93,cadesplugin.CADESCOM_PKCS7_TYPE=65535,cadesplugin.CADESCOM_ENCODE_BASE64=0,cadesplugin.CADESCOM_ENCODE_BINARY=1,cadesplugin.CADESCOM_ENCODE_ANY=-1,cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT=0,cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN=1,cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY=2,cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME=0,cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME=1,cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH=0,cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME=1,cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME=2,cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME=3,cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME=4,cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION=5,cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY=6,cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY=7,cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY=8,cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID=9,cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID=10,cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED=11,cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE=12,cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE=128,cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE=9,cadesplugin.CAPICOM_OID_OTHER=0,cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION=10,cadesplugin.CAPICOM_EKU_CLIENT_AUTH=2,cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON=5,cadesplugin.CAPICOM_EKU_OTHER=0,cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME=0,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME=1,cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION=2,cadesplugin.CADESCOM_ATTRIBUTE_OTHER=-1,cadesplugin.CADESCOM_STRING_TO_UCS2LE=0,cadesplugin.CADESCOM_BASE64_TO_BINARY=1,cadesplugin.CADESCOM_DISPLAY_DATA_NONE=0,cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT=1,cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE=2,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2=0,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4=1,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES=2,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES=3,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES=4,cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89=25,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1=0,cadesplugin.CADESCOM_HASH_ALGORITHM_MD2=1,cadesplugin.CADESCOM_HASH_ALGORITHM_MD4=2,cadesplugin.CADESCOM_HASH_ALGORITHM_MD5=3,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256=4,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384=5,cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512=6,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411=100,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256=101,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512=102,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC=110,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC=111,cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC=112,cadesplugin.LOG_LEVEL_DEBUG=4,cadesplugin.LOG_LEVEL_INFO=2,cadesplugin.LOG_LEVEL_ERROR=1,cadesplugin.CADESCOM_AllowNone=0,cadesplugin.CADESCOM_AllowNoOutstandingRequest=1,cadesplugin.CADESCOM_AllowUntrustedCertificate=2,cadesplugin.CADESCOM_AllowUntrustedRoot=4,cadesplugin.CADESCOM_SkipInstallToStore=268435456}function async_spawn(e){function n(e,n){var a;try{a=t[e](n)}catch(e){return Promise.reject(e)}return a.done?a.value:Promise.resolve(a.value).then(r,_)}var t=e(Array.prototype.slice.call(arguments,1)),r=n.bind(n,"next"),_=n.bind(n,"throw");return r()}function isIE(){return"IE"===browserSpecs.name||"MSIE"===browserSpecs.name}function isIOS(){return navigator.userAgent.match(/ipod/i)||navigator.userAgent.match(/ipad/i)||navigator.userAgent.match(/iphone/i)}function isNativeMessageSupported(){return!isIE()&&("Edge"===browserSpecs.name?(isEdge=!0,!0):"Opera"===browserSpecs.name?(isOpera=!0,browserSpecs.version>=33):"Firefox"===browserSpecs.name?(isFireFox=!0,browserSpecs.version>=52):"Chrome"===browserSpecs.name?browserSpecs.version>=42:"Safari"===browserSpecs.name?(isSafari=!0,browserSpecs.version>=12):void 0)}function CreateObject(e){if(isIOS())return call_ru_cryptopro_npcades_10_native_bridge("CreateObject",[e]);if(isIE()){if(e.match(/X509Enrollment/i))try{return document.getElementById("webClassFactory").CreateObject(e)}catch(n){try{return document.getElementById("certEnrollClassFactory").CreateObject(e)}catch(e){throw"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS"}}try{return document.getElementById("webClassFactory").CreateObject(e)}catch(n){return new ActiveXObject(e)}}return pluginObject.CreateObject(e)}function decimalToHexString(e){return e<0&&(e=4294967295+e+1),e.toString(16).toUpperCase()}function GetMessageFromException(e){var n=e.message;return n?e.number&&(n+=" (0x"+decimalToHexString(e.number)+")"):n=e,n}function getLastError(e){if(isNativeMessageSupported()||isIE()||isIOS())return GetMessageFromException(e);try{return pluginObject.getLastError()}catch(n){return GetMessageFromException(e)}}function ReleasePluginObjects(){return cpcsp_chrome_nmcades.ReleasePluginObjects()}function CreateObjectAsync(e){return pluginObject.CreateObjectAsync(e)}function call_ru_cryptopro_npcades_10_native_bridge(functionName,array){var tmpobj,ex;if(ru_cryptopro_npcades_10_native_bridge.call(functionName,array,(function(e,response){ex=e;var str="tmpobj="+response;eval(str),"string"==typeof tmpobj&&(tmpobj=tmpobj.replace(/\\\n/gm,"\n"),tmpobj=tmpobj.replace(/\\\r/gm,"\r"))})),ex)throw ex;return tmpobj}function show_firefox_missing_extension_dialog(){if(!window.cadesplugin_skip_extension_install){var e=document.createElement("div");e.id="cadesplugin_ovr",e.style="visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)",e.innerHTML="

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

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

",document.getElementsByTagName("Body")[0].appendChild(e),document.getElementById("cadesplugin_close_install").addEventListener("click",(function(){plugin_loaded_error("Плагин недоступен"),document.getElementById("cadesplugin_ovr").style.visibility="hidden"})),e.addEventListener("click",(function(){plugin_loaded_error("Плагин недоступен"),document.getElementById("cadesplugin_ovr").style.visibility="hidden"})),e.style.visibility="visible"}}function install_opera_extension(){window.cadesplugin_skip_extension_install?plugin_loaded_error("Плагин недоступен"):document.addEventListener("DOMContentLoaded",(function(){var e=document.createElement("div");e.id="cadesplugin_ovr",e.style="visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)",e.innerHTML="

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

",document.getElementsByTagName("Body")[0].appendChild(e),document.getElementById("cadesplugin_install").addEventListener("click",(function(e){opr.addons.installExtension("epebfcehmdedogndhlcacafjaacknbcm",(function(){document.getElementById("cadesplugin_ovr").style.visibility="hidden",location.reload()}),(function(){}))})),document.getElementById("cadesplugin_close_install").addEventListener("click",(function(){plugin_loaded_error("Плагин недоступен"),document.getElementById("cadesplugin_ovr").style.visibility="hidden"})),e.addEventListener("click",(function(){plugin_loaded_error("Плагин недоступен"),document.getElementById("cadesplugin_ovr").style.visibility="hidden"})),e.style.visibility="visible",document.getElementById("cadesplugin_ovr_item").addEventListener("click",(function(e){e.stopPropagation()}))}))}function firefox_or_edge_nmcades_onload(){cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded,plugin_loaded_error)}function nmcades_api_onload(){window.postMessage("cadesplugin_echo_request","*"),window.addEventListener("message",(function(e){if("string"==typeof e.data&&e.data.match("cadesplugin_loaded"))if(isFireFox||isEdge||isSafari){var n=e.data.substring(e.data.indexOf("url:")+4),t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",n),t.onerror=plugin_loaded_error,t.onload=firefox_or_edge_nmcades_onload,document.getElementsByTagName("head")[0].appendChild(t),failed_extensions++}else cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded,plugin_loaded_error)}),!1)}function load_extension(){if(isFireFox||isEdge||isSafari)nmcades_api_onload();else{var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src","chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js"),e.onerror=plugin_loaded_error,e.onload=nmcades_api_onload,document.getElementsByTagName("head")[0].appendChild(e),(e=document.createElement("script")).setAttribute("type","text/javascript"),e.setAttribute("src","chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js"),e.onerror=plugin_loaded_error,e.onload=nmcades_api_onload,document.getElementsByTagName("head")[0].appendChild(e)}}function load_npapi_plugin(){var e=document.createElement("object");if(e.setAttribute("id","cadesplugin_object"),e.setAttribute("type","application/x-cades"),e.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(e),pluginObject=document.getElementById("cadesplugin_object"),isIE()){var n=document.createElement("object");n.setAttribute("id","certEnrollClassFactory"),n.setAttribute("classid","clsid:884e2049-217d-11da-b2a4-000e7bbb2b09"),n.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(n);var t=document.createElement("object");t.setAttribute("id","webClassFactory"),t.setAttribute("classid","clsid:B04C8637-10BD-484E-B0DA-B8A039F60024"),t.setAttribute("style","visibility: hidden"),document.getElementsByTagName("body")[0].appendChild(t)}}function plugin_loaded(){plugin_resolved=1,canPromise?plugin_resolve():window.postMessage("cadesplugin_loaded","*")}function plugin_loaded_error(e){if(isNativeMessageSupported()){if(++failed_extensions<2)return;if(isOpera&&(void 0===e||"object"==typeof e))return void install_opera_extension()}void 0!==e&&"object"!=typeof e||(e="Плагин недоступен"),plugin_resolved=1,canPromise?plugin_reject(e):window.postMessage("cadesplugin_load_error","*")}function check_load_timeout(){1!==plugin_resolved&&(isFireFox&&show_firefox_missing_extension_dialog(),plugin_resolved=1,canPromise?plugin_reject("Истекло время ожидания загрузки плагина"):window.postMessage("cadesplugin_load_error","*"))}function createPromise(e){return new Promise(e)}function check_npapi_plugin(){try{CreateObject("CAdESCOM.About");plugin_loaded()}catch(n){document.getElementById("cadesplugin_object").style.display="none";var e=navigator.mimeTypes["application/x-cades"];if(e)plugin_loaded_error(e.enabledPlugin?"Плагин загружен, но не создаются обьекты":"Ошибка при загрузке плагина");else plugin_loaded_error("Плагин недоступен")}}function check_plugin_working(){var e=document.createElement("div");e.innerHTML="\x3c!--[if lt IE 9]>0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(n,"__esModule",{value:!0});var s=t(3),i=t(0);n.getDecodedExtendedKeyUsage=i._afterPluginsLoaded((function(){return _(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.getExtendedKeyUsage()];case 1:return[2,e.sent().reduce((function(e,n){var t;return r(r({},e),((t={})[n]=s.OIDS_DICTIONARY[n]||null,t))}),{})]}}))}))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.getExtendedKeyUsage=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e,n=[];try{if(e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.ExtendedKeyUsage(),e=_generateCadesFn_1.__cadesAsyncToken__+e.EKUs,(e=_generateCadesFn_1.__cadesAsyncToken__+e.Count)>0)for(;e>0;){var t=void 0;t=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.ExtendedKeyUsage(),t=_generateCadesFn_1.__cadesAsyncToken__+t.EKUs,t=_generateCadesFn_1.__cadesAsyncToken__+t.Item(e),t=_generateCadesFn_1.__cadesAsyncToken__+t.OID,n.push(t),e--}}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении ОИД'ов")}return n})))}))},function(e,n,t){"use strict";var r=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(_,a){function s(e){try{o(r.next(e))}catch(e){a(e)}}function i(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){var n;e.done?_(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,i)}o((r=r.apply(e,n||[])).next())}))},_=this&&this.__generator||function(e,n){var t,r,_,a,s={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(_=2&a[0]?r.return:a[0]?r.throw||((_=r.return)&&_.call(r),0):r.next)&&!(_=_.call(r,a[1])).done)return _;switch(r=0,_&&(a=[2&a[0],_.value]),a[0]){case 0:case 1:_=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(_=s.trys,(_=_.length>0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(n,"__esModule",{value:!0});var a=t(0),s=t(1),i=t(22),o=t(6);n.getInfo=a._afterPluginsLoaded((function(e,n){return r(this,void 0,void 0,(function(){var t,r;return _(this,(function(_){switch(_.label){case 0:return _.trys.push([0,2,,3]),[4,o.getCadesProp.call(this,n)];case 1:return t=_.sent(),[3,3];case 2:throw r=_.sent(),console.error(r),new Error(s._extractMeaningfulErrorMessage(r)||"Ошибка при извлечении информации из сертификата");case 3:return[2,i._parseCertInfo(e,t)]}}))}))}))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t(3);n._parseCertInfo=function(e,n){var t=n.match(/([а-яА-Яa-zA-Z0-9.]+)=(?:("[^"]+?")|(.+?))(?:,|$)/g);if(t)return t.map((function(n){var t,_,a,s=n.match(/^([а-яА-Яa-zA-Z0-9.]+)=(.+?),?$/),i=null==s?void 0:s[1],o=null===(_=null===(t=null==s?void 0:s[2])||void 0===t?void 0:t.replace(/^"(.*)"/,"$1"))||void 0===_?void 0:_.replace(/"{2}/g,'"'),c=null==i?void 0:i.match(/^OID\.(.*)/),l=null==c?void 0:c[1],u=!1;if(l){var d=r.OIDS_DICTIONARY[l];d&&(i=d,u=!0)}var C=null===(a=e.find((function(e){return e.possibleNames.find((function(e){return e===i}))})))||void 0===a?void 0:a.translation;return C&&(i=C,u=!0),{description:o,title:i,isTranslated:u}}))}},function(e,n,t){"use strict";var r=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(_,a){function s(e){try{o(r.next(e))}catch(e){a(e)}}function i(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){var n;e.done?_(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,i)}o((r=r.apply(e,n||[])).next())}))},_=this&&this.__generator||function(e,n){var t,r,_,a,s={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(_=2&a[0]?r.return:a[0]?r.throw||((_=r.return)&&_.call(r),0):r.next)&&!(_=_.call(r,a[1])).done)return _;switch(r=0,_&&(a=[2&a[0],_.value]),a[0]){case 0:case 1:_=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(_=s.trys,(_=_.length>0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(n,"__esModule",{value:!0});var a=t(0);n.hasExtendedKeyUsage=a._afterPluginsLoaded((function(e){return r(this,void 0,void 0,(function(){var n;return _(this,(function(t){switch(t.label){case 0:return[4,this.getExtendedKeyUsage()];case 1:return n=t.sent(),[2,Array.isArray(e)?e.every((function(e){return n.some((function(n){return n===e}))})):n.some((function(n){return n===e}))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports.isValid=_afterPluginsLoaded_1._afterPluginsLoaded((function(){var cadesCertificate=this._cadesCertificate;return eval(_generateCadesFn_1._generateCadesFn((function(){var e;try{e=_generateCadesFn_1.__cadesAsyncToken__+cadesCertificate.IsValid(),e=_generateCadesFn_1.__cadesAsyncToken__+e.Result}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при проверке сертификата")}return Boolean(e)})))}))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n._extractCommonName=function(e){var n;return null===(n=e.match(/CN=(.+?)(?:,|$)/))||void 0===n?void 0:n[1]}},function(e,n,t){"use strict";var r=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(_,a){function s(e){try{o(r.next(e))}catch(e){a(e)}}function i(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){var n;e.done?_(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,i)}o((r=r.apply(e,n||[])).next())}))},_=this&&this.__generator||function(e,n){var t,r,_,a,s={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(_=2&a[0]?r.return:a[0]?r.throw||((_=r.return)&&_.call(r),0):r.next)&&!(_=_.call(r,a[1])).done)return _;switch(r=0,_&&(a=[2&a[0],_.value]),a[0]){case 0:case 1:_=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(_=s.trys,(_=_.length>0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(n,"__esModule",{value:!0});var a=t(0),s=t(1),i=t(27),o=t(28),c=t(7);n.isValidSystemSetup=a._afterPluginsLoaded((function(){return r(void 0,void 0,void 0,(function(){var e,n;return _(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,c.getSystemInfo()];case 1:return e=t.sent(),[3,3];case 2:throw n=t.sent(),console.error(n),new Error(s._extractMeaningfulErrorMessage(n)||"Настройки ЭП на данной машине не верны");case 3:if(!i._isSupportedCadesVersion(e.cadesVersion))throw new Error("Не поддерживаемая версия плагина");if(!o._isSupportedCSPVersion(e.cspVersion))throw new Error("Не поддерживаемая версия CSP");return[2,!0]}}))}))}))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n._isSupportedCadesVersion=function(e){var n=e.match(/(\d+)\.(\d+)\.(\d+)/);if(!n)return!1;var t=n[1],r=(n[2],n[3]);return!(Number(t)<2)&&!(2===Number(t)&&Number(r)<12438)}},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n._isSupportedCSPVersion=function(e){var n;return e=null===(n=e.match(/\d+?\b(?:\.\d+)?/))||void 0===n?void 0:n[0],Number(e)>=4}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(e,n,t,r){return new(t||(t=Promise))((function(_,a){function s(e){try{o(r.next(e))}catch(e){a(e)}}function i(e){try{o(r.throw(e))}catch(e){a(e)}}function o(e){var n;e.done?_(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,i)}o((r=r.apply(e,n||[])).next())}))},__generator=this&&this.__generator||function(e,n){var t,r,_,a,s={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(_=2&a[0]?r.return:a[0]?r.throw||((_=r.return)&&_.call(r),0):r.next)&&!(_=_.call(r,a[1])).done)return _;switch(r=0,_&&(a=[2&a[0],_.value]),a[0]){case 0:case 1:_=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(_=s.trys,(_=_.length>0&&_[_.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!_||a[1]>_[0]&&a[1]<_[3])){s.label=a[1];break}if(6===a[0]&&s.label<_[1]){s.label=_[1],_=a;break}if(_&&s.label<_[2]){s.label=_[2],s.ops.push(a);break}_[2]&&s.ops.pop(),s.trys.pop();continue}a=n.call(e,s)}catch(e){a=[6,e],r=0}finally{t=_=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(3),_afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2),_getCadesCert_1=__webpack_require__(30),_getDateObj_1=__webpack_require__(31);exports.createSignature=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint,dataBase64,detachedSignature){return void 0===detachedSignature&&(detachedSignature=!0),__awaiter(void 0,void 0,void 0,(function(){var cadesplugin,cadesCertificate;return __generator(this,(function(_a){switch(_a.label){case 0:return cadesplugin=window.cadesplugin,[4,_getCadesCert_1._getCadesCert(thumbprint)];case 1:return cadesCertificate=_a.sent(),[2,eval(_generateCadesFn_1._generateCadesFn((function(){var e,n,t;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CADESCOM.CPAttribute"),n=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CadesSignedData"),t=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.CPSigner")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при инициализации подписи")}var r,_,a=_getDateObj_1._getDateObj(new Date);try{_generateCadesFn_1.__cadesAsyncToken__,e.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME),_generateCadesFn_1.__cadesAsyncToken__,e.propset_Value(a)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при установке времени подписи")}try{_generateCadesFn_1.__cadesAsyncToken__,t.propset_Certificate(cadesCertificate),r=_generateCadesFn_1.__cadesAsyncToken__+t.AuthenticatedAttributes2,_generateCadesFn_1.__cadesAsyncToken__,r.Add(e),_generateCadesFn_1.__cadesAsyncToken__,n.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY),_generateCadesFn_1.__cadesAsyncToken__,n.propset_Content(dataBase64),_generateCadesFn_1.__cadesAsyncToken__,t.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при указании данных для подписи")}try{_=_generateCadesFn_1.__cadesAsyncToken__+n.SignCades(t,cadesplugin.CADESCOM_CADES_BES,detachedSignature)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при подписании данных")}return _})))]}}))}))}))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _afterPluginsLoaded_1=__webpack_require__(0),_extractMeaningfulErrorMessage_1=__webpack_require__(1),_generateCadesFn_1=__webpack_require__(2);exports._getCadesCert=_afterPluginsLoaded_1._afterPluginsLoaded((function(thumbprint){var cadesplugin=window.cadesplugin;return eval(_generateCadesFn_1._generateCadesFn((function(){var e,n,t,r;try{e=_generateCadesFn_1.__cadesAsyncToken__+_generateCadesFn_1.__createCadesPluginObject__("CAdESCOM.Store")}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при попытке доступа к хранилищу")}if(!e)throw new Error("Не удалось получить доступ к хранилищу сертификатов");try{_generateCadesFn_1.__cadesAsyncToken__,e.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE,cadesplugin.CAPICOM_MY_STORE,cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при открытии хранилища")}try{n=_generateCadesFn_1.__cadesAsyncToken__+e.Certificates,t=_generateCadesFn_1.__cadesAsyncToken__+n.Count}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка получения списка сертификатов")}if(!t)throw new Error("Нет доступных сертификатов");try{if(n=_generateCadesFn_1.__cadesAsyncToken__+n.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH,thumbprint),!(_generateCadesFn_1.__cadesAsyncToken__+n.Count))throw new Error('Сертификат с отпечатком: "'+thumbprint+'" не найден');r=_generateCadesFn_1.__cadesAsyncToken__+n.Item(1)}catch(e){throw console.error(e),new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(e)||"Ошибка при получении сертификата")}return e.Close(),r})))}))},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n._getDateObj=function(e){return e.getVarDate?e.getVarDate():e}}])})); +//# sourceMappingURL=crypto-pro.min.js.map \ No newline at end of file diff --git a/dist/crypto-pro.min.js.map b/dist/crypto-pro.min.js.map new file mode 100644 index 0000000..bea1e46 --- /dev/null +++ b/dist/crypto-pro.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://cryptoPro/webpack/universalModuleDefinition","webpack://cryptoPro/webpack/bootstrap","webpack://cryptoPro/./helpers/_afterPluginsLoaded.ts","webpack://cryptoPro/./helpers/_extractMeaningfulErrorMessage.ts","webpack://cryptoPro/./helpers/_generateCadesFn.ts","webpack://cryptoPro/./constants/index.ts","webpack://cryptoPro/./api/getUserCertificates.ts","webpack://cryptoPro/./api/certificate/index.ts","webpack://cryptoPro/./api/certificate/getCadesProp.ts","webpack://cryptoPro/./api/getSystemInfo.ts","webpack://cryptoPro/./crypto-pro.ts","webpack://cryptoPro/./api/index.ts","webpack://cryptoPro/./api/getCertificate.ts","webpack://cryptoPro/./vendor/cadesplugin_api.js","webpack://cryptoPro/./api/certificate/certificate.ts","webpack://cryptoPro/./constants/cades-constants.ts","webpack://cryptoPro/./constants/issuer-tags-translations.ts","webpack://cryptoPro/./constants/oids-dictionary.ts","webpack://cryptoPro/./constants/subject-tags-translations.ts","webpack://cryptoPro/./api/certificate/exportBase64.ts","webpack://cryptoPro/./api/certificate/getAlgorithm.ts","webpack://cryptoPro/./api/certificate/getDecodedExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getInfo.ts","webpack://cryptoPro/./helpers/_parseCertInfo.ts","webpack://cryptoPro/./api/certificate/hasExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/isValid.ts","webpack://cryptoPro/./helpers/_extractCommonName.ts","webpack://cryptoPro/./api/isValidSystemSetup.ts","webpack://cryptoPro/./helpers/_isSupportedCadesVersion.ts","webpack://cryptoPro/./helpers/_isSupportedCSPVersion.ts","webpack://cryptoPro/./api/createSignature.ts","webpack://cryptoPro/./helpers/_getCadesCert.ts","webpack://cryptoPro/./helpers/_getDateObj.ts"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","isSetLogLevel","isPluginLoaded","_afterPluginsLoaded","fn","canPromise","Boolean","Promise","error","console","Error","_extractMeaningfulErrorMessage","cadesplugin","set_log_level","LOG_LEVEL_ERROR","apply","this","args","errorContainer","getLastError","message","test","searchResult","match","__cadesAsyncToken__","__createCadesPluginObject__","_generateCadesFn","callback","cadesGeneratorsAPI","CreateObjectAsync","callbackName","callbackLiteral","String","callbackArguments","callbackBody","replace","crossEnvCallbackLiteral","Function","join","certificatesCache","getUserCertificates","resetCache","eval","cadesStore","cadesCertificates","cadesCertificatesCount","Open","CAPICOM_CURRENT_USER_STORE","CAPICOM_MY_STORE","CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED","Certificates","Find","CAPICOM_CERTIFICATE_FIND_TIME_VALID","CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY","CAPICOM_PROPID_KEY_PROV_INFO","Count","certificateList","cadesCertificate","Item","push","Certificate","_extractCommonName","SubjectName","IssuerName","Thumbprint","ValidFromDate","ValidToDate","Close","getCadesProp","propName","_cadesCertificate","propertyValue","getSystemInfo","sysInfo","cadesVersion","cspVersion","cadesAbout","PluginVersion","CSPVersion","Version","toString","getCertificate","thumbprint","availableCertificates","foundCertificate","find","cert","pluginObject","plugin_resolved","plugin_reject","plugin_resolve","isOpera","isFireFox","isEdge","isSafari","failed_extensions","resolve","reject","browserSpecs","check_browser","ru_cryptopro_npcades_10_native_bridge","callbacksCount","callbacks","resultForCallback","callbackId","resultArray","functionName","hasCallback","iframe","document","createElement","arrObjs","Array","setAttribute","encodeURIComponent","JSON","stringify","e","alert","documentElement","appendChild","parentNode","removeChild","JSModuleVersion","async_spawn","set","set_pluginObject","is_capilite_enabled","isNativeMessageSupported","ReleasePluginObjects","CreateObject","cadesplugin_load_timeout","setTimeout","check_load_timeout","set_constantValues","current_log_level","check_plugin_working","tem","ua","navigator","userAgent","M","version","exec","appName","appVersion","splice","cpcsp_console_log","level","msg","LOG_LEVEL_DEBUG","log","LOG_LEVEL_INFO","info","postMessage","CAPICOM_LOCAL_MACHINE_STORE","CADESCOM_LOCAL_MACHINE_STORE","CADESCOM_CURRENT_USER_STORE","CADESCOM_CONTAINER_STORE","CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME","CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED","CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING","CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE","XmlDsigGost3410UrlObsolete","XmlDsigGost3411UrlObsolete","XmlDsigGost3410Url","XmlDsigGost3411Url","CADESCOM_CADES_DEFAULT","CADESCOM_CADES_BES","CADESCOM_CADES_T","CADESCOM_CADES_X_LONG_TYPE_1","CADESCOM_PKCS7_TYPE","CADESCOM_ENCODE_BASE64","CADESCOM_ENCODE_BINARY","CADESCOM_ENCODE_ANY","CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT","CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN","CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY","CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME","CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME","CAPICOM_CERTIFICATE_FIND_SHA1_HASH","CAPICOM_CERTIFICATE_FIND_ISSUER_NAME","CAPICOM_CERTIFICATE_FIND_ROOT_NAME","CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME","CAPICOM_CERTIFICATE_FIND_EXTENSION","CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY","CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY","CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID","CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED","CAPICOM_CERTIFICATE_FIND_KEY_USAGE","CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE","CAPICOM_PROPID_ENHKEY_USAGE","CAPICOM_OID_OTHER","CAPICOM_OID_KEY_USAGE_EXTENSION","CAPICOM_EKU_CLIENT_AUTH","CAPICOM_EKU_SMARTCARD_LOGON","CAPICOM_EKU_OTHER","CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME","CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME","CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION","CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME","CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME","CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION","CADESCOM_ATTRIBUTE_OTHER","CADESCOM_STRING_TO_UCS2LE","CADESCOM_BASE64_TO_BINARY","CADESCOM_DISPLAY_DATA_NONE","CADESCOM_DISPLAY_DATA_CONTENT","CADESCOM_DISPLAY_DATA_ATTRIBUTE","CADESCOM_ENCRYPTION_ALGORITHM_RC2","CADESCOM_ENCRYPTION_ALGORITHM_RC4","CADESCOM_ENCRYPTION_ALGORITHM_DES","CADESCOM_ENCRYPTION_ALGORITHM_3DES","CADESCOM_ENCRYPTION_ALGORITHM_AES","CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89","CADESCOM_HASH_ALGORITHM_SHA1","CADESCOM_HASH_ALGORITHM_MD2","CADESCOM_HASH_ALGORITHM_MD4","CADESCOM_HASH_ALGORITHM_MD5","CADESCOM_HASH_ALGORITHM_SHA_256","CADESCOM_HASH_ALGORITHM_SHA_384","CADESCOM_HASH_ALGORITHM_SHA_512","CADESCOM_HASH_ALGORITHM_CP_GOST_3411","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC","CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC","CADESCOM_AllowNone","CADESCOM_AllowNoOutstandingRequest","CADESCOM_AllowUntrustedCertificate","CADESCOM_AllowUntrustedRoot","CADESCOM_SkipInstallToStore","generatorFunc","continuer","verb","arg","result","generator","err","done","then","onFulfilled","onRejected","slice","arguments","isIE","isIOS","call_ru_cryptopro_npcades_10_native_bridge","getElementById","ActiveXObject","decimalToHexString","number","toUpperCase","GetMessageFromException","exception","cpcsp_chrome_nmcades","array","tmpobj","ex","response","str","show_firefox_missing_extension_dialog","cadesplugin_skip_extension_install","ovr","id","style","innerHTML","getElementsByTagName","addEventListener","plugin_loaded_error","visibility","install_opera_extension","event","opr","addons","installExtension","location","reload","stopPropagation","firefox_or_edge_nmcades_onload","check_chrome_plugin","plugin_loaded","nmcades_api_onload","data","url","substring","indexOf","fileref","onerror","onload","load_extension","load_npapi_plugin","elem","elem1","elem2","createPromise","check_npapi_plugin","display","mimetype","mimeTypes","enabledPlugin","div","length","readyState","obj","EnableInternalCSP","issuerName","subjectName","validFrom","validTo","getOwnerInfo","getInfo","SUBJECT_TAGS_TRANSLATIONS","getIssuerInfo","ISSUER_TAGS_TRANSLATIONS","getExtendedKeyUsage","getDecodedExtendedKeyUsage","getAlgorithm","isValid","exportBase64","hasExtendedKeyUsage","oids","CAPICOM_ACTIVE_DIRECTORY_USER_STORE","CAPICOM_MEMORY_STORE","CAPICOM_PROPID_ACCESS_STATE","CAPICOM_PROPID_ARCHIVED","CAPICOM_PROPID_ARCHIVED_KEY_HASH","CAPICOM_PROPID_AUTO_ENROLL","CAPICOM_PROPID_CROSS_CERT_DIST_POINTS","CAPICOM_PROPID_CTL_USAGE","CAPICOM_PROPID_DATE_STAMP","CAPICOM_PROPID_DESCRIPTION","CAPICOM_PROPID_EFS","CAPICOM_PROPID_ENROLLMENT","CAPICOM_PROPID_EXTENDED_ERROR_INFO","CAPICOM_PROPID_FIRST_RESERVED","CAPICOM_PROPID_FIRST_USER","CAPICOM_PROPID_FORTEZZA_DATA","CAPICOM_PROPID_FRIENDLY_NAME","CAPICOM_PROPID_HASH_PROP","CAPICOM_PROPID_IE30_RESERVED","CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH","CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH","CAPICOM_PROPID_KEY_CONTEXT","CAPICOM_PROPID_KEY_IDENTIFIER","CAPICOM_PROPID_KEY_PROV_HANDLE","CAPICOM_PROPID_KEY_SPEC","CAPICOM_PROPID_LAST_RESERVED","CAPICOM_PROPID_LAST_USER","CAPICOM_PROPID_MD5_HASH","CAPICOM_PROPID_NEXT_UPDATE_LOCATION","CAPICOM_PROPID_PUBKEY_ALG_PARA","CAPICOM_PROPID_PUBKEY_HASH_RESERVED","CAPICOM_PROPID_PVK_FILE","CAPICOM_PROPID_RENEWAL","CAPICOM_PROPID_SHA1_HASH","CAPICOM_PROPID_SIGNATURE_HASH","CAPICOM_PROPID_SMART_CARD_DATA","CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH","CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH","CAPICOM_PROPID_UNKNOWN","CAPICOM_SMART_CARD_USER_STORE","CAPICOM_STORE_OPEN_EXISTING_ONLY","CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED","CAPICOM_STORE_OPEN_READ_ONLY","CAPICOM_STORE_OPEN_READ_WRITE","CHECK_NONE","CHECK_OFFLINE_REVOCATION_STATUS","CHECK_ONLINE_REVOCATION_STATUS","CHECK_SIGNATURE_VALIDITY","CHECK_TIME_VALIDITY","CHECK_TRUSTED_ROOT","TRUST_CTL_IS_NOT_SIGNATURE_VALID","TRUST_CTL_IS_NOT_TIME_VALID","TRUST_CTL_IS_NOT_VALID_FOR_USAGE","TRUST_IS_CYCLIC","TRUST_IS_NOT_SIGNATURE_VALID","TRUST_IS_NOT_TIME_NESTED","TRUST_IS_NOT_TIME_VALID","TRUST_IS_NOT_VALID_FOR_USAGE","TRUST_IS_PARTIAL_CHAIN","TRUST_IS_REVOKED","TRUST_IS_UNTRUSTED_ROOT","TRUST_REVOCATION_STATUS_UNKNOWN","possibleNames","translation","OIDS_DICTIONARY","base64","Export","cadesPublicKey","algorithmInfo","algorithm","oid","PublicKey","Algorithm","FriendlyName","Value","reduce","decodedOids","oidCode","count","OIDS","ExtendedKeyUsage","EKUs","cadesExtendedKeyUsage","OID","tags","entitiesPath","entities","_parseCertInfo","tagsTranslations","rawInfo","extractedEntities","map","group","segmentsMatch","title","description","oidIdentifierMatch","oidIdentifier","isTranslated","oidTranslation","tagTranslation","tag","certOids","isArray","every","oidToCheck","some","certOid","IsValid","Result","isValidSystemSetup","systemInfo","_isSupportedCadesVersion","_isSupportedCSPVersion","major","patch","Number","createSignature","dataBase64","detachedSignature","_getCadesCert","cadesAttrs","cadesSignedData","cadesSigner","cadesAuthAttrs","signature","currentTime","_getDateObj","Date","propset_Name","propset_Value","propset_Certificate","AuthenticatedAttributes2","Add","propset_ContentEncoding","propset_Content","propset_Options","SignCades","cadesCertificateList","certificatesCount","dateObj","getVarDate"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,YAAa,GAAIH,GACE,iBAAZC,QACdA,QAAmB,UAAID,IAEvBD,EAAgB,UAAIC,IARtB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,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,oBAAsBmB,EAAWO,aACxD4Z,EAAoB,mBAAAtb,oBAAsBqb,EAAqBtZ,MAC/D,MAAO/C,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,iCAAAC,+BAA+BH,IAAU,wCAG3D,IAAKsc,EACH,MAAM,IAAIpc,MAAM,8BAKlB,IAME,GALAmc,EACE,mBAAArb,oBAAsBqb,EAAqB1Z,KAAKvC,YAAYwK,mCAAoClG,cAEpF,mBAAA1D,oBAAsBqb,EAAqBtZ,OAGvD,MAAM,IAAI7C,MAAM,6BAA6BwE,WAAU,eAGzDzB,EAAmB,mBAAAjC,oBAAsBqb,EAAqBnZ,KAAK,GACnE,MAAOlD,GAGP,MAFAC,QAAQD,MAAMA,GAER,IAAIE,MAAM,iCAAAC,+BAA+BH,IAAU,oCAK3D,OAFAmC,EAAWwB,QAEJV,U,8EC7EF,EAAAyY,YAAc,SAACa,GAAkB,OAACA,EAAQC,WAAaD,EAAQC,aAAeD","file":"crypto-pro.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cryptoPro\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cryptoPro\"] = factory();\n\telse\n\t\troot[\"cryptoPro\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","import { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\n\ntype Unpromisify = T extends Promise ? R : T;\n\nlet isSetLogLevel = false;\nlet isPluginLoaded = false;\n\nexport const _afterPluginsLoaded = any>(\n fn: T,\n): ((...args: Parameters) => Promise>>) => {\n const canPromise = Boolean(window.Promise);\n\n return async function (...args: Parameters): Promise>> {\n if (!isPluginLoaded) {\n try {\n require('../vendor/cadesplugin_api');\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при подключении модуля для работы с Cades plugin',\n );\n }\n\n isPluginLoaded = true;\n }\n\n const { cadesplugin } = window;\n\n if (!canPromise) {\n throw new Error('Необходим полифилл для Promise');\n }\n\n if (!cadesplugin) {\n throw new Error('Не подключен модуль для работы с Cades plugin');\n }\n\n if (!isSetLogLevel) {\n cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR);\n\n isSetLogLevel = true;\n }\n\n try {\n await cadesplugin;\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации модуля для работы с Cades plugin',\n );\n }\n\n return await fn.apply(this, args);\n };\n};\n","export const _extractMeaningfulErrorMessage = (error: Error): string | null => {\n let errorContainer = window.cadesplugin?.getLastError && window.cadesplugin.getLastError(error);\n\n if (!errorContainer?.message) {\n if (!error.message) {\n return null;\n }\n\n errorContainer = error;\n }\n\n const containsRussianLetters = /[а-яА-Я]/.test(errorContainer.message);\n\n if (!containsRussianLetters) {\n return null;\n }\n\n const searchResult = errorContainer.message.match(/^(.*?)(?:(?:\\.?\\s?\\(?0x)|(?:\\.?$))/);\n\n return searchResult ? searchResult[1] : null;\n};\n","// синтетические переменные, которые подменяются в рантайме\nexport const __cadesAsyncToken__ = {};\nexport const __createCadesPluginObject__ = (...args): any => ({});\n\nfunction getGeneratorConstructor(): GeneratorFunction {\n return new Function('', 'return Object.getPrototypeOf(function*(){}).constructor')();\n}\n\nexport const _generateCadesFn = (callback: Function): string => {\n const { cadesplugin } = window;\n const cadesGeneratorsAPI = Boolean(cadesplugin.CreateObjectAsync);\n const callbackName = callback.name || 'dynamicFn';\n const callbackLiteral = String(callback);\n const callbackArguments = callbackLiteral.match(/^function[\\s\\w]*?\\((.*?)\\)/)?.[1] || '';\n const callbackBody = callbackLiteral.replace(/^.*?{([\\s\\S]*?)}$/, '$1');\n let crossEnvCallbackLiteral = String(\n new (cadesGeneratorsAPI ? getGeneratorConstructor() : Function)(callbackArguments, callbackBody),\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__createCadesPluginObject__(\\([\\s\\S]*?\\))/gm,\n `cadesplugin.CreateObject${cadesGeneratorsAPI ? 'Async' : ''}$1`,\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__cadesAsyncToken__\\s*?\\+\\s*?\\b/gm,\n cadesGeneratorsAPI ? 'yield ' : '',\n );\n\n if (!cadesGeneratorsAPI) {\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/propset_(.*?)\\((.*?)\\)/gm, '$1 = $2');\n }\n\n return [\n cadesGeneratorsAPI ? `cadesplugin.async_spawn(${crossEnvCallbackLiteral});` : `(${crossEnvCallbackLiteral})();`,\n `//# sourceURL=crypto-pro_${callbackName}.js`,\n ].join('');\n};\n","export * from './cades-constants';\nexport * from './issuer-tags-translations';\nexport * from './oids-dictionary';\nexport * from './subject-tags-translations';\n","import { CadesCertificate, Certificate } from './certificate';\nimport { CAPICOM_PROPID_KEY_PROV_INFO } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractCommonName } from '../helpers/_extractCommonName';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nlet certificatesCache: Certificate[];\n\n/**\n * Возвращает список сертификатов, доступных пользователю в системе\n *\n * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов\n * @returns список сертификатов\n */\nexport const getUserCertificates = _afterPluginsLoaded((resetCache: boolean = false): Certificate[] => {\n const { cadesplugin } = window;\n\n if (!resetCache && certificatesCache) {\n return certificatesCache;\n }\n\n return eval(\n _generateCadesFn(function getCertsList(): Certificate[] {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificates;\n let cadesCertificatesCount;\n\n try {\n cadesCertificates = __cadesAsyncToken__ + cadesStore.Certificates;\n\n if (cadesCertificates) {\n cadesCertificates =\n __cadesAsyncToken__ + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n */\n cadesCertificates =\n __cadesAsyncToken__ +\n cadesCertificates.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n CAPICOM_PROPID_KEY_PROV_INFO,\n );\n\n cadesCertificatesCount = __cadesAsyncToken__ + cadesCertificates.Count;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!cadesCertificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n const certificateList: Certificate[] = [];\n\n try {\n while (cadesCertificatesCount) {\n const cadesCertificate: CadesCertificate =\n __cadesAsyncToken__ + cadesCertificates.Item(cadesCertificatesCount);\n\n certificateList.push(\n new Certificate(\n cadesCertificate,\n _extractCommonName(__cadesAsyncToken__ + cadesCertificate.SubjectName),\n __cadesAsyncToken__ + cadesCertificate.IssuerName,\n __cadesAsyncToken__ + cadesCertificate.SubjectName,\n __cadesAsyncToken__ + cadesCertificate.Thumbprint,\n __cadesAsyncToken__ + cadesCertificate.ValidFromDate,\n __cadesAsyncToken__ + cadesCertificate.ValidToDate,\n ),\n );\n\n cadesCertificatesCount--;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка обработки сертификатов');\n }\n\n cadesStore.Close();\n\n certificatesCache = certificateList;\n\n return certificatesCache;\n }),\n );\n});\n","export * from './certificate';\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает указанное внутренее свойство у сертификата в формате Cades\n *\n * @param propName = наименование свойства\n * @returns значение запрошенного свойства\n */\nexport const getCadesProp = _afterPluginsLoaded(function (propName: string): any {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getCadesProp() {\n let propertyValue;\n\n try {\n propertyValue = __cadesAsyncToken__ + cadesCertificate[propName];\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при обращении к свойству сертификата');\n }\n\n return propertyValue;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nexport interface SystemInfo {\n cadesVersion: string;\n cspVersion: string;\n}\n\n/**\n * Предоставляет информацию о системе\n *\n * @returns информацию о CSP и плагине\n */\nexport const getSystemInfo = _afterPluginsLoaded(\n (): SystemInfo => {\n const sysInfo = {\n cadesVersion: null,\n cspVersion: null,\n };\n\n return eval(\n _generateCadesFn(function getSystemInfo(): SystemInfo {\n let cadesAbout;\n\n try {\n cadesAbout = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.About');\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.PluginVersion;\n sysInfo.cspVersion = __cadesAsyncToken__ + cadesAbout.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.Version;\n }\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = __cadesAsyncToken__ + sysInfo.cspVersion.toString();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении информации о системе');\n }\n\n return sysInfo;\n }),\n );\n },\n);\n","export * from './api';\n","export * from './getCertificate';\nexport * from './getUserCertificates';\nexport * from './getSystemInfo';\nexport * from './isValidSystemSetup';\nexport * from './createSignature';\nexport * from './certificate';\n","import { Certificate } from './certificate';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { getUserCertificates } from './getUserCertificates';\n\n/**\n * Возвращает сертификат по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат\n */\nexport const getCertificate = _afterPluginsLoaded(\n async (thumbprint: string): Promise => {\n if (!thumbprint) {\n throw new Error('Отпечаток не указан');\n }\n\n const availableCertificates: Certificate[] = await getUserCertificates();\n const foundCertificate: Certificate = availableCertificates.find((cert) => cert.thumbprint === thumbprint);\n\n if (!foundCertificate) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n return foundCertificate;\n },\n);\n",";(function () {\n //already loaded\n if(window.cadesplugin)\n return;\n\n var pluginObject;\n var plugin_resolved = 0;\n var plugin_reject;\n var plugin_resolve;\n var isOpera = 0;\n var isFireFox = 0;\n var isEdge = 0;\n var isSafari = 0;\n var failed_extensions = 0;\n\n var canPromise = !!window.Promise;\n var cadesplugin;\n\n if(canPromise)\n {\n cadesplugin = new Promise(function(resolve, reject)\n {\n plugin_resolve = resolve;\n plugin_reject = reject;\n });\n } else\n {\n cadesplugin = {};\n }\n\n function check_browser() {\n var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem= /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1] || '')};\n }\n if(M[1]=== 'Chrome'){\n tem= ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem!= null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]};\n }\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n return {name:M[0],version:M[1]};\n }\n var browserSpecs = check_browser();\n\n function cpcsp_console_log(level, msg){\n //IE9 не может писать в консоль если не открыта вкладка developer tools\n if(typeof(console) === 'undefined')\n return;\n if (level <= cadesplugin.current_log_level ){\n if (level === cadesplugin.LOG_LEVEL_DEBUG)\n console.log(\"DEBUG: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_INFO)\n console.info(\"INFO: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_ERROR)\n console.error(\"ERROR: %s\", msg);\n return;\n }\n }\n\n function set_log_level(level){\n if (!((level === cadesplugin.LOG_LEVEL_DEBUG) ||\n (level === cadesplugin.LOG_LEVEL_INFO) ||\n (level === cadesplugin.LOG_LEVEL_ERROR))){\n cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR, \"cadesplugin_api.js: Incorrect log_level: \" + level);\n return;\n }\n cadesplugin.current_log_level = level;\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = DEBUG\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = INFO\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = ERROR\");\n if(isNativeMessageSupported())\n {\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n window.postMessage(\"set_log_level=debug\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n window.postMessage(\"set_log_level=info\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n window.postMessage(\"set_log_level=error\", \"*\");\n }\n }\n\n function set_constantValues()\n {\n cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CAPICOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CADESCOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_CONTAINER_STORE = 100;\n\n cadesplugin.CAPICOM_MY_STORE = \"My\";\n\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\n\n cadesplugin.XmlDsigGost3410UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr3411\";\n cadesplugin.XmlDsigGost3410Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411\";\n\n cadesplugin.CADESCOM_CADES_DEFAULT = 0;\n cadesplugin.CADESCOM_CADES_BES = 1;\n cadesplugin.CADESCOM_CADES_T = 0x5;\n cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\n cadesplugin.CADESCOM_PKCS7_TYPE = 0xffff;\n\n cadesplugin.CADESCOM_ENCODE_BASE64 = 0;\n cadesplugin.CADESCOM_ENCODE_BINARY = 1;\n cadesplugin.CADESCOM_ENCODE_ANY = -1;\n\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\n\n cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\n cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\n\n cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\n\n cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE = 9;\n\n cadesplugin.CAPICOM_OID_OTHER = 0;\n cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\n\n cadesplugin.CAPICOM_EKU_CLIENT_AUTH = 2;\n cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON = 5;\n cadesplugin.CAPICOM_EKU_OTHER = 0;\n\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_ATTRIBUTE_OTHER = -1;\n\n cadesplugin.CADESCOM_STRING_TO_UCS2LE = 0;\n cadesplugin.CADESCOM_BASE64_TO_BINARY = 1;\n\n cadesplugin.CADESCOM_DISPLAY_DATA_NONE = 0;\n cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT = 1;\n cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\n\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\n\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1 = 0;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD2 = 1;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD4 = 2;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD5 = 3;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\n\n cadesplugin.LOG_LEVEL_DEBUG = 4;\n cadesplugin.LOG_LEVEL_INFO = 2;\n cadesplugin.LOG_LEVEL_ERROR = 1;\n\n cadesplugin.CADESCOM_AllowNone = 0;\n cadesplugin.CADESCOM_AllowNoOutstandingRequest = 0x1;\n cadesplugin.CADESCOM_AllowUntrustedCertificate = 0x2;\n cadesplugin.CADESCOM_AllowUntrustedRoot = 0x4;\n cadesplugin.CADESCOM_SkipInstallToStore = 0x10000000;\n }\n\n function async_spawn(generatorFunc) {\n function continuer(verb, arg) {\n var result;\n try {\n result = generator[verb](arg);\n } catch (err) {\n return Promise.reject(err);\n }\n if (result.done) {\n return result.value;\n } else {\n return Promise.resolve(result.value).then(onFulfilled, onRejected);\n }\n }\n var generator = generatorFunc(Array.prototype.slice.call(arguments, 1));\n var onFulfilled = continuer.bind(continuer, \"next\");\n var onRejected = continuer.bind(continuer, \"throw\");\n return onFulfilled();\n }\n\n function isIE() {\n // var retVal = ((\"Microsoft Internet Explorer\" == navigator.appName) || // IE < 11\n // navigator.userAgent.match(/Trident\\/./i)); // IE 11\n return (browserSpecs.name === 'IE' || browserSpecs.name === 'MSIE');\n }\n\n function isIOS() {\n return (navigator.userAgent.match(/ipod/i) ||\n navigator.userAgent.match(/ipad/i) ||\n navigator.userAgent.match(/iphone/i));\n }\n\n function isNativeMessageSupported()\n {\n // В IE работаем через NPAPI\n if(isIE())\n return false;\n // В Edge работаем через NativeMessage\n if(browserSpecs.name === 'Edge') {\n isEdge = true;\n return true;\n }\n // В Chrome, Firefox, Safari и Opera работаем через асинхронную версию в зависимости от версии\n if(browserSpecs.name === 'Opera') {\n isOpera = true;\n if(browserSpecs.version >= 33){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Firefox') {\n isFireFox = true;\n if(browserSpecs.version >= 52){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Chrome') {\n if(browserSpecs.version >= 42){\n return true;\n }\n else{\n return false;\n }\n }\n //В Сафари начиная с 12 версии нет NPAPI\n if(browserSpecs.name === 'Safari') {\n isSafari = true;\n if(browserSpecs.version >= 12) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n // Функция активации объектов КриптоПро ЭЦП Browser plug-in\n function CreateObject(name) {\n if (isIOS()) {\n // На iOS для создания объектов используется функция\n // call_ru_cryptopro_npcades_10_native_bridge, определенная в IOS_npcades_supp.js\n return call_ru_cryptopro_npcades_10_native_bridge(\"CreateObject\", [name]);\n }\n if (isIE()) {\n // В Internet Explorer создаются COM-объекты\n if (name.match(/X509Enrollment/i)) {\n try {\n // Объекты CertEnroll пробуем создавать через нашу фабрику,\n // если не получилось то через CX509EnrollmentWebClassFactory\n var objCertEnrollClassFactory = document.getElementById(\"webClassFactory\");\n return objCertEnrollClassFactory.CreateObject(name);\n }\n catch (e) {\n try {\n var objWebClassFactory = document.getElementById(\"certEnrollClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (err) {\n throw (\"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS\");\n }\n }\n }\n // Объекты CAPICOM и CAdESCOM создаются через CAdESCOM.WebClassFactory\n try {\n var objWebClassFactory = document.getElementById(\"webClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (e) {\n // Для версий плагина ниже 2.0.12538\n return new ActiveXObject(name);\n }\n }\n // создаются объекты NPAPI\n return pluginObject.CreateObject(name);\n }\n\n function decimalToHexString(number) {\n if (number < 0) {\n number = 0xFFFFFFFF + number + 1;\n }\n\n return number.toString(16).toUpperCase();\n }\n\n function GetMessageFromException(e) {\n var err = e.message;\n if (!err) {\n err = e;\n } else if (e.number) {\n err += \" (0x\" + decimalToHexString(e.number) + \")\";\n }\n return err;\n }\n\n function getLastError(exception) {\n if(isNativeMessageSupported() || isIE() || isIOS() ) {\n return GetMessageFromException(exception);\n }\n\n try {\n return pluginObject.getLastError();\n } catch(e) {\n return GetMessageFromException(exception);\n }\n }\n\n // Функция для удаления созданных объектов\n function ReleasePluginObjects() {\n return cpcsp_chrome_nmcades.ReleasePluginObjects();\n }\n\n // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in\n function CreateObjectAsync(name) {\n return pluginObject.CreateObjectAsync(name);\n }\n\n //Функции для IOS\n var ru_cryptopro_npcades_10_native_bridge = {\n callbacksCount : 1,\n callbacks : {},\n\n // Automatically called by native layer when a result is available\n resultForCallback : function resultForCallback(callbackId, resultArray) {\n var callback = ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId];\n if (!callback) return;\n callback.apply(null,resultArray);\n },\n\n // Use this in javascript to request native objective-c code\n // functionName : string (I think the name is explicit :p)\n // args : array of arguments\n // callback : function with n-arguments that is going to be called when the native code returned\n call : function call(functionName, args, callback) {\n var hasCallback = callback && typeof callback === \"function\";\n var callbackId = hasCallback ? ru_cryptopro_npcades_10_native_bridge.callbacksCount++ : 0;\n\n if (hasCallback)\n ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId] = callback;\n\n var iframe = document.createElement(\"IFRAME\");\n var arrObjs = new Array(\"_CPNP_handle\");\n try{\n iframe.setAttribute(\"src\", \"cpnp-js-call:\" + functionName + \":\" + callbackId+ \":\" + encodeURIComponent(JSON.stringify(args, arrObjs)));\n } catch(e){\n alert(e);\n }\n document.documentElement.appendChild(iframe);\n iframe.parentNode.removeChild(iframe);\n iframe = null;\n }\n };\n\n function call_ru_cryptopro_npcades_10_native_bridge(functionName, array){\n var tmpobj;\n var ex;\n ru_cryptopro_npcades_10_native_bridge.call(functionName, array, function(e, response){\n ex = e;\n var str='tmpobj='+response;\n eval(str);\n if (typeof (tmpobj) === \"string\"){\n tmpobj = tmpobj.replace(/\\\\\\n/gm, \"\\n\");\n tmpobj = tmpobj.replace(/\\\\\\r/gm, \"\\r\");\n }\n });\n if(ex)\n throw ex;\n return tmpobj;\n }\n\n function show_firefox_missing_extension_dialog()\n {\n if (!window.cadesplugin_skip_extension_install)\n {\n var ovr = document.createElement('div');\n ovr.id = \"cadesplugin_ovr\";\n ovr.style = \"visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)\";\n ovr.innerHTML = \"
\" +\n \"\" +\n \"

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

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

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

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

\" +\n \"
\";\n document.getElementsByTagName(\"Body\")[0].appendChild(ovr);\n var btn_install = document.getElementById(\"cadesplugin_install\");\n btn_install.addEventListener('click', function(event) {\n opr.addons.installExtension(\"epebfcehmdedogndhlcacafjaacknbcm\",\n function()\n {\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n location.reload();\n },\n function(){})\n });\n document.getElementById(\"cadesplugin_close_install\").addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n\n ovr.addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n ovr.style.visibility=\"visible\";\n document.getElementById(\"cadesplugin_ovr_item\").addEventListener('click',function(e){\n e.stopPropagation();\n });\n });\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n\n function firefox_or_edge_nmcades_onload() {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n\n function nmcades_api_onload () {\n window.postMessage(\"cadesplugin_echo_request\", \"*\");\n window.addEventListener(\"message\", function (event){\n if (typeof(event.data) !== \"string\" || !event.data.match(\"cadesplugin_loaded\"))\n return;\n if(isFireFox || isEdge || isSafari)\n {\n // Для Firefox, Сафари, Edge вместе с сообщением cadesplugin_loaded прилетает url для загрузки nmcades_plugin_api.js\n var url = event.data.substring(event.data.indexOf(\"url:\") + 4);\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", url);\n fileref.onerror = plugin_loaded_error;\n fileref.onload = firefox_or_edge_nmcades_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n // Для Firefox, Safari и Edge у нас только по одному расширению.\n failed_extensions++;\n }else {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n }, false);\n }\n\n //Загружаем расширения для Chrome, Opera, YaBrowser, FireFox, Edge, Safari\n function load_extension()\n {\n\n if(isFireFox || isEdge || isSafari){\n // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера.\n nmcades_api_onload();\n } else {\n // в асинхронном варианте для chrome и opera подключаем оба расширения\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n }\n }\n\n //Загружаем плагин для NPAPI\n function load_npapi_plugin()\n {\n var elem = document.createElement('object');\n elem.setAttribute(\"id\", \"cadesplugin_object\");\n elem.setAttribute(\"type\", \"application/x-cades\");\n elem.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem);\n pluginObject = document.getElementById(\"cadesplugin_object\");\n if(isIE())\n {\n var elem1 = document.createElement('object');\n elem1.setAttribute(\"id\", \"certEnrollClassFactory\");\n elem1.setAttribute(\"classid\", \"clsid:884e2049-217d-11da-b2a4-000e7bbb2b09\");\n elem1.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem1);\n var elem2 = document.createElement('object');\n elem2.setAttribute(\"id\", \"webClassFactory\");\n elem2.setAttribute(\"classid\", \"clsid:B04C8637-10BD-484E-B0DA-B8A039F60024\");\n elem2.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem2);\n }\n }\n\n //Отправляем событие что все ок.\n function plugin_loaded()\n {\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_resolve();\n }else {\n window.postMessage(\"cadesplugin_loaded\", \"*\");\n }\n }\n\n //Отправляем событие что сломались.\n function plugin_loaded_error(msg)\n {\n if(isNativeMessageSupported())\n {\n //в асинхронном варианте подключаем оба расширения, если сломались оба пробуем установить для Opera\n failed_extensions++;\n if(failed_extensions<2)\n return;\n if(isOpera && (typeof(msg) === 'undefined'|| typeof(msg) === 'object'))\n {\n install_opera_extension();\n return;\n }\n }\n if(typeof(msg) === 'undefined' || typeof(msg) === 'object')\n msg = \"Плагин недоступен\";\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(msg);\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n }\n\n //проверяем что у нас хоть какое то событие ушло, и если не уходило кидаем еще раз ошибку\n function check_load_timeout()\n {\n if(plugin_resolved === 1)\n return;\n if(isFireFox)\n {\n show_firefox_missing_extension_dialog();\n }\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(\"Истекло время ожидания загрузки плагина\");\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n\n }\n\n //Вспомогательная функция для NPAPI\n function createPromise(arg)\n {\n return new Promise(arg);\n }\n\n function check_npapi_plugin (){\n try {\n var oAbout = CreateObject(\"CAdESCOM.About\");\n plugin_loaded();\n }\n catch (err) {\n document.getElementById(\"cadesplugin_object\").style.display = 'none';\n // Объект создать не удалось, проверим, установлен ли\n // вообще плагин. Такая возможность есть не во всех браузерах\n var mimetype = navigator.mimeTypes[\"application/x-cades\"];\n if (mimetype) {\n var plugin = mimetype.enabledPlugin;\n if (plugin) {\n plugin_loaded_error(\"Плагин загружен, но не создаются обьекты\");\n }else\n {\n plugin_loaded_error(\"Ошибка при загрузке плагина\");\n }\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n }\n\n //Проверяем работает ли плагин\n function check_plugin_working()\n {\n var div = document.createElement(\"div\");\n div.innerHTML = \"\";\n var isIeLessThan9 = (div.getElementsByTagName(\"i\").length === 1);\n if (isIeLessThan9) {\n plugin_loaded_error(\"Internet Explorer версии 8 и ниже не поддерживается\");\n return;\n }\n\n if(isNativeMessageSupported())\n {\n load_extension();\n }else if(!canPromise) {\n window.addEventListener(\"message\", function (event){\n if (event.data !== \"cadesplugin_echo_request\")\n return;\n load_npapi_plugin();\n check_npapi_plugin();\n },\n false);\n }else\n {\n if(document.readyState === \"complete\"){\n load_npapi_plugin();\n check_npapi_plugin();\n } else {\n window.addEventListener(\"load\", function (event) {\n load_npapi_plugin();\n check_npapi_plugin();\n }, false);\n }\n }\n }\n\n function set_pluginObject(obj)\n {\n pluginObject = obj;\n }\n\n function is_capilite_enabled()\n {\n if ((typeof (cadesplugin.EnableInternalCSP) !== 'undefined') && cadesplugin.EnableInternalCSP)\n return true;\n return false;\n };\n\n //Export\n cadesplugin.JSModuleVersion = \"2.1.2\";\n cadesplugin.async_spawn = async_spawn;\n cadesplugin.set = set_pluginObject;\n cadesplugin.set_log_level = set_log_level;\n cadesplugin.getLastError = getLastError;\n cadesplugin.is_capilite_enabled = is_capilite_enabled;\n\n if(isNativeMessageSupported())\n {\n cadesplugin.CreateObjectAsync = CreateObjectAsync;\n cadesplugin.ReleasePluginObjects = ReleasePluginObjects;\n }\n\n if(!isNativeMessageSupported())\n {\n cadesplugin.CreateObject = CreateObject;\n }\n\n if(window.cadesplugin_load_timeout)\n {\n setTimeout(check_load_timeout, window.cadesplugin_load_timeout);\n }\n else\n {\n setTimeout(check_load_timeout, 20000);\n }\n\n set_constantValues();\n\n cadesplugin.current_log_level = cadesplugin.LOG_LEVEL_ERROR;\n window.cadesplugin = cadesplugin;\n check_plugin_working();\n}());\n","import { ISSUER_TAGS_TRANSLATIONS, SUBJECT_TAGS_TRANSLATIONS } from '../../constants';\nimport { TagTranslation } from '../../helpers/_parseCertInfo';\nimport { exportBase64 } from './exportBase64';\nimport { getAlgorithm } from './getAlgorithm';\nimport { getCadesProp } from './getCadesProp';\nimport { getDecodedExtendedKeyUsage, ExtendedKeysTranslations } from './getDecodedExtendedKeyUsage';\nimport { getExtendedKeyUsage } from './getExtendedKeyUsage';\nimport { getInfo } from './getInfo';\nimport { hasExtendedKeyUsage } from './hasExtendedKeyUsage';\nimport { isValid } from './isValid';\n\nexport type CadesCertificate = any;\n\nexport class Certificate {\n constructor(\n public _cadesCertificate: CadesCertificate,\n public name: string,\n public issuerName: string,\n public subjectName: string,\n public thumbprint: string,\n public validFrom: string,\n public validTo: string,\n ) {}\n\n public getOwnerInfo(): Promise {\n return getInfo.call(this, SUBJECT_TAGS_TRANSLATIONS, 'SubjectName');\n }\n\n public getIssuerInfo(): Promise {\n return getInfo.call(this, ISSUER_TAGS_TRANSLATIONS, 'IssuerName');\n }\n\n public getExtendedKeyUsage(): Promise {\n return getExtendedKeyUsage.call(this);\n }\n\n public getDecodedExtendedKeyUsage(): Promise {\n return getDecodedExtendedKeyUsage.call(this);\n }\n\n public getAlgorithm(): Promise {\n return getAlgorithm.call(this);\n }\n\n public getCadesProp(propName): Promise {\n return getCadesProp.call(this, propName);\n }\n\n public isValid(): Promise {\n return isValid.call(this);\n }\n\n public exportBase64(): Promise {\n return exportBase64.call(this);\n }\n\n public hasExtendedKeyUsage(oids): Promise {\n return hasExtendedKeyUsage.call(this, oids);\n }\n}\n","export const CADESCOM_ATTRIBUTE_OTHER = -1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CADESCOM_AllowNoOutstandingRequest = 1;\nexport const CADESCOM_AllowNone = 0;\nexport const CADESCOM_AllowUntrustedCertificate = 2;\nexport const CADESCOM_AllowUntrustedRoot = 4;\nexport const CADESCOM_BASE64_TO_BINARY = 0x01;\nexport const CADESCOM_CADES_BES = 1;\nexport const CADESCOM_CADES_DEFAULT = 0;\nexport const CADESCOM_CADES_T = 5;\nexport const CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\nexport const CADESCOM_CONTAINER_STORE = 100;\nexport const CADESCOM_CURRENT_USER_STORE = 2;\nexport const CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\nexport const CADESCOM_DISPLAY_DATA_CONTENT = 1;\nexport const CADESCOM_DISPLAY_DATA_NONE = 0;\nexport const CADESCOM_ENCODE_ANY = -1;\nexport const CADESCOM_ENCODE_BASE64 = 0;\nexport const CADESCOM_ENCODE_BINARY = 1;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\nexport const CADESCOM_HASH_ALGORITHM_MD2 = 1;\nexport const CADESCOM_HASH_ALGORITHM_MD4 = 2;\nexport const CADESCOM_HASH_ALGORITHM_MD5 = 3;\nexport const CADESCOM_HASH_ALGORITHM_SHA1 = 0;\nexport const CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\nexport const CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\nexport const CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\nexport const CADESCOM_LOCAL_MACHINE_STORE = 1;\nexport const CADESCOM_PKCS7_TYPE = 65535;\nexport const CADESCOM_STRING_TO_UCS2LE = 0x00;\nexport const CADESCOM_SkipInstallToStore = 268435456;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\nexport const CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\nexport const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\nexport const CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\nexport const CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\nexport const CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\nexport const CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\nexport const CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\nexport const CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\nexport const CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\nexport const CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\nexport const CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\nexport const CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\nexport const CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\nexport const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\nexport const CAPICOM_CURRENT_USER_STORE = 2;\nexport const CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\nexport const CAPICOM_EKU_CLIENT_AUTH = 2;\nexport const CAPICOM_EKU_OTHER = 0;\nexport const CAPICOM_EKU_SMARTCARD_LOGON = 5;\nexport const CAPICOM_LOCAL_MACHINE_STORE = 1;\nexport const CAPICOM_MEMORY_STORE = 0;\nexport const CAPICOM_MY_STORE = 'My';\nexport const CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\nexport const CAPICOM_OID_OTHER = 0;\nexport const CAPICOM_PROPID_ACCESS_STATE = 14;\nexport const CAPICOM_PROPID_ARCHIVED = 19;\nexport const CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65;\nexport const CAPICOM_PROPID_AUTO_ENROLL = 21;\nexport const CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23;\nexport const CAPICOM_PROPID_CTL_USAGE = 9;\nexport const CAPICOM_PROPID_DATE_STAMP = 27;\nexport const CAPICOM_PROPID_DESCRIPTION = 13;\nexport const CAPICOM_PROPID_EFS = 17;\nexport const CAPICOM_PROPID_ENHKEY_USAGE = 9;\nexport const CAPICOM_PROPID_ENROLLMENT = 26;\nexport const CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30;\nexport const CAPICOM_PROPID_FIRST_RESERVED = 66;\nexport const CAPICOM_PROPID_FIRST_USER = 0x00008000;\nexport const CAPICOM_PROPID_FORTEZZA_DATA = 18;\nexport const CAPICOM_PROPID_FRIENDLY_NAME = 11;\nexport const CAPICOM_PROPID_HASH_PROP = 3;\nexport const CAPICOM_PROPID_IE30_RESERVED = 7;\nexport const CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24;\nexport const CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28;\nexport const CAPICOM_PROPID_KEY_CONTEXT = 5;\nexport const CAPICOM_PROPID_KEY_IDENTIFIER = 20;\nexport const CAPICOM_PROPID_KEY_PROV_HANDLE = 1;\nexport const CAPICOM_PROPID_KEY_PROV_INFO = 2;\nexport const CAPICOM_PROPID_KEY_SPEC = 6;\nexport const CAPICOM_PROPID_LAST_RESERVED = 0x00007fff;\nexport const CAPICOM_PROPID_LAST_USER = 0x0000ffff;\nexport const CAPICOM_PROPID_MD5_HASH = 4;\nexport const CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10;\nexport const CAPICOM_PROPID_PUBKEY_ALG_PARA = 22;\nexport const CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8;\nexport const CAPICOM_PROPID_PVK_FILE = 12;\nexport const CAPICOM_PROPID_RENEWAL = 64;\nexport const CAPICOM_PROPID_SHA1_HASH = 3;\nexport const CAPICOM_PROPID_SIGNATURE_HASH = 15;\nexport const CAPICOM_PROPID_SMART_CARD_DATA = 16;\nexport const CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29;\nexport const CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25;\nexport const CAPICOM_PROPID_UNKNOWN = 0;\nexport const CAPICOM_SMART_CARD_USER_STORE = 4;\nexport const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128;\nexport const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256;\nexport const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\nexport const CAPICOM_STORE_OPEN_READ_ONLY = 0;\nexport const CAPICOM_STORE_OPEN_READ_WRITE = 1;\nexport const CHECK_NONE = 0;\nexport const CHECK_OFFLINE_REVOCATION_STATUS = 16;\nexport const CHECK_ONLINE_REVOCATION_STATUS = 8;\nexport const CHECK_SIGNATURE_VALIDITY = 4;\nexport const CHECK_TIME_VALIDITY = 2;\nexport const CHECK_TRUSTED_ROOT = 1;\nexport const LOG_LEVEL_DEBUG = 4;\nexport const LOG_LEVEL_ERROR = 1;\nexport const LOG_LEVEL_INFO = 2;\nexport const TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144;\nexport const TRUST_CTL_IS_NOT_TIME_VALID = 131072;\nexport const TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288;\nexport const TRUST_IS_CYCLIC = 128;\nexport const TRUST_IS_NOT_SIGNATURE_VALID = 8;\nexport const TRUST_IS_NOT_TIME_NESTED = 2;\nexport const TRUST_IS_NOT_TIME_VALID = 1;\nexport const TRUST_IS_NOT_VALID_FOR_USAGE = 16;\nexport const TRUST_IS_PARTIAL_CHAIN = 65536;\nexport const TRUST_IS_REVOKED = 4;\nexport const TRUST_IS_UNTRUSTED_ROOT = 32;\nexport const TRUST_REVOCATION_STATUS_UNKNOWN = 64;\nexport const XmlDsigGost3410Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411';\nexport const XmlDsigGost3410UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411';\nexport const XmlDsigGost3411Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411';\nexport const XmlDsigGost3411UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr3411';\n","import { TagsTranslations } from './tags-translations';\n\nexport const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Удостоверяющий центр' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Тип' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","export const OIDS_DICTIONARY = {\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\n '1.2.643.3.8.100.1': 'Сертификат типа \"ekey-ГОСТ\"',\n '1.2.643.3.8.100.1.1': 'Общее использование в системах ИОК без права заверения финансовых документов',\n '1.2.643.3.8.100.1.10':\n 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11':\n 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13':\n 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.3.8.100.1.2': 'Передача отчетности по ТКС',\n '1.2.643.3.8.100.1.3': 'Оформление взаимных обязательств, соглашений, договоров, актов и т.п.',\n '1.2.643.3.8.100.1.4': 'Внутрикорпоративный документооборот',\n '1.2.643.3.8.100.1.5': 'Использование в системах электронной торговли',\n '1.2.643.3.8.100.1.6': 'Использование в торгово-закупочной системе \"ЭЛЕКТРА\"',\n '1.2.643.3.8.100.1.7': 'Использование в системе Портал государственных закупок Ставропольского края.',\n '1.2.643.3.8.100.1.8': 'Использование в Единой системе электронной торговли B2B-Center и B2G.',\n '1.2.643.3.8.100.1.9':\n 'Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа',\n '1.2.643.5.1.24.2.1.3':\n 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1':\n 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3':\n 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\n '1.2.643.6.2.1.7.1':\n 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.2.643.6.2.1.7.2':\n 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.3':\n 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.6.3.1.1': 'Использование на электронных площадок отобранных для проведения аукционах в электронной форме',\n '1.2.643.6.3.1.2.1': 'Тип участника - Юридическое лицо',\n '1.2.643.6.3.1.2.2': 'Тип участника - Физическое лицо',\n '1.2.643.6.3.1.2.3': 'Тип участника - Индивидуальный предприниматель',\n '1.2.643.6.3.1.3.1': 'Участник размещения заказа',\n '1.2.643.6.3.1.4.1': 'Администратор организации',\n '1.2.643.6.3.1.4.2': 'Уполномоченный специалист',\n '1.2.643.6.3.1.4.3': 'Специалист с правом подписи контракта',\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\n '1.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"',\n};\n","import { TagsTranslations } from './tags-translations';\n\nexport const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Владелец' },\n { possibleNames: ['SN'], translation: 'Фамилия' },\n { possibleNames: ['G'], translation: 'Имя Отчество' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Отдел/подразделение' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Экспортирует сертификат в формате base64\n *\n * @returns сертификат в формате base64\n */\nexport const exportBase64 = _afterPluginsLoaded(function (): string {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function exportBase64(): string {\n let base64: string;\n\n try {\n base64 = __cadesAsyncToken__ + cadesCertificate.Export(0);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при экспорте сертификата');\n }\n\n return base64;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\ninterface AlgorithmInfo {\n algorithm: string;\n oid: string;\n}\n\n/**\n * Возвращает информацию об алгоритме сертификата\n *\n * @returns информацию об алгоритме и его OID'е\n */\nexport const getAlgorithm = _afterPluginsLoaded(function (): AlgorithmInfo {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getAlgorithm(): AlgorithmInfo {\n const algorithmInfo: AlgorithmInfo = {\n algorithm: null,\n oid: null,\n };\n let cadesPublicKey;\n\n try {\n cadesPublicKey = __cadesAsyncToken__ + cadesCertificate.PublicKey();\n cadesPublicKey = __cadesAsyncToken__ + cadesPublicKey.Algorithm;\n algorithmInfo.algorithm = __cadesAsyncToken__ + cadesPublicKey.FriendlyName;\n algorithmInfo.oid = __cadesAsyncToken__ + cadesPublicKey.Value;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении алгоритма');\n }\n\n return algorithmInfo;\n }),\n );\n});\n","import { OIDS_DICTIONARY } from '../../constants';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\nexport interface ExtendedKeysTranslations {\n [key: string]: string | null;\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы сертификата\n *\n * @returns словарь расшифрованных ОИД'ов\n */\nexport const getDecodedExtendedKeyUsage = _afterPluginsLoaded(async function (): Promise {\n const certificateOids = await (this as Certificate).getExtendedKeyUsage();\n\n return certificateOids.reduce(\n (decodedOids, oidCode) => ({\n ...decodedOids,\n [oidCode]: OIDS_DICTIONARY[oidCode] || null,\n }),\n {},\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает ОИД'ы сертификата\n *\n * @returns список ОИД'ов\n */\nexport const getExtendedKeyUsage = _afterPluginsLoaded(function (): string[] {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getExtendedKeyUsage(): string[] {\n const OIDS: string[] = [];\n let count: any;\n\n try {\n count = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n count = __cadesAsyncToken__ + count.EKUs;\n count = __cadesAsyncToken__ + count.Count;\n\n if (count > 0) {\n while (count > 0) {\n let cadesExtendedKeyUsage;\n\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.EKUs;\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.Item(count);\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.OID;\n\n OIDS.push(cadesExtendedKeyUsage);\n\n count--;\n }\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || \"Ошибка при получении ОИД'ов\");\n }\n\n return OIDS;\n }),\n );\n});\n","import { TagsTranslations } from '../../constants/tags-translations';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { _parseCertInfo, TagTranslation } from '../../helpers/_parseCertInfo';\nimport { getCadesProp } from './getCadesProp';\n\n/**\n * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам\n *\n * @param tags = словарь\n * @param entitiesPath = путь к разбираемой сущности\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const getInfo = _afterPluginsLoaded(async function (\n tags: TagsTranslations[],\n entitiesPath: string,\n): Promise {\n let entities: string;\n\n try {\n entities = await getCadesProp.call(this, entitiesPath);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при извлечении информации из сертификата');\n }\n\n return _parseCertInfo(tags, entities);\n});\n","import { OIDS_DICTIONARY } from '../constants';\nimport { TagsTranslations } from '../constants/tags-translations';\n\nexport interface TagTranslation {\n description: string;\n title: string;\n isTranslated: boolean;\n}\n\n/**\n * Парсит информацию из строки с информацией о сертификате\n *\n * @param tagsTranslations - словарь с расшифровками тэгов\n * @param rawInfo - данные для парсинга\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const _parseCertInfo = (tagsTranslations: TagsTranslations[], rawInfo: string): TagTranslation[] => {\n const extractedEntities: string[] = rawInfo.match(/([а-яА-Яa-zA-Z0-9.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (extractedEntities) {\n return extractedEntities.map((group) => {\n const segmentsMatch = group.match(/^([а-яА-Яa-zA-Z0-9.]+)=(.+?),?$/);\n let title = segmentsMatch?.[1];\n // Вырезаем лишние кавычки\n const description = segmentsMatch?.[2]?.replace(/^\"(.*)\"/, '$1')?.replace(/\"{2}/g, '\"');\n const oidIdentifierMatch = title?.match(/^OID\\.(.*)/);\n const oidIdentifier = oidIdentifierMatch?.[1];\n let isTranslated = false;\n\n // Если нашли в тайтле ОИД, пытаемся его расшифровать\n if (oidIdentifier) {\n const oidTranslation = OIDS_DICTIONARY[oidIdentifier];\n\n if (oidTranslation) {\n title = oidTranslation;\n isTranslated = true;\n }\n }\n\n const tagTranslation = tagsTranslations.find((tag) => tag.possibleNames.find((name) => name === title))\n ?.translation;\n\n if (tagTranslation) {\n title = tagTranslation;\n isTranslated = true;\n }\n\n return { description, title, isTranslated };\n });\n }\n};\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет наличие ОИД'а (ОИД'ов) у сертификата\n *\n * @param oids - ОИД'ы для проверки\n * @returns флаг наличия ОИД'ов у сертификата\n */\nexport const hasExtendedKeyUsage = _afterPluginsLoaded(async function (oids: string | string[]): Promise {\n const certOids = await (this as Certificate).getExtendedKeyUsage();\n\n let result: boolean;\n\n if (Array.isArray(oids)) {\n result = oids.every((oidToCheck) => certOids.some((certOid) => certOid === oidToCheck));\n } else {\n result = certOids.some((certOid) => certOid === oids);\n }\n\n return result;\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет действительность сертификата\n *\n * @returns флаг валидности\n */\nexport const isValid = _afterPluginsLoaded(function (): boolean {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function isValid() {\n let isValid;\n\n try {\n isValid = __cadesAsyncToken__ + cadesCertificate.IsValid();\n isValid = __cadesAsyncToken__ + isValid.Result;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при проверке сертификата');\n }\n\n return Boolean(isValid);\n }),\n );\n});\n","export const _extractCommonName = (subjectName: string): string | undefined =>\n subjectName.match(/CN=(.+?)(?:,|$)/)?.[1];\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { _isSupportedCadesVersion } from '../helpers/_isSupportedCadesVersion';\nimport { _isSupportedCSPVersion } from '../helpers/_isSupportedCSPVersion';\nimport { getSystemInfo, SystemInfo } from './getSystemInfo';\n\n/**\n * Проверяет корректность настроек ЭП на машине\n *\n * @returns флаг корректности настроек\n */\nexport const isValidSystemSetup = _afterPluginsLoaded(\n async (): Promise => {\n let systemInfo: SystemInfo;\n\n try {\n systemInfo = await getSystemInfo();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Настройки ЭП на данной машине не верны');\n }\n\n if (!_isSupportedCadesVersion(systemInfo.cadesVersion)) {\n throw new Error('Не поддерживаемая версия плагина');\n }\n\n if (!_isSupportedCSPVersion(systemInfo.cspVersion)) {\n throw new Error('Не поддерживаемая версия CSP');\n }\n\n return true;\n },\n);\n","export const _isSupportedCadesVersion = (version: string): boolean => {\n const match = version.match(/(\\d+)\\.(\\d+)\\.(\\d+)/);\n\n if (!match) {\n return false;\n }\n\n const [, major, minor, patch] = match;\n\n if (Number(major) < 2) {\n return false;\n }\n\n if (Number(major) === 2 && Number(patch) < 12438) {\n return false;\n }\n\n return true;\n};\n","const oldestSupportedCSPVersion = 4.0;\n\nexport const _isSupportedCSPVersion = (version: string): boolean => {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/)?.[0];\n\n return Number(version) >= oldestSupportedCSPVersion;\n};\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Создает подпись base64 строки по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param dataBase64 - строковые данные в формате base64\n * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false)\n * @returns подпись\n */\nexport const createSignature = _afterPluginsLoaded(\n async (thumbprint: string, dataBase64: string, detachedSignature: boolean = true): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function signData(): string {\n let cadesAttrs;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesSignedData.propset_Content(dataBase64));\n void (\n __cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n signature =\n __cadesAsyncToken__ +\n cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_CADES_BES, detachedSignature);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { CadesCertificate } from '../api/certificate';\nimport { _afterPluginsLoaded } from './_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from './_generateCadesFn';\n\n/**\n * Возвращает сертификат в формате Cades по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат в формате Cades\n */\nexport const _getCadesCert = _afterPluginsLoaded(\n (thumbprint: string): CadesCertificate => {\n const { cadesplugin } = window;\n\n return eval(\n _generateCadesFn(function _getCadesCert() {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n if (!cadesStore) {\n throw new Error('Не удалось получить доступ к хранилищу сертификатов');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificateList;\n let certificatesCount;\n\n try {\n cadesCertificateList = __cadesAsyncToken__ + cadesStore.Certificates;\n certificatesCount = __cadesAsyncToken__ + cadesCertificateList.Count;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!certificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n let cadesCertificate: CadesCertificate;\n\n try {\n cadesCertificateList =\n __cadesAsyncToken__ + cadesCertificateList.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint);\n\n const count = __cadesAsyncToken__ + cadesCertificateList.Count;\n\n if (!count) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n cadesCertificate = __cadesAsyncToken__ + cadesCertificateList.Item(1);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата');\n }\n\n cadesStore.Close();\n\n return cadesCertificate;\n }),\n );\n },\n);\n","/**\n * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера.\n *\n * В IE необходимо использовать специфичный формат \"VT_DATE\"\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate\n */\nexport const _getDateObj = (dateObj): Date => (dateObj.getVarDate ? dateObj.getVarDate() : dateObj);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/helpers/_afterPluginsLoaded.d.ts b/dist/helpers/_afterPluginsLoaded.d.ts new file mode 100644 index 0000000..bea0be7 --- /dev/null +++ b/dist/helpers/_afterPluginsLoaded.d.ts @@ -0,0 +1,3 @@ +declare type Unpromisify = T extends Promise ? R : T; +export declare const _afterPluginsLoaded: any>(fn: T) => (...args: Parameters) => Promise>>; +export {}; diff --git a/dist/helpers/_extractCommonName.d.ts b/dist/helpers/_extractCommonName.d.ts new file mode 100644 index 0000000..25df5a9 --- /dev/null +++ b/dist/helpers/_extractCommonName.d.ts @@ -0,0 +1 @@ +export declare const _extractCommonName: (subjectName: string) => string; diff --git a/dist/helpers/_extractMeaningfulErrorMessage.d.ts b/dist/helpers/_extractMeaningfulErrorMessage.d.ts new file mode 100644 index 0000000..827d8d9 --- /dev/null +++ b/dist/helpers/_extractMeaningfulErrorMessage.d.ts @@ -0,0 +1 @@ +export declare const _extractMeaningfulErrorMessage: (error: Error) => string; diff --git a/dist/helpers/_generateCadesFn.d.ts b/dist/helpers/_generateCadesFn.d.ts new file mode 100644 index 0000000..b229e00 --- /dev/null +++ b/dist/helpers/_generateCadesFn.d.ts @@ -0,0 +1,3 @@ +export declare const __cadesAsyncToken__: {}; +export declare const __createCadesPluginObject__: (...args: any[]) => any; +export declare const _generateCadesFn: (callback: Function) => string; diff --git a/dist/helpers/_getCadesCert.d.ts b/dist/helpers/_getCadesCert.d.ts new file mode 100644 index 0000000..ec08b1c --- /dev/null +++ b/dist/helpers/_getCadesCert.d.ts @@ -0,0 +1,7 @@ +/** + * Возвращает сертификат в формате Cades по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат в формате Cades + */ +export declare const _getCadesCert: (thumbprint: string) => Promise; diff --git a/dist/helpers/_getDateObj.d.ts b/dist/helpers/_getDateObj.d.ts new file mode 100644 index 0000000..045929d --- /dev/null +++ b/dist/helpers/_getDateObj.d.ts @@ -0,0 +1,7 @@ +/** + * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера. + * + * В IE необходимо использовать специфичный формат "VT_DATE" + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate + */ +export declare const _getDateObj: (dateObj: any) => Date; diff --git a/dist/helpers/_isSupportedCSPVersion.d.ts b/dist/helpers/_isSupportedCSPVersion.d.ts new file mode 100644 index 0000000..2c28293 --- /dev/null +++ b/dist/helpers/_isSupportedCSPVersion.d.ts @@ -0,0 +1 @@ +export declare const _isSupportedCSPVersion: (version: string) => boolean; diff --git a/dist/helpers/_isSupportedCadesVersion.d.ts b/dist/helpers/_isSupportedCadesVersion.d.ts new file mode 100644 index 0000000..8e0be50 --- /dev/null +++ b/dist/helpers/_isSupportedCadesVersion.d.ts @@ -0,0 +1 @@ +export declare const _isSupportedCadesVersion: (version: string) => boolean; diff --git a/dist/helpers/_parseCertInfo.d.ts b/dist/helpers/_parseCertInfo.d.ts new file mode 100644 index 0000000..59edf42 --- /dev/null +++ b/dist/helpers/_parseCertInfo.d.ts @@ -0,0 +1,14 @@ +import { TagsTranslations } from '../constants/tags-translations'; +export interface TagTranslation { + description: string; + title: string; + isTranslated: boolean; +} +/** + * Парсит информацию из строки с информацией о сертификате + * + * @param tagsTranslations - словарь с расшифровками тэгов + * @param rawInfo - данные для парсинга + * @returns расшифрованная информация по отдельным тэгам + */ +export declare const _parseCertInfo: (tagsTranslations: TagsTranslations[], rawInfo: string) => TagTranslation[]; diff --git a/lib/api/certificate/certificate.d.ts b/lib/api/certificate/certificate.d.ts new file mode 100644 index 0000000..5bddd6b --- /dev/null +++ b/lib/api/certificate/certificate.d.ts @@ -0,0 +1,22 @@ +import { TagTranslation } from '../../helpers/_parseCertInfo'; +import { ExtendedKeysTranslations } from './getDecodedExtendedKeyUsage'; +export declare type CadesCertificate = any; +export declare class Certificate { + _cadesCertificate: CadesCertificate; + name: string; + issuerName: string; + subjectName: string; + thumbprint: string; + validFrom: string; + validTo: string; + constructor(_cadesCertificate: CadesCertificate, name: string, issuerName: string, subjectName: string, thumbprint: string, validFrom: string, validTo: string); + getOwnerInfo(): Promise; + getIssuerInfo(): Promise; + getExtendedKeyUsage(): Promise; + getDecodedExtendedKeyUsage(): Promise; + getAlgorithm(): Promise; + getCadesProp(propName: any): Promise; + isValid(): Promise; + exportBase64(): Promise; + hasExtendedKeyUsage(oids: any): Promise; +} diff --git a/lib/api/certificate/exportBase64.d.ts b/lib/api/certificate/exportBase64.d.ts new file mode 100644 index 0000000..e531560 --- /dev/null +++ b/lib/api/certificate/exportBase64.d.ts @@ -0,0 +1,6 @@ +/** + * Экспортирует сертификат в формате base64 + * + * @returns сертификат в формате base64 + */ +export declare const exportBase64: () => Promise; diff --git a/lib/api/certificate/getAlgorithm.d.ts b/lib/api/certificate/getAlgorithm.d.ts new file mode 100644 index 0000000..79f94da --- /dev/null +++ b/lib/api/certificate/getAlgorithm.d.ts @@ -0,0 +1,11 @@ +interface AlgorithmInfo { + algorithm: string; + oid: string; +} +/** + * Возвращает информацию об алгоритме сертификата + * + * @returns информацию об алгоритме и его OID'е + */ +export declare const getAlgorithm: () => Promise; +export {}; diff --git a/lib/api/certificate/getCadesProp.d.ts b/lib/api/certificate/getCadesProp.d.ts new file mode 100644 index 0000000..0ff1c59 --- /dev/null +++ b/lib/api/certificate/getCadesProp.d.ts @@ -0,0 +1,7 @@ +/** + * Возвращает указанное внутренее свойство у сертификата в формате Cades + * + * @param propName = наименование свойства + * @returns значение запрошенного свойства + */ +export declare const getCadesProp: (propName: string) => Promise; diff --git a/lib/api/certificate/getDecodedExtendedKeyUsage.d.ts b/lib/api/certificate/getDecodedExtendedKeyUsage.d.ts new file mode 100644 index 0000000..478f67b --- /dev/null +++ b/lib/api/certificate/getDecodedExtendedKeyUsage.d.ts @@ -0,0 +1,9 @@ +export interface ExtendedKeysTranslations { + [key: string]: string | null; +} +/** + * Возвращает расшифрованные ОИД'ы сертификата + * + * @returns словарь расшифрованных ОИД'ов + */ +export declare const getDecodedExtendedKeyUsage: () => Promise; diff --git a/lib/api/certificate/getExtendedKeyUsage.d.ts b/lib/api/certificate/getExtendedKeyUsage.d.ts new file mode 100644 index 0000000..fe83e38 --- /dev/null +++ b/lib/api/certificate/getExtendedKeyUsage.d.ts @@ -0,0 +1,6 @@ +/** + * Возвращает ОИД'ы сертификата + * + * @returns список ОИД'ов + */ +export declare const getExtendedKeyUsage: () => Promise; diff --git a/lib/api/certificate/getInfo.d.ts b/lib/api/certificate/getInfo.d.ts new file mode 100644 index 0000000..84a34b4 --- /dev/null +++ b/lib/api/certificate/getInfo.d.ts @@ -0,0 +1,10 @@ +import { TagsTranslations } from '../../constants/tags-translations'; +import { TagTranslation } from '../../helpers/_parseCertInfo'; +/** + * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам + * + * @param tags = словарь + * @param entitiesPath = путь к разбираемой сущности + * @returns расшифрованная информация по отдельным тэгам + */ +export declare const getInfo: (tags: TagsTranslations[], entitiesPath: string) => Promise; diff --git a/lib/api/certificate/hasExtendedKeyUsage.d.ts b/lib/api/certificate/hasExtendedKeyUsage.d.ts new file mode 100644 index 0000000..dbd41ef --- /dev/null +++ b/lib/api/certificate/hasExtendedKeyUsage.d.ts @@ -0,0 +1,7 @@ +/** + * Проверяет наличие ОИД'а (ОИД'ов) у сертификата + * + * @param oids - ОИД'ы для проверки + * @returns флаг наличия ОИД'ов у сертификата + */ +export declare const hasExtendedKeyUsage: (oids: string | string[]) => Promise; diff --git a/lib/api/certificate/index.d.ts b/lib/api/certificate/index.d.ts new file mode 100644 index 0000000..cea7596 --- /dev/null +++ b/lib/api/certificate/index.d.ts @@ -0,0 +1 @@ +export * from './certificate'; diff --git a/lib/api/certificate/isValid.d.ts b/lib/api/certificate/isValid.d.ts new file mode 100644 index 0000000..69814c8 --- /dev/null +++ b/lib/api/certificate/isValid.d.ts @@ -0,0 +1,6 @@ +/** + * Проверяет действительность сертификата + * + * @returns флаг валидности + */ +export declare const isValid: () => Promise; diff --git a/lib/api/createSignature.d.ts b/lib/api/createSignature.d.ts new file mode 100644 index 0000000..29bc69e --- /dev/null +++ b/lib/api/createSignature.d.ts @@ -0,0 +1,9 @@ +/** + * Создает подпись base64 строки по отпечатку сертификата + * + * @param thumbprint - отпечаток сертификата + * @param dataBase64 - строковые данные в формате base64 + * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false) + * @returns подпись + */ +export declare const createSignature: (thumbprint: string, dataBase64: string, detachedSignature?: boolean) => Promise; diff --git a/lib/api/getCertificate.d.ts b/lib/api/getCertificate.d.ts new file mode 100644 index 0000000..8213f30 --- /dev/null +++ b/lib/api/getCertificate.d.ts @@ -0,0 +1,8 @@ +import { Certificate } from './certificate'; +/** + * Возвращает сертификат по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат + */ +export declare const getCertificate: (thumbprint: string) => Promise; diff --git a/lib/api/getSystemInfo.d.ts b/lib/api/getSystemInfo.d.ts new file mode 100644 index 0000000..9d39042 --- /dev/null +++ b/lib/api/getSystemInfo.d.ts @@ -0,0 +1,10 @@ +export interface SystemInfo { + cadesVersion: string; + cspVersion: string; +} +/** + * Предоставляет информацию о системе + * + * @returns информацию о CSP и плагине + */ +export declare const getSystemInfo: () => Promise; diff --git a/lib/api/getUserCertificates.d.ts b/lib/api/getUserCertificates.d.ts new file mode 100644 index 0000000..571f403 --- /dev/null +++ b/lib/api/getUserCertificates.d.ts @@ -0,0 +1,8 @@ +import { Certificate } from './certificate'; +/** + * Возвращает список сертификатов, доступных пользователю в системе + * + * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов + * @returns список сертификатов + */ +export declare const getUserCertificates: (resetCache?: boolean) => Promise; diff --git a/lib/api/index.d.ts b/lib/api/index.d.ts new file mode 100644 index 0000000..2fd4070 --- /dev/null +++ b/lib/api/index.d.ts @@ -0,0 +1,6 @@ +export * from './getCertificate'; +export * from './getUserCertificates'; +export * from './getSystemInfo'; +export * from './isValidSystemSetup'; +export * from './createSignature'; +export * from './certificate'; diff --git a/lib/api/isValidSystemSetup.d.ts b/lib/api/isValidSystemSetup.d.ts new file mode 100644 index 0000000..5b3afaf --- /dev/null +++ b/lib/api/isValidSystemSetup.d.ts @@ -0,0 +1,6 @@ +/** + * Проверяет корректность настроек ЭП на машине + * + * @returns флаг корректности настроек + */ +export declare const isValidSystemSetup: () => Promise; diff --git a/lib/constants/cades-constants.d.ts b/lib/constants/cades-constants.d.ts new file mode 100644 index 0000000..8e36560 --- /dev/null +++ b/lib/constants/cades-constants.d.ts @@ -0,0 +1,149 @@ +export declare const CADESCOM_ATTRIBUTE_OTHER = -1; +export declare const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +export declare const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +export declare const CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +export declare const CADESCOM_AllowNoOutstandingRequest = 1; +export declare const CADESCOM_AllowNone = 0; +export declare const CADESCOM_AllowUntrustedCertificate = 2; +export declare const CADESCOM_AllowUntrustedRoot = 4; +export declare const CADESCOM_BASE64_TO_BINARY = 1; +export declare const CADESCOM_CADES_BES = 1; +export declare const CADESCOM_CADES_DEFAULT = 0; +export declare const CADESCOM_CADES_T = 5; +export declare const CADESCOM_CADES_X_LONG_TYPE_1 = 93; +export declare const CADESCOM_CONTAINER_STORE = 100; +export declare const CADESCOM_CURRENT_USER_STORE = 2; +export declare const CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2; +export declare const CADESCOM_DISPLAY_DATA_CONTENT = 1; +export declare const CADESCOM_DISPLAY_DATA_NONE = 0; +export declare const CADESCOM_ENCODE_ANY = -1; +export declare const CADESCOM_ENCODE_BASE64 = 0; +export declare const CADESCOM_ENCODE_BINARY = 1; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0; +export declare const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112; +export declare const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110; +export declare const CADESCOM_HASH_ALGORITHM_MD2 = 1; +export declare const CADESCOM_HASH_ALGORITHM_MD4 = 2; +export declare const CADESCOM_HASH_ALGORITHM_MD5 = 3; +export declare const CADESCOM_HASH_ALGORITHM_SHA1 = 0; +export declare const CADESCOM_HASH_ALGORITHM_SHA_256 = 4; +export declare const CADESCOM_HASH_ALGORITHM_SHA_384 = 5; +export declare const CADESCOM_HASH_ALGORITHM_SHA_512 = 6; +export declare const CADESCOM_LOCAL_MACHINE_STORE = 1; +export declare const CADESCOM_PKCS7_TYPE = 65535; +export declare const CADESCOM_STRING_TO_UCS2LE = 0; +export declare const CADESCOM_SkipInstallToStore = 268435456; +export declare const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0; +export declare const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1; +export declare const CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2; +export declare const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3; +export declare const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +export declare const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +export declare const CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +export declare const CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7; +export declare const CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8; +export declare const CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6; +export declare const CAPICOM_CERTIFICATE_FIND_EXTENSION = 5; +export declare const CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2; +export declare const CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12; +export declare const CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3; +export declare const CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0; +export declare const CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; +export declare const CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4; +export declare const CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11; +export declare const CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10; +export declare const CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9; +export declare const CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0; +export declare const CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2; +export declare const CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1; +export declare const CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1; +export declare const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0; +export declare const CAPICOM_CURRENT_USER_STORE = 2; +export declare const CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128; +export declare const CAPICOM_EKU_CLIENT_AUTH = 2; +export declare const CAPICOM_EKU_OTHER = 0; +export declare const CAPICOM_EKU_SMARTCARD_LOGON = 5; +export declare const CAPICOM_LOCAL_MACHINE_STORE = 1; +export declare const CAPICOM_MEMORY_STORE = 0; +export declare const CAPICOM_MY_STORE = "My"; +export declare const CAPICOM_OID_KEY_USAGE_EXTENSION = 10; +export declare const CAPICOM_OID_OTHER = 0; +export declare const CAPICOM_PROPID_ACCESS_STATE = 14; +export declare const CAPICOM_PROPID_ARCHIVED = 19; +export declare const CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65; +export declare const CAPICOM_PROPID_AUTO_ENROLL = 21; +export declare const CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23; +export declare const CAPICOM_PROPID_CTL_USAGE = 9; +export declare const CAPICOM_PROPID_DATE_STAMP = 27; +export declare const CAPICOM_PROPID_DESCRIPTION = 13; +export declare const CAPICOM_PROPID_EFS = 17; +export declare const CAPICOM_PROPID_ENHKEY_USAGE = 9; +export declare const CAPICOM_PROPID_ENROLLMENT = 26; +export declare const CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30; +export declare const CAPICOM_PROPID_FIRST_RESERVED = 66; +export declare const CAPICOM_PROPID_FIRST_USER = 32768; +export declare const CAPICOM_PROPID_FORTEZZA_DATA = 18; +export declare const CAPICOM_PROPID_FRIENDLY_NAME = 11; +export declare const CAPICOM_PROPID_HASH_PROP = 3; +export declare const CAPICOM_PROPID_IE30_RESERVED = 7; +export declare const CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24; +export declare const CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28; +export declare const CAPICOM_PROPID_KEY_CONTEXT = 5; +export declare const CAPICOM_PROPID_KEY_IDENTIFIER = 20; +export declare const CAPICOM_PROPID_KEY_PROV_HANDLE = 1; +export declare const CAPICOM_PROPID_KEY_PROV_INFO = 2; +export declare const CAPICOM_PROPID_KEY_SPEC = 6; +export declare const CAPICOM_PROPID_LAST_RESERVED = 32767; +export declare const CAPICOM_PROPID_LAST_USER = 65535; +export declare const CAPICOM_PROPID_MD5_HASH = 4; +export declare const CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10; +export declare const CAPICOM_PROPID_PUBKEY_ALG_PARA = 22; +export declare const CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8; +export declare const CAPICOM_PROPID_PVK_FILE = 12; +export declare const CAPICOM_PROPID_RENEWAL = 64; +export declare const CAPICOM_PROPID_SHA1_HASH = 3; +export declare const CAPICOM_PROPID_SIGNATURE_HASH = 15; +export declare const CAPICOM_PROPID_SMART_CARD_DATA = 16; +export declare const CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29; +export declare const CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25; +export declare const CAPICOM_PROPID_UNKNOWN = 0; +export declare const CAPICOM_SMART_CARD_USER_STORE = 4; +export declare const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128; +export declare const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256; +export declare const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; +export declare const CAPICOM_STORE_OPEN_READ_ONLY = 0; +export declare const CAPICOM_STORE_OPEN_READ_WRITE = 1; +export declare const CHECK_NONE = 0; +export declare const CHECK_OFFLINE_REVOCATION_STATUS = 16; +export declare const CHECK_ONLINE_REVOCATION_STATUS = 8; +export declare const CHECK_SIGNATURE_VALIDITY = 4; +export declare const CHECK_TIME_VALIDITY = 2; +export declare const CHECK_TRUSTED_ROOT = 1; +export declare const LOG_LEVEL_DEBUG = 4; +export declare const LOG_LEVEL_ERROR = 1; +export declare const LOG_LEVEL_INFO = 2; +export declare const TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144; +export declare const TRUST_CTL_IS_NOT_TIME_VALID = 131072; +export declare const TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288; +export declare const TRUST_IS_CYCLIC = 128; +export declare const TRUST_IS_NOT_SIGNATURE_VALID = 8; +export declare const TRUST_IS_NOT_TIME_NESTED = 2; +export declare const TRUST_IS_NOT_TIME_VALID = 1; +export declare const TRUST_IS_NOT_VALID_FOR_USAGE = 16; +export declare const TRUST_IS_PARTIAL_CHAIN = 65536; +export declare const TRUST_IS_REVOKED = 4; +export declare const TRUST_IS_UNTRUSTED_ROOT = 32; +export declare const TRUST_REVOCATION_STATUS_UNKNOWN = 64; +export declare const XmlDsigGost3410Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411"; +export declare const XmlDsigGost3410UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411"; +export declare const XmlDsigGost3411Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411"; +export declare const XmlDsigGost3411UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr3411"; diff --git a/lib/constants/index.d.ts b/lib/constants/index.d.ts new file mode 100644 index 0000000..4f7f7dd --- /dev/null +++ b/lib/constants/index.d.ts @@ -0,0 +1,4 @@ +export * from './cades-constants'; +export * from './issuer-tags-translations'; +export * from './oids-dictionary'; +export * from './subject-tags-translations'; diff --git a/lib/constants/issuer-tags-translations.d.ts b/lib/constants/issuer-tags-translations.d.ts new file mode 100644 index 0000000..12e0f7d --- /dev/null +++ b/lib/constants/issuer-tags-translations.d.ts @@ -0,0 +1,2 @@ +import { TagsTranslations } from './tags-translations'; +export declare const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[]; diff --git a/lib/constants/oids-dictionary.d.ts b/lib/constants/oids-dictionary.d.ts new file mode 100644 index 0000000..cedee7d --- /dev/null +++ b/lib/constants/oids-dictionary.d.ts @@ -0,0 +1,44 @@ +export declare const OIDS_DICTIONARY: { + '1.2.643.2.2.34.6': string; + '1.2.643.2.39.1.1': string; + '1.2.643.3.131.1.1': string; + '1.2.643.3.141.1.1': string; + '1.2.643.3.141.1.2': string; + '1.2.643.3.2.100.65.13.11': string; + '1.2.643.3.8.100.1': string; + '1.2.643.3.8.100.1.1': string; + '1.2.643.3.8.100.1.10': string; + '1.2.643.3.8.100.1.11': string; + '1.2.643.3.8.100.1.12': string; + '1.2.643.3.8.100.1.13': string; + '1.2.643.3.8.100.1.14': string; + '1.2.643.3.8.100.1.2': string; + '1.2.643.3.8.100.1.3': string; + '1.2.643.3.8.100.1.4': string; + '1.2.643.3.8.100.1.5': string; + '1.2.643.3.8.100.1.6': string; + '1.2.643.3.8.100.1.7': string; + '1.2.643.3.8.100.1.8': string; + '1.2.643.3.8.100.1.9': string; + '1.2.643.5.1.24.2.1.3': string; + '1.2.643.5.1.24.2.1.3.1': string; + '1.2.643.5.1.24.2.2.2': string; + '1.2.643.5.1.24.2.2.3': string; + '1.2.643.6.2.1.7.1': string; + '1.2.643.6.2.1.7.2': string; + '1.2.643.6.3': string; + '1.2.643.6.3.1.1': string; + '1.2.643.6.3.1.2.1': string; + '1.2.643.6.3.1.2.2': string; + '1.2.643.6.3.1.2.3': string; + '1.2.643.6.3.1.3.1': string; + '1.2.643.6.3.1.4.1': string; + '1.2.643.6.3.1.4.2': string; + '1.2.643.6.3.1.4.3': string; + '1.2.840.113549.1.9.2': string; + '1.3.6.1.4.1.24138.1.1.8.1': string; + '1.3.6.1.4.1.29919.21': string; + '1.3.6.1.5.5.7.3.2': string; + '1.3.6.1.5.5.7.3.4': string; + '1.3.643.3.8.100.15': string; +}; diff --git a/lib/constants/subject-tags-translations.d.ts b/lib/constants/subject-tags-translations.d.ts new file mode 100644 index 0000000..0a4a6c2 --- /dev/null +++ b/lib/constants/subject-tags-translations.d.ts @@ -0,0 +1,2 @@ +import { TagsTranslations } from './tags-translations'; +export declare const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[]; diff --git a/lib/constants/tags-translations.d.ts b/lib/constants/tags-translations.d.ts new file mode 100644 index 0000000..5c791bd --- /dev/null +++ b/lib/constants/tags-translations.d.ts @@ -0,0 +1,4 @@ +export interface TagsTranslations { + possibleNames: string[]; + translation: string; +} diff --git a/lib/crypto-pro.d.ts b/lib/crypto-pro.d.ts new file mode 100644 index 0000000..21bbbb8 --- /dev/null +++ b/lib/crypto-pro.d.ts @@ -0,0 +1,5 @@ +// Type definitions for crypto-pro 2.0.0 +// Project: crypto-pro +// Definitions by: Vitalii Goma https://github.com/vgoma + +export * from './api'; diff --git a/lib/crypto-pro.js b/lib/crypto-pro.js new file mode 100644 index 0000000..84cb093 --- /dev/null +++ b/lib/crypto-pro.js @@ -0,0 +1,2257 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("cryptoPro", [], factory); + else if(typeof exports === 'object') + exports["cryptoPro"] = factory(); + else + root["cryptoPro"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./crypto-pro.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./api/certificate/certificate.ts": +/*!****************************************!*\ + !*** ./api/certificate/certificate.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const constants_1 = __webpack_require__(/*! ../../constants */ "./constants/index.ts"); +const exportBase64_1 = __webpack_require__(/*! ./exportBase64 */ "./api/certificate/exportBase64.ts"); +const getAlgorithm_1 = __webpack_require__(/*! ./getAlgorithm */ "./api/certificate/getAlgorithm.ts"); +const getCadesProp_1 = __webpack_require__(/*! ./getCadesProp */ "./api/certificate/getCadesProp.ts"); +const getDecodedExtendedKeyUsage_1 = __webpack_require__(/*! ./getDecodedExtendedKeyUsage */ "./api/certificate/getDecodedExtendedKeyUsage.ts"); +const getExtendedKeyUsage_1 = __webpack_require__(/*! ./getExtendedKeyUsage */ "./api/certificate/getExtendedKeyUsage.ts"); +const getInfo_1 = __webpack_require__(/*! ./getInfo */ "./api/certificate/getInfo.ts"); +const hasExtendedKeyUsage_1 = __webpack_require__(/*! ./hasExtendedKeyUsage */ "./api/certificate/hasExtendedKeyUsage.ts"); +const isValid_1 = __webpack_require__(/*! ./isValid */ "./api/certificate/isValid.ts"); +class Certificate { + constructor(_cadesCertificate, name, issuerName, subjectName, thumbprint, validFrom, validTo) { + this._cadesCertificate = _cadesCertificate; + this.name = name; + this.issuerName = issuerName; + this.subjectName = subjectName; + this.thumbprint = thumbprint; + this.validFrom = validFrom; + this.validTo = validTo; + } + getOwnerInfo() { + return getInfo_1.getInfo.call(this, constants_1.SUBJECT_TAGS_TRANSLATIONS, 'SubjectName'); + } + getIssuerInfo() { + return getInfo_1.getInfo.call(this, constants_1.ISSUER_TAGS_TRANSLATIONS, 'IssuerName'); + } + getExtendedKeyUsage() { + return getExtendedKeyUsage_1.getExtendedKeyUsage.call(this); + } + getDecodedExtendedKeyUsage() { + return getDecodedExtendedKeyUsage_1.getDecodedExtendedKeyUsage.call(this); + } + getAlgorithm() { + return getAlgorithm_1.getAlgorithm.call(this); + } + getCadesProp(propName) { + return getCadesProp_1.getCadesProp.call(this, propName); + } + isValid() { + return isValid_1.isValid.call(this); + } + exportBase64() { + return exportBase64_1.exportBase64.call(this); + } + hasExtendedKeyUsage(oids) { + return hasExtendedKeyUsage_1.hasExtendedKeyUsage.call(this, oids); + } +} +exports.Certificate = Certificate; + + +/***/ }), + +/***/ "./api/certificate/exportBase64.ts": +/*!*****************************************!*\ + !*** ./api/certificate/exportBase64.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Экспортирует сертификат в формате base64 + * + * @returns сертификат в формате base64 + */ +exports.exportBase64 = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + const cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function exportBase64() { + let base64; + try { + base64 = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.Export(0); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при экспорте сертификата'); + } + return base64; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getAlgorithm.ts": +/*!*****************************************!*\ + !*** ./api/certificate/getAlgorithm.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает информацию об алгоритме сертификата + * + * @returns информацию об алгоритме и его OID'е + */ +exports.getAlgorithm = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + const cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function getAlgorithm() { + const algorithmInfo = { + algorithm: null, + oid: null, + }; + let cadesPublicKey; + try { + cadesPublicKey = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.PublicKey(); + cadesPublicKey = _generateCadesFn_1.__cadesAsyncToken__ + cadesPublicKey.Algorithm; + algorithmInfo.algorithm = _generateCadesFn_1.__cadesAsyncToken__ + cadesPublicKey.FriendlyName; + algorithmInfo.oid = _generateCadesFn_1.__cadesAsyncToken__ + cadesPublicKey.Value; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при получении алгоритма'); + } + return algorithmInfo; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getCadesProp.ts": +/*!*****************************************!*\ + !*** ./api/certificate/getCadesProp.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает указанное внутренее свойство у сертификата в формате Cades + * + * @param propName = наименование свойства + * @returns значение запрошенного свойства + */ +exports.getCadesProp = _afterPluginsLoaded_1._afterPluginsLoaded(function (propName) { + const cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function getCadesProp() { + let propertyValue; + try { + propertyValue = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate[propName]; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при обращении к свойству сертификата'); + } + return propertyValue; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getDecodedExtendedKeyUsage.ts": +/*!*******************************************************!*\ + !*** ./api/certificate/getDecodedExtendedKeyUsage.ts ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const constants_1 = __webpack_require__(/*! ../../constants */ "./constants/index.ts"); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +/** + * Возвращает расшифрованные ОИД'ы сертификата + * + * @returns словарь расшифрованных ОИД'ов + */ +exports.getDecodedExtendedKeyUsage = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + return __awaiter(this, void 0, void 0, function* () { + const certificateOids = yield this.getExtendedKeyUsage(); + return certificateOids.reduce((decodedOids, oidCode) => (Object.assign(Object.assign({}, decodedOids), { [oidCode]: constants_1.OIDS_DICTIONARY[oidCode] || null })), {}); + }); +}); + + +/***/ }), + +/***/ "./api/certificate/getExtendedKeyUsage.ts": +/*!************************************************!*\ + !*** ./api/certificate/getExtendedKeyUsage.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает ОИД'ы сертификата + * + * @returns список ОИД'ов + */ +exports.getExtendedKeyUsage = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + const cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function getExtendedKeyUsage() { + const OIDS = []; + let count; + try { + count = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage(); + count = _generateCadesFn_1.__cadesAsyncToken__ + count.EKUs; + count = _generateCadesFn_1.__cadesAsyncToken__ + count.Count; + if (count > 0) { + while (count > 0) { + let cadesExtendedKeyUsage; + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage(); + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesExtendedKeyUsage.EKUs; + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesExtendedKeyUsage.Item(count); + cadesExtendedKeyUsage = _generateCadesFn_1.__cadesAsyncToken__ + cadesExtendedKeyUsage.OID; + OIDS.push(cadesExtendedKeyUsage); + count--; + } + } + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || "Ошибка при получении ОИД'ов"); + } + return OIDS; + })); +}); + + +/***/ }), + +/***/ "./api/certificate/getInfo.ts": +/*!************************************!*\ + !*** ./api/certificate/getInfo.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _parseCertInfo_1 = __webpack_require__(/*! ../../helpers/_parseCertInfo */ "./helpers/_parseCertInfo.ts"); +const getCadesProp_1 = __webpack_require__(/*! ./getCadesProp */ "./api/certificate/getCadesProp.ts"); +/** + * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам + * + * @param tags = словарь + * @param entitiesPath = путь к разбираемой сущности + * @returns расшифрованная информация по отдельным тэгам + */ +exports.getInfo = _afterPluginsLoaded_1._afterPluginsLoaded(function (tags, entitiesPath) { + return __awaiter(this, void 0, void 0, function* () { + let entities; + try { + entities = yield getCadesProp_1.getCadesProp.call(this, entitiesPath); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при извлечении информации из сертификата'); + } + return _parseCertInfo_1._parseCertInfo(tags, entities); + }); +}); + + +/***/ }), + +/***/ "./api/certificate/hasExtendedKeyUsage.ts": +/*!************************************************!*\ + !*** ./api/certificate/hasExtendedKeyUsage.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +/** + * Проверяет наличие ОИД'а (ОИД'ов) у сертификата + * + * @param oids - ОИД'ы для проверки + * @returns флаг наличия ОИД'ов у сертификата + */ +exports.hasExtendedKeyUsage = _afterPluginsLoaded_1._afterPluginsLoaded(function (oids) { + return __awaiter(this, void 0, void 0, function* () { + const certOids = yield this.getExtendedKeyUsage(); + let result; + if (Array.isArray(oids)) { + result = oids.every((oidToCheck) => certOids.some((certOid) => certOid === oidToCheck)); + } + else { + result = certOids.some((certOid) => certOid === oids); + } + return result; + }); +}); + + +/***/ }), + +/***/ "./api/certificate/index.ts": +/*!**********************************!*\ + !*** ./api/certificate/index.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./certificate */ "./api/certificate/certificate.ts")); + + +/***/ }), + +/***/ "./api/certificate/isValid.ts": +/*!************************************!*\ + !*** ./api/certificate/isValid.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Проверяет действительность сертификата + * + * @returns флаг валидности + */ +exports.isValid = _afterPluginsLoaded_1._afterPluginsLoaded(function () { + const cadesCertificate = this._cadesCertificate; + return eval(_generateCadesFn_1._generateCadesFn(function isValid() { + let isValid; + try { + isValid = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.IsValid(); + isValid = _generateCadesFn_1.__cadesAsyncToken__ + isValid.Result; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при проверке сертификата'); + } + return Boolean(isValid); + })); +}); + + +/***/ }), + +/***/ "./api/createSignature.ts": +/*!********************************!*\ + !*** ./api/createSignature.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const constants_1 = __webpack_require__(/*! ../constants */ "./constants/index.ts"); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +const _getCadesCert_1 = __webpack_require__(/*! ../helpers/_getCadesCert */ "./helpers/_getCadesCert.ts"); +const _getDateObj_1 = __webpack_require__(/*! ../helpers/_getDateObj */ "./helpers/_getDateObj.ts"); +/** + * Создает подпись base64 строки по отпечатку сертификата + * + * @param thumbprint - отпечаток сертификата + * @param dataBase64 - строковые данные в формате base64 + * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false) + * @returns подпись + */ +exports.createSignature = _afterPluginsLoaded_1._afterPluginsLoaded((thumbprint, dataBase64, detachedSignature = true) => __awaiter(void 0, void 0, void 0, function* () { + const { cadesplugin } = window; + const cadesCertificate = yield _getCadesCert_1._getCadesCert(thumbprint); + return eval(_generateCadesFn_1._generateCadesFn(function signData() { + let cadesAttrs; + let cadesSignedData; + let cadesSigner; + try { + cadesAttrs = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CADESCOM.CPAttribute'); + cadesSignedData = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.CadesSignedData'); + cadesSigner = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.CPSigner'); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи'); + } + const currentTime = _getDateObj_1._getDateObj(new Date()); + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesAttrs.propset_Name(constants_1.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи'); + } + let cadesAuthAttrs; + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate)); + cadesAuthAttrs = _generateCadesFn_1.__cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2; + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSignedData.propset_Content(dataBase64)); + void (_generateCadesFn_1.__cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи'); + } + let signature; + try { + signature = + _generateCadesFn_1.__cadesAsyncToken__ + + cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_CADES_BES, detachedSignature); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных'); + } + return signature; + })); +})); + + +/***/ }), + +/***/ "./api/getCertificate.ts": +/*!*******************************!*\ + !*** ./api/getCertificate.ts ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const getUserCertificates_1 = __webpack_require__(/*! ./getUserCertificates */ "./api/getUserCertificates.ts"); +/** + * Возвращает сертификат по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат + */ +exports.getCertificate = _afterPluginsLoaded_1._afterPluginsLoaded((thumbprint) => __awaiter(void 0, void 0, void 0, function* () { + if (!thumbprint) { + throw new Error('Отпечаток не указан'); + } + const availableCertificates = yield getUserCertificates_1.getUserCertificates(); + const foundCertificate = availableCertificates.find((cert) => cert.thumbprint === thumbprint); + if (!foundCertificate) { + throw new Error(`Сертификат с отпечатком: "${thumbprint}" не найден`); + } + return foundCertificate; +})); + + +/***/ }), + +/***/ "./api/getSystemInfo.ts": +/*!******************************!*\ + !*** ./api/getSystemInfo.ts ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Предоставляет информацию о системе + * + * @returns информацию о CSP и плагине + */ +exports.getSystemInfo = _afterPluginsLoaded_1._afterPluginsLoaded(() => { + const sysInfo = { + cadesVersion: null, + cspVersion: null, + }; + return eval(_generateCadesFn_1._generateCadesFn(function getSystemInfo() { + let cadesAbout; + try { + cadesAbout = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.About'); + sysInfo.cadesVersion = _generateCadesFn_1.__cadesAsyncToken__ + cadesAbout.PluginVersion; + sysInfo.cspVersion = _generateCadesFn_1.__cadesAsyncToken__ + cadesAbout.CSPVersion(); + if (!sysInfo.cadesVersion) { + sysInfo.cadesVersion = _generateCadesFn_1.__cadesAsyncToken__ + cadesAbout.Version; + } + sysInfo.cadesVersion = _generateCadesFn_1.__cadesAsyncToken__ + sysInfo.cadesVersion.toString(); + sysInfo.cspVersion = _generateCadesFn_1.__cadesAsyncToken__ + sysInfo.cspVersion.toString(); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при получении информации о системе'); + } + return sysInfo; + })); +}); + + +/***/ }), + +/***/ "./api/getUserCertificates.ts": +/*!************************************!*\ + !*** ./api/getUserCertificates.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const certificate_1 = __webpack_require__(/*! ./certificate */ "./api/certificate/index.ts"); +const constants_1 = __webpack_require__(/*! ../constants */ "./constants/index.ts"); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractCommonName_1 = __webpack_require__(/*! ../helpers/_extractCommonName */ "./helpers/_extractCommonName.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ../helpers/_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +let certificatesCache; +/** + * Возвращает список сертификатов, доступных пользователю в системе + * + * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов + * @returns список сертификатов + */ +exports.getUserCertificates = _afterPluginsLoaded_1._afterPluginsLoaded((resetCache = false) => { + const { cadesplugin } = window; + if (!resetCache && certificatesCache) { + return certificatesCache; + } + return eval(_generateCadesFn_1._generateCadesFn(function getCertsList() { + let cadesStore; + try { + cadesStore = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.Store'); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу'); + } + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + + cadesStore.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE, cadesplugin.CAPICOM_MY_STORE, cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища'); + } + let cadesCertificates; + let cadesCertificatesCount; + try { + cadesCertificates = _generateCadesFn_1.__cadesAsyncToken__ + cadesStore.Certificates; + if (cadesCertificates) { + cadesCertificates = + _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID); + /** + * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ + * или не действительны на данный момент + */ + cadesCertificates = + _generateCadesFn_1.__cadesAsyncToken__ + + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY, constants_1.CAPICOM_PROPID_KEY_PROV_INFO); + cadesCertificatesCount = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificates.Count; + } + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов'); + } + if (!cadesCertificatesCount) { + throw new Error('Нет доступных сертификатов'); + } + const certificateList = []; + try { + while (cadesCertificatesCount) { + const cadesCertificate = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificates.Item(cadesCertificatesCount); + certificateList.push(new certificate_1.Certificate(cadesCertificate, _extractCommonName_1._extractCommonName(_generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.SubjectName), _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.IssuerName, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.SubjectName, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.Thumbprint, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ValidFromDate, _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificate.ValidToDate)); + cadesCertificatesCount--; + } + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка обработки сертификатов'); + } + cadesStore.Close(); + certificatesCache = certificateList; + return certificatesCache; + })); +}); + + +/***/ }), + +/***/ "./api/index.ts": +/*!**********************!*\ + !*** ./api/index.ts ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./getCertificate */ "./api/getCertificate.ts")); +__export(__webpack_require__(/*! ./getUserCertificates */ "./api/getUserCertificates.ts")); +__export(__webpack_require__(/*! ./getSystemInfo */ "./api/getSystemInfo.ts")); +__export(__webpack_require__(/*! ./isValidSystemSetup */ "./api/isValidSystemSetup.ts")); +__export(__webpack_require__(/*! ./createSignature */ "./api/createSignature.ts")); +__export(__webpack_require__(/*! ./certificate */ "./api/certificate/index.ts")); + + +/***/ }), + +/***/ "./api/isValidSystemSetup.ts": +/*!***********************************!*\ + !*** ./api/isValidSystemSetup.ts ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ../helpers/_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ../helpers/_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _isSupportedCadesVersion_1 = __webpack_require__(/*! ../helpers/_isSupportedCadesVersion */ "./helpers/_isSupportedCadesVersion.ts"); +const _isSupportedCSPVersion_1 = __webpack_require__(/*! ../helpers/_isSupportedCSPVersion */ "./helpers/_isSupportedCSPVersion.ts"); +const getSystemInfo_1 = __webpack_require__(/*! ./getSystemInfo */ "./api/getSystemInfo.ts"); +/** + * Проверяет корректность настроек ЭП на машине + * + * @returns флаг корректности настроек + */ +exports.isValidSystemSetup = _afterPluginsLoaded_1._afterPluginsLoaded(() => __awaiter(void 0, void 0, void 0, function* () { + let systemInfo; + try { + systemInfo = yield getSystemInfo_1.getSystemInfo(); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Настройки ЭП на данной машине не верны'); + } + if (!_isSupportedCadesVersion_1._isSupportedCadesVersion(systemInfo.cadesVersion)) { + throw new Error('Не поддерживаемая версия плагина'); + } + if (!_isSupportedCSPVersion_1._isSupportedCSPVersion(systemInfo.cspVersion)) { + throw new Error('Не поддерживаемая версия CSP'); + } + return true; +})); + + +/***/ }), + +/***/ "./constants/cades-constants.ts": +/*!**************************************!*\ + !*** ./constants/cades-constants.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CADESCOM_ATTRIBUTE_OTHER = -1; +exports.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +exports.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +exports.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +exports.CADESCOM_AllowNoOutstandingRequest = 1; +exports.CADESCOM_AllowNone = 0; +exports.CADESCOM_AllowUntrustedCertificate = 2; +exports.CADESCOM_AllowUntrustedRoot = 4; +exports.CADESCOM_BASE64_TO_BINARY = 0x01; +exports.CADESCOM_CADES_BES = 1; +exports.CADESCOM_CADES_DEFAULT = 0; +exports.CADESCOM_CADES_T = 5; +exports.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d; +exports.CADESCOM_CONTAINER_STORE = 100; +exports.CADESCOM_CURRENT_USER_STORE = 2; +exports.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2; +exports.CADESCOM_DISPLAY_DATA_CONTENT = 1; +exports.CADESCOM_DISPLAY_DATA_NONE = 0; +exports.CADESCOM_ENCODE_ANY = -1; +exports.CADESCOM_ENCODE_BASE64 = 0; +exports.CADESCOM_ENCODE_BINARY = 1; +exports.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3; +exports.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4; +exports.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2; +exports.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25; +exports.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0; +exports.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112; +exports.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110; +exports.CADESCOM_HASH_ALGORITHM_MD2 = 1; +exports.CADESCOM_HASH_ALGORITHM_MD4 = 2; +exports.CADESCOM_HASH_ALGORITHM_MD5 = 3; +exports.CADESCOM_HASH_ALGORITHM_SHA1 = 0; +exports.CADESCOM_HASH_ALGORITHM_SHA_256 = 4; +exports.CADESCOM_HASH_ALGORITHM_SHA_384 = 5; +exports.CADESCOM_HASH_ALGORITHM_SHA_512 = 6; +exports.CADESCOM_LOCAL_MACHINE_STORE = 1; +exports.CADESCOM_PKCS7_TYPE = 65535; +exports.CADESCOM_STRING_TO_UCS2LE = 0x00; +exports.CADESCOM_SkipInstallToStore = 268435456; +exports.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0; +exports.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1; +exports.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2; +exports.CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3; +exports.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; +exports.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; +exports.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; +exports.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7; +exports.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8; +exports.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6; +exports.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5; +exports.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2; +exports.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12; +exports.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3; +exports.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0; +exports.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; +exports.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4; +exports.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11; +exports.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10; +exports.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9; +exports.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0; +exports.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2; +exports.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1; +exports.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1; +exports.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0; +exports.CAPICOM_CURRENT_USER_STORE = 2; +exports.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128; +exports.CAPICOM_EKU_CLIENT_AUTH = 2; +exports.CAPICOM_EKU_OTHER = 0; +exports.CAPICOM_EKU_SMARTCARD_LOGON = 5; +exports.CAPICOM_LOCAL_MACHINE_STORE = 1; +exports.CAPICOM_MEMORY_STORE = 0; +exports.CAPICOM_MY_STORE = 'My'; +exports.CAPICOM_OID_KEY_USAGE_EXTENSION = 10; +exports.CAPICOM_OID_OTHER = 0; +exports.CAPICOM_PROPID_ACCESS_STATE = 14; +exports.CAPICOM_PROPID_ARCHIVED = 19; +exports.CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65; +exports.CAPICOM_PROPID_AUTO_ENROLL = 21; +exports.CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23; +exports.CAPICOM_PROPID_CTL_USAGE = 9; +exports.CAPICOM_PROPID_DATE_STAMP = 27; +exports.CAPICOM_PROPID_DESCRIPTION = 13; +exports.CAPICOM_PROPID_EFS = 17; +exports.CAPICOM_PROPID_ENHKEY_USAGE = 9; +exports.CAPICOM_PROPID_ENROLLMENT = 26; +exports.CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30; +exports.CAPICOM_PROPID_FIRST_RESERVED = 66; +exports.CAPICOM_PROPID_FIRST_USER = 0x00008000; +exports.CAPICOM_PROPID_FORTEZZA_DATA = 18; +exports.CAPICOM_PROPID_FRIENDLY_NAME = 11; +exports.CAPICOM_PROPID_HASH_PROP = 3; +exports.CAPICOM_PROPID_IE30_RESERVED = 7; +exports.CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24; +exports.CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28; +exports.CAPICOM_PROPID_KEY_CONTEXT = 5; +exports.CAPICOM_PROPID_KEY_IDENTIFIER = 20; +exports.CAPICOM_PROPID_KEY_PROV_HANDLE = 1; +exports.CAPICOM_PROPID_KEY_PROV_INFO = 2; +exports.CAPICOM_PROPID_KEY_SPEC = 6; +exports.CAPICOM_PROPID_LAST_RESERVED = 0x00007fff; +exports.CAPICOM_PROPID_LAST_USER = 0x0000ffff; +exports.CAPICOM_PROPID_MD5_HASH = 4; +exports.CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10; +exports.CAPICOM_PROPID_PUBKEY_ALG_PARA = 22; +exports.CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8; +exports.CAPICOM_PROPID_PVK_FILE = 12; +exports.CAPICOM_PROPID_RENEWAL = 64; +exports.CAPICOM_PROPID_SHA1_HASH = 3; +exports.CAPICOM_PROPID_SIGNATURE_HASH = 15; +exports.CAPICOM_PROPID_SMART_CARD_DATA = 16; +exports.CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29; +exports.CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25; +exports.CAPICOM_PROPID_UNKNOWN = 0; +exports.CAPICOM_SMART_CARD_USER_STORE = 4; +exports.CAPICOM_STORE_OPEN_EXISTING_ONLY = 128; +exports.CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256; +exports.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; +exports.CAPICOM_STORE_OPEN_READ_ONLY = 0; +exports.CAPICOM_STORE_OPEN_READ_WRITE = 1; +exports.CHECK_NONE = 0; +exports.CHECK_OFFLINE_REVOCATION_STATUS = 16; +exports.CHECK_ONLINE_REVOCATION_STATUS = 8; +exports.CHECK_SIGNATURE_VALIDITY = 4; +exports.CHECK_TIME_VALIDITY = 2; +exports.CHECK_TRUSTED_ROOT = 1; +exports.LOG_LEVEL_DEBUG = 4; +exports.LOG_LEVEL_ERROR = 1; +exports.LOG_LEVEL_INFO = 2; +exports.TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144; +exports.TRUST_CTL_IS_NOT_TIME_VALID = 131072; +exports.TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288; +exports.TRUST_IS_CYCLIC = 128; +exports.TRUST_IS_NOT_SIGNATURE_VALID = 8; +exports.TRUST_IS_NOT_TIME_NESTED = 2; +exports.TRUST_IS_NOT_TIME_VALID = 1; +exports.TRUST_IS_NOT_VALID_FOR_USAGE = 16; +exports.TRUST_IS_PARTIAL_CHAIN = 65536; +exports.TRUST_IS_REVOKED = 4; +exports.TRUST_IS_UNTRUSTED_ROOT = 32; +exports.TRUST_REVOCATION_STATUS_UNKNOWN = 64; +exports.XmlDsigGost3410Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411'; +exports.XmlDsigGost3410UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411'; +exports.XmlDsigGost3411Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411'; +exports.XmlDsigGost3411UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr3411'; + + +/***/ }), + +/***/ "./constants/index.ts": +/*!****************************!*\ + !*** ./constants/index.ts ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./cades-constants */ "./constants/cades-constants.ts")); +__export(__webpack_require__(/*! ./issuer-tags-translations */ "./constants/issuer-tags-translations.ts")); +__export(__webpack_require__(/*! ./oids-dictionary */ "./constants/oids-dictionary.ts")); +__export(__webpack_require__(/*! ./subject-tags-translations */ "./constants/subject-tags-translations.ts")); + + +/***/ }), + +/***/ "./constants/issuer-tags-translations.ts": +/*!***********************************************!*\ + !*** ./constants/issuer-tags-translations.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ISSUER_TAGS_TRANSLATIONS = [ + { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' }, + { possibleNames: ['CN'], translation: 'Удостоверяющий центр' }, + { possibleNames: ['C'], translation: 'Страна' }, + { possibleNames: ['S'], translation: 'Регион' }, + { possibleNames: ['STREET'], translation: 'Адрес' }, + { possibleNames: ['O'], translation: 'Компания' }, + { possibleNames: ['OU'], translation: 'Тип' }, + { possibleNames: ['T'], translation: 'Должность' }, + { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' }, + { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' }, + { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' }, + { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' }, + { possibleNames: ['E'], translation: 'Email' }, + { possibleNames: ['L'], translation: 'Город' }, +]; + + +/***/ }), + +/***/ "./constants/oids-dictionary.ts": +/*!**************************************!*\ + !*** ./constants/oids-dictionary.ts ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OIDS_DICTIONARY = { + '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации', + '1.2.643.2.39.1.1': 'Использование в программных продуктах системы "1С:Предприятие 8"', + '1.2.643.3.131.1.1': 'ИНН', + '1.2.643.3.141.1.1': 'РНС ФСС', + '1.2.643.3.141.1.2': 'КП ФСС', + '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС "Госзакупки" Сахалинской области.', + '1.2.643.3.8.100.1': 'Сертификат типа "ekey-ГОСТ"', + '1.2.643.3.8.100.1.1': 'Общее использование в системах ИОК без права заверения финансовых документов', + '1.2.643.3.8.100.1.10': 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы', + '1.2.643.3.8.100.1.11': 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области', + '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области', + '1.2.643.3.8.100.1.13': 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края', + '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке "Тендер"', + '1.2.643.3.8.100.1.2': 'Передача отчетности по ТКС', + '1.2.643.3.8.100.1.3': 'Оформление взаимных обязательств, соглашений, договоров, актов и т.п.', + '1.2.643.3.8.100.1.4': 'Внутрикорпоративный документооборот', + '1.2.643.3.8.100.1.5': 'Использование в системах электронной торговли', + '1.2.643.3.8.100.1.6': 'Использование в торгово-закупочной системе "ЭЛЕКТРА"', + '1.2.643.3.8.100.1.7': 'Использование в системе Портал государственных закупок Ставропольского края.', + '1.2.643.3.8.100.1.8': 'Использование в Единой системе электронной торговли B2B-Center и B2G.', + '1.2.643.3.8.100.1.9': 'Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа', + '1.2.643.5.1.24.2.1.3': 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя', + '1.2.643.5.1.24.2.1.3.1': 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя', + '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав', + '1.2.643.5.1.24.2.2.3': 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя', + '1.2.643.6.2.1.7.1': 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций', + '1.2.643.6.2.1.7.2': 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов', + '1.2.643.6.3': 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений', + '1.2.643.6.3.1.1': 'Использование на электронных площадок отобранных для проведения аукционах в электронной форме', + '1.2.643.6.3.1.2.1': 'Тип участника - Юридическое лицо', + '1.2.643.6.3.1.2.2': 'Тип участника - Физическое лицо', + '1.2.643.6.3.1.2.3': 'Тип участника - Индивидуальный предприниматель', + '1.2.643.6.3.1.3.1': 'Участник размещения заказа', + '1.2.643.6.3.1.4.1': 'Администратор организации', + '1.2.643.6.3.1.4.2': 'Уполномоченный специалист', + '1.2.643.6.3.1.4.3': 'Специалист с правом подписи контракта', + '1.2.840.113549.1.9.2': 'Неструктурированное имя', + '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе "Электронная Торговая Площадка"', + '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области "Рефери".', + '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента', + '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта', + '1.3.643.3.8.100.15': 'Использование в ЭТП "uTender"', +}; + + +/***/ }), + +/***/ "./constants/subject-tags-translations.ts": +/*!************************************************!*\ + !*** ./constants/subject-tags-translations.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SUBJECT_TAGS_TRANSLATIONS = [ + { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' }, + { possibleNames: ['CN'], translation: 'Владелец' }, + { possibleNames: ['SN'], translation: 'Фамилия' }, + { possibleNames: ['G'], translation: 'Имя Отчество' }, + { possibleNames: ['C'], translation: 'Страна' }, + { possibleNames: ['S'], translation: 'Регион' }, + { possibleNames: ['STREET'], translation: 'Адрес' }, + { possibleNames: ['O'], translation: 'Компания' }, + { possibleNames: ['OU'], translation: 'Отдел/подразделение' }, + { possibleNames: ['T'], translation: 'Должность' }, + { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' }, + { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' }, + { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' }, + { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' }, + { possibleNames: ['E'], translation: 'Email' }, + { possibleNames: ['L'], translation: 'Город' }, +]; + + +/***/ }), + +/***/ "./crypto-pro.ts": +/*!***********************!*\ + !*** ./crypto-pro.ts ***! + \***********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(/*! ./api */ "./api/index.ts")); + + +/***/ }), + +/***/ "./helpers/_afterPluginsLoaded.ts": +/*!****************************************!*\ + !*** ./helpers/_afterPluginsLoaded.ts ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ./_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +let isSetLogLevel = false; +let isPluginLoaded = false; +exports._afterPluginsLoaded = (fn) => { + const canPromise = Boolean(window.Promise); + return function (...args) { + return __awaiter(this, void 0, void 0, function* () { + if (!isPluginLoaded) { + try { + __webpack_require__(/*! ../vendor/cadesplugin_api */ "./vendor/cadesplugin_api.js"); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при подключении модуля для работы с Cades plugin'); + } + isPluginLoaded = true; + } + const { cadesplugin } = window; + if (!canPromise) { + throw new Error('Необходим полифилл для Promise'); + } + if (!cadesplugin) { + throw new Error('Не подключен модуль для работы с Cades plugin'); + } + if (!isSetLogLevel) { + cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR); + isSetLogLevel = true; + } + try { + yield cadesplugin; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации модуля для работы с Cades plugin'); + } + return yield fn.apply(this, args); + }); + }; +}; + + +/***/ }), + +/***/ "./helpers/_extractCommonName.ts": +/*!***************************************!*\ + !*** ./helpers/_extractCommonName.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports._extractCommonName = (subjectName) => { var _a; return (_a = subjectName.match(/CN=(.+?)(?:,|$)/)) === null || _a === void 0 ? void 0 : _a[1]; }; + + +/***/ }), + +/***/ "./helpers/_extractMeaningfulErrorMessage.ts": +/*!***************************************************!*\ + !*** ./helpers/_extractMeaningfulErrorMessage.ts ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports._extractMeaningfulErrorMessage = (error) => { + var _a; + let errorContainer = ((_a = window.cadesplugin) === null || _a === void 0 ? void 0 : _a.getLastError) && window.cadesplugin.getLastError(error); + if (!(errorContainer === null || errorContainer === void 0 ? void 0 : errorContainer.message)) { + if (!error.message) { + return null; + } + errorContainer = error; + } + const containsRussianLetters = /[а-яА-Я]/.test(errorContainer.message); + if (!containsRussianLetters) { + return null; + } + const searchResult = errorContainer.message.match(/^(.*?)(?:(?:\.?\s?\(?0x)|(?:\.?$))/); + return searchResult ? searchResult[1] : null; +}; + + +/***/ }), + +/***/ "./helpers/_generateCadesFn.ts": +/*!*************************************!*\ + !*** ./helpers/_generateCadesFn.ts ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +// синтетические переменные, которые подменяются в рантайме +exports.__cadesAsyncToken__ = {}; +exports.__createCadesPluginObject__ = (...args) => ({}); +function getGeneratorConstructor() { + return new Function('', 'return Object.getPrototypeOf(function*(){}).constructor')(); +} +exports._generateCadesFn = (callback) => { + var _a; + const { cadesplugin } = window; + const cadesGeneratorsAPI = Boolean(cadesplugin.CreateObjectAsync); + const callbackName = callback.name || 'dynamicFn'; + const callbackLiteral = String(callback); + const callbackArguments = ((_a = callbackLiteral.match(/^function[\s\w]*?\((.*?)\)/)) === null || _a === void 0 ? void 0 : _a[1]) || ''; + const callbackBody = callbackLiteral.replace(/^.*?{([\s\S]*?)}$/, '$1'); + let crossEnvCallbackLiteral = String(new (cadesGeneratorsAPI ? getGeneratorConstructor() : Function)(callbackArguments, callbackBody)); + crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/\w+?\.__createCadesPluginObject__(\([\s\S]*?\))/gm, `cadesplugin.CreateObject${cadesGeneratorsAPI ? 'Async' : ''}$1`); + crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/\w+?\.__cadesAsyncToken__\s*?\+\s*?\b/gm, cadesGeneratorsAPI ? 'yield ' : ''); + if (!cadesGeneratorsAPI) { + crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/propset_(.*?)\((.*?)\)/gm, '$1 = $2'); + } + return [ + cadesGeneratorsAPI ? `cadesplugin.async_spawn(${crossEnvCallbackLiteral});` : `(${crossEnvCallbackLiteral})();`, + `//# sourceURL=crypto-pro_${callbackName}.js`, + ].join(''); +}; + + +/***/ }), + +/***/ "./helpers/_getCadesCert.ts": +/*!**********************************!*\ + !*** ./helpers/_getCadesCert.ts ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const _afterPluginsLoaded_1 = __webpack_require__(/*! ./_afterPluginsLoaded */ "./helpers/_afterPluginsLoaded.ts"); +const _extractMeaningfulErrorMessage_1 = __webpack_require__(/*! ./_extractMeaningfulErrorMessage */ "./helpers/_extractMeaningfulErrorMessage.ts"); +const _generateCadesFn_1 = __webpack_require__(/*! ./_generateCadesFn */ "./helpers/_generateCadesFn.ts"); +/** + * Возвращает сертификат в формате Cades по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат в формате Cades + */ +exports._getCadesCert = _afterPluginsLoaded_1._afterPluginsLoaded((thumbprint) => { + const { cadesplugin } = window; + return eval(_generateCadesFn_1._generateCadesFn(function _getCadesCert() { + let cadesStore; + try { + cadesStore = _generateCadesFn_1.__cadesAsyncToken__ + _generateCadesFn_1.__createCadesPluginObject__('CAdESCOM.Store'); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу'); + } + if (!cadesStore) { + throw new Error('Не удалось получить доступ к хранилищу сертификатов'); + } + try { + void (_generateCadesFn_1.__cadesAsyncToken__ + + cadesStore.Open(cadesplugin.CAPICOM_CURRENT_USER_STORE, cadesplugin.CAPICOM_MY_STORE, cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED)); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища'); + } + let cadesCertificateList; + let certificatesCount; + try { + cadesCertificateList = _generateCadesFn_1.__cadesAsyncToken__ + cadesStore.Certificates; + certificatesCount = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Count; + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов'); + } + if (!certificatesCount) { + throw new Error('Нет доступных сертификатов'); + } + let cadesCertificate; + try { + cadesCertificateList = + _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint); + const count = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Count; + if (!count) { + throw new Error(`Сертификат с отпечатком: "${thumbprint}" не найден`); + } + cadesCertificate = _generateCadesFn_1.__cadesAsyncToken__ + cadesCertificateList.Item(1); + } + catch (error) { + console.error(error); + throw new Error(_extractMeaningfulErrorMessage_1._extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата'); + } + cadesStore.Close(); + return cadesCertificate; + })); +}); + + +/***/ }), + +/***/ "./helpers/_getDateObj.ts": +/*!********************************!*\ + !*** ./helpers/_getDateObj.ts ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера. + * + * В IE необходимо использовать специфичный формат "VT_DATE" + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate + */ +exports._getDateObj = (dateObj) => (dateObj.getVarDate ? dateObj.getVarDate() : dateObj); + + +/***/ }), + +/***/ "./helpers/_isSupportedCSPVersion.ts": +/*!*******************************************!*\ + !*** ./helpers/_isSupportedCSPVersion.ts ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const oldestSupportedCSPVersion = 4.0; +exports._isSupportedCSPVersion = (version) => { + var _a; + version = (_a = version.match(/\d+?\b(?:\.\d+)?/)) === null || _a === void 0 ? void 0 : _a[0]; + return Number(version) >= oldestSupportedCSPVersion; +}; + + +/***/ }), + +/***/ "./helpers/_isSupportedCadesVersion.ts": +/*!*********************************************!*\ + !*** ./helpers/_isSupportedCadesVersion.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports._isSupportedCadesVersion = (version) => { + const match = version.match(/(\d+)\.(\d+)\.(\d+)/); + if (!match) { + return false; + } + const [, major, minor, patch] = match; + if (Number(major) < 2) { + return false; + } + if (Number(major) === 2 && Number(patch) < 12438) { + return false; + } + return true; +}; + + +/***/ }), + +/***/ "./helpers/_parseCertInfo.ts": +/*!***********************************!*\ + !*** ./helpers/_parseCertInfo.ts ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +const constants_1 = __webpack_require__(/*! ../constants */ "./constants/index.ts"); +/** + * Парсит информацию из строки с информацией о сертификате + * + * @param tagsTranslations - словарь с расшифровками тэгов + * @param rawInfo - данные для парсинга + * @returns расшифрованная информация по отдельным тэгам + */ +exports._parseCertInfo = (tagsTranslations, rawInfo) => { + const extractedEntities = rawInfo.match(/([а-яА-Яa-zA-Z0-9.]+)=(?:("[^"]+?")|(.+?))(?:,|$)/g); + if (extractedEntities) { + return extractedEntities.map((group) => { + var _a, _b, _c; + const segmentsMatch = group.match(/^([а-яА-Яa-zA-Z0-9.]+)=(.+?),?$/); + let title = segmentsMatch === null || segmentsMatch === void 0 ? void 0 : segmentsMatch[1]; + // Вырезаем лишние кавычки + const description = (_b = (_a = segmentsMatch === null || segmentsMatch === void 0 ? void 0 : segmentsMatch[2]) === null || _a === void 0 ? void 0 : _a.replace(/^"(.*)"/, '$1')) === null || _b === void 0 ? void 0 : _b.replace(/"{2}/g, '"'); + const oidIdentifierMatch = title === null || title === void 0 ? void 0 : title.match(/^OID\.(.*)/); + const oidIdentifier = oidIdentifierMatch === null || oidIdentifierMatch === void 0 ? void 0 : oidIdentifierMatch[1]; + let isTranslated = false; + // Если нашли в тайтле ОИД, пытаемся его расшифровать + if (oidIdentifier) { + const oidTranslation = constants_1.OIDS_DICTIONARY[oidIdentifier]; + if (oidTranslation) { + title = oidTranslation; + isTranslated = true; + } + } + const tagTranslation = (_c = tagsTranslations.find((tag) => tag.possibleNames.find((name) => name === title))) === null || _c === void 0 ? void 0 : _c.translation; + if (tagTranslation) { + title = tagTranslation; + isTranslated = true; + } + return { description, title, isTranslated }; + }); + } +}; + + +/***/ }), + +/***/ "./vendor/cadesplugin_api.js": +/*!***********************************!*\ + !*** ./vendor/cadesplugin_api.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +;(function () { + //already loaded + if(window.cadesplugin) + return; + + var pluginObject; + var plugin_resolved = 0; + var plugin_reject; + var plugin_resolve; + var isOpera = 0; + var isFireFox = 0; + var isEdge = 0; + var isSafari = 0; + var failed_extensions = 0; + + var canPromise = !!window.Promise; + var cadesplugin; + + if(canPromise) + { + cadesplugin = new Promise(function(resolve, reject) + { + plugin_resolve = resolve; + plugin_reject = reject; + }); + } else + { + cadesplugin = {}; + } + + function check_browser() { + var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; + if(/trident/i.test(M[1])){ + tem= /\brv[ :]+(\d+)/g.exec(ua) || []; + return {name:'IE',version:(tem[1] || '')}; + } + if(M[1]=== 'Chrome'){ + tem= ua.match(/\b(OPR|Edge)\/(\d+)/); + if(tem!= null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]}; + } + M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; + if((tem= ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]); + return {name:M[0],version:M[1]}; + } + var browserSpecs = check_browser(); + + function cpcsp_console_log(level, msg){ + //IE9 не может писать в консоль если не открыта вкладка developer tools + if(typeof(console) === 'undefined') + return; + if (level <= cadesplugin.current_log_level ){ + if (level === cadesplugin.LOG_LEVEL_DEBUG) + console.log("DEBUG: %s", msg); + if (level === cadesplugin.LOG_LEVEL_INFO) + console.info("INFO: %s", msg); + if (level === cadesplugin.LOG_LEVEL_ERROR) + console.error("ERROR: %s", msg); + return; + } + } + + function set_log_level(level){ + if (!((level === cadesplugin.LOG_LEVEL_DEBUG) || + (level === cadesplugin.LOG_LEVEL_INFO) || + (level === cadesplugin.LOG_LEVEL_ERROR))){ + cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR, "cadesplugin_api.js: Incorrect log_level: " + level); + return; + } + cadesplugin.current_log_level = level; + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG) + cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, "cadesplugin_api.js: log_level = DEBUG"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO) + cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, "cadesplugin_api.js: log_level = INFO"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR) + cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, "cadesplugin_api.js: log_level = ERROR"); + if(isNativeMessageSupported()) + { + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG) + window.postMessage("set_log_level=debug", "*"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO) + window.postMessage("set_log_level=info", "*"); + if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR) + window.postMessage("set_log_level=error", "*"); + } + } + + function set_constantValues() + { + cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1; + cadesplugin.CAPICOM_CURRENT_USER_STORE = 2; + cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1; + cadesplugin.CADESCOM_CURRENT_USER_STORE = 2; + cadesplugin.CADESCOM_CONTAINER_STORE = 100; + + cadesplugin.CAPICOM_MY_STORE = "My"; + + cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; + + cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; + + cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0; + cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1; + cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2; + + cadesplugin.XmlDsigGost3410UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411"; + cadesplugin.XmlDsigGost3411UrlObsolete = "http://www.w3.org/2001/04/xmldsig-more#gostr3411"; + cadesplugin.XmlDsigGost3410Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411"; + cadesplugin.XmlDsigGost3411Url = "urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411"; + + cadesplugin.CADESCOM_CADES_DEFAULT = 0; + cadesplugin.CADESCOM_CADES_BES = 1; + cadesplugin.CADESCOM_CADES_T = 0x5; + cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d; + cadesplugin.CADESCOM_PKCS7_TYPE = 0xffff; + + cadesplugin.CADESCOM_ENCODE_BASE64 = 0; + cadesplugin.CADESCOM_ENCODE_BINARY = 1; + cadesplugin.CADESCOM_ENCODE_ANY = -1; + + cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0; + cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1; + cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2; + + cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0; + cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1; + + cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0; + cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; + cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2; + cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4; + cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5; + cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6; + cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7; + cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10; + cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11; + cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12; + + cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128; + + cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE = 9; + + cadesplugin.CAPICOM_OID_OTHER = 0; + cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION = 10; + + cadesplugin.CAPICOM_EKU_CLIENT_AUTH = 2; + cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON = 5; + cadesplugin.CAPICOM_EKU_OTHER = 0; + + cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; + cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; + cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; + cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0; + cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1; + cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2; + cadesplugin.CADESCOM_ATTRIBUTE_OTHER = -1; + + cadesplugin.CADESCOM_STRING_TO_UCS2LE = 0; + cadesplugin.CADESCOM_BASE64_TO_BINARY = 1; + + cadesplugin.CADESCOM_DISPLAY_DATA_NONE = 0; + cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT = 1; + cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2; + + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4; + cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25; + + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1 = 0; + cadesplugin.CADESCOM_HASH_ALGORITHM_MD2 = 1; + cadesplugin.CADESCOM_HASH_ALGORITHM_MD4 = 2; + cadesplugin.CADESCOM_HASH_ALGORITHM_MD5 = 3; + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256 = 4; + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384 = 5; + cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512 = 6; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111; + cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112; + + cadesplugin.LOG_LEVEL_DEBUG = 4; + cadesplugin.LOG_LEVEL_INFO = 2; + cadesplugin.LOG_LEVEL_ERROR = 1; + + cadesplugin.CADESCOM_AllowNone = 0; + cadesplugin.CADESCOM_AllowNoOutstandingRequest = 0x1; + cadesplugin.CADESCOM_AllowUntrustedCertificate = 0x2; + cadesplugin.CADESCOM_AllowUntrustedRoot = 0x4; + cadesplugin.CADESCOM_SkipInstallToStore = 0x10000000; + } + + function async_spawn(generatorFunc) { + function continuer(verb, arg) { + var result; + try { + result = generator[verb](arg); + } catch (err) { + return Promise.reject(err); + } + if (result.done) { + return result.value; + } else { + return Promise.resolve(result.value).then(onFulfilled, onRejected); + } + } + var generator = generatorFunc(Array.prototype.slice.call(arguments, 1)); + var onFulfilled = continuer.bind(continuer, "next"); + var onRejected = continuer.bind(continuer, "throw"); + return onFulfilled(); + } + + function isIE() { + // var retVal = (("Microsoft Internet Explorer" == navigator.appName) || // IE < 11 + // navigator.userAgent.match(/Trident\/./i)); // IE 11 + return (browserSpecs.name === 'IE' || browserSpecs.name === 'MSIE'); + } + + function isIOS() { + return (navigator.userAgent.match(/ipod/i) || + navigator.userAgent.match(/ipad/i) || + navigator.userAgent.match(/iphone/i)); + } + + function isNativeMessageSupported() + { + // В IE работаем через NPAPI + if(isIE()) + return false; + // В Edge работаем через NativeMessage + if(browserSpecs.name === 'Edge') { + isEdge = true; + return true; + } + // В Chrome, Firefox, Safari и Opera работаем через асинхронную версию в зависимости от версии + if(browserSpecs.name === 'Opera') { + isOpera = true; + if(browserSpecs.version >= 33){ + return true; + } + else{ + return false; + } + } + if(browserSpecs.name === 'Firefox') { + isFireFox = true; + if(browserSpecs.version >= 52){ + return true; + } + else{ + return false; + } + } + if(browserSpecs.name === 'Chrome') { + if(browserSpecs.version >= 42){ + return true; + } + else{ + return false; + } + } + //В Сафари начиная с 12 версии нет NPAPI + if(browserSpecs.name === 'Safari') { + isSafari = true; + if(browserSpecs.version >= 12) { + return true; + } else { + return false; + } + } + } + + // Функция активации объектов КриптоПро ЭЦП Browser plug-in + function CreateObject(name) { + if (isIOS()) { + // На iOS для создания объектов используется функция + // call_ru_cryptopro_npcades_10_native_bridge, определенная в IOS_npcades_supp.js + return call_ru_cryptopro_npcades_10_native_bridge("CreateObject", [name]); + } + if (isIE()) { + // В Internet Explorer создаются COM-объекты + if (name.match(/X509Enrollment/i)) { + try { + // Объекты CertEnroll пробуем создавать через нашу фабрику, + // если не получилось то через CX509EnrollmentWebClassFactory + var objCertEnrollClassFactory = document.getElementById("webClassFactory"); + return objCertEnrollClassFactory.CreateObject(name); + } + catch (e) { + try { + var objWebClassFactory = document.getElementById("certEnrollClassFactory"); + return objWebClassFactory.CreateObject(name); + } + catch (err) { + throw ("Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS"); + } + } + } + // Объекты CAPICOM и CAdESCOM создаются через CAdESCOM.WebClassFactory + try { + var objWebClassFactory = document.getElementById("webClassFactory"); + return objWebClassFactory.CreateObject(name); + } + catch (e) { + // Для версий плагина ниже 2.0.12538 + return new ActiveXObject(name); + } + } + // создаются объекты NPAPI + return pluginObject.CreateObject(name); + } + + function decimalToHexString(number) { + if (number < 0) { + number = 0xFFFFFFFF + number + 1; + } + + return number.toString(16).toUpperCase(); + } + + function GetMessageFromException(e) { + var err = e.message; + if (!err) { + err = e; + } else if (e.number) { + err += " (0x" + decimalToHexString(e.number) + ")"; + } + return err; + } + + function getLastError(exception) { + if(isNativeMessageSupported() || isIE() || isIOS() ) { + return GetMessageFromException(exception); + } + + try { + return pluginObject.getLastError(); + } catch(e) { + return GetMessageFromException(exception); + } + } + + // Функция для удаления созданных объектов + function ReleasePluginObjects() { + return cpcsp_chrome_nmcades.ReleasePluginObjects(); + } + + // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in + function CreateObjectAsync(name) { + return pluginObject.CreateObjectAsync(name); + } + + //Функции для IOS + var ru_cryptopro_npcades_10_native_bridge = { + callbacksCount : 1, + callbacks : {}, + + // Automatically called by native layer when a result is available + resultForCallback : function resultForCallback(callbackId, resultArray) { + var callback = ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId]; + if (!callback) return; + callback.apply(null,resultArray); + }, + + // Use this in javascript to request native objective-c code + // functionName : string (I think the name is explicit :p) + // args : array of arguments + // callback : function with n-arguments that is going to be called when the native code returned + call : function call(functionName, args, callback) { + var hasCallback = callback && typeof callback === "function"; + var callbackId = hasCallback ? ru_cryptopro_npcades_10_native_bridge.callbacksCount++ : 0; + + if (hasCallback) + ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId] = callback; + + var iframe = document.createElement("IFRAME"); + var arrObjs = new Array("_CPNP_handle"); + try{ + iframe.setAttribute("src", "cpnp-js-call:" + functionName + ":" + callbackId+ ":" + encodeURIComponent(JSON.stringify(args, arrObjs))); + } catch(e){ + alert(e); + } + document.documentElement.appendChild(iframe); + iframe.parentNode.removeChild(iframe); + iframe = null; + } + }; + + function call_ru_cryptopro_npcades_10_native_bridge(functionName, array){ + var tmpobj; + var ex; + ru_cryptopro_npcades_10_native_bridge.call(functionName, array, function(e, response){ + ex = e; + var str='tmpobj='+response; + eval(str); + if (typeof (tmpobj) === "string"){ + tmpobj = tmpobj.replace(/\\\n/gm, "\n"); + tmpobj = tmpobj.replace(/\\\r/gm, "\r"); + } + }); + if(ex) + throw ex; + return tmpobj; + } + + function show_firefox_missing_extension_dialog() + { + if (!window.cadesplugin_skip_extension_install) + { + var ovr = document.createElement('div'); + ovr.id = "cadesplugin_ovr"; + ovr.style = "visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)"; + ovr.innerHTML = "
" + + "" + + "

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

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

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

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

" + + "
"; + document.getElementsByTagName("Body")[0].appendChild(ovr); + var btn_install = document.getElementById("cadesplugin_install"); + btn_install.addEventListener('click', function(event) { + opr.addons.installExtension("epebfcehmdedogndhlcacafjaacknbcm", + function() + { + document.getElementById("cadesplugin_ovr").style.visibility = 'hidden'; + location.reload(); + }, + function(){}) + }); + document.getElementById("cadesplugin_close_install").addEventListener('click',function() + { + plugin_loaded_error("Плагин недоступен"); + document.getElementById("cadesplugin_ovr").style.visibility = 'hidden'; + }); + + ovr.addEventListener('click',function() + { + plugin_loaded_error("Плагин недоступен"); + document.getElementById("cadesplugin_ovr").style.visibility = 'hidden'; + }); + ovr.style.visibility="visible"; + document.getElementById("cadesplugin_ovr_item").addEventListener('click',function(e){ + e.stopPropagation(); + }); + }); + }else + { + plugin_loaded_error("Плагин недоступен"); + } + } + + function firefox_or_edge_nmcades_onload() { + cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error); + } + + function nmcades_api_onload () { + window.postMessage("cadesplugin_echo_request", "*"); + window.addEventListener("message", function (event){ + if (typeof(event.data) !== "string" || !event.data.match("cadesplugin_loaded")) + return; + if(isFireFox || isEdge || isSafari) + { + // Для Firefox, Сафари, Edge вместе с сообщением cadesplugin_loaded прилетает url для загрузки nmcades_plugin_api.js + var url = event.data.substring(event.data.indexOf("url:") + 4); + var fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", url); + fileref.onerror = plugin_loaded_error; + fileref.onload = firefox_or_edge_nmcades_onload; + document.getElementsByTagName("head")[0].appendChild(fileref); + // Для Firefox, Safari и Edge у нас только по одному расширению. + failed_extensions++; + }else { + cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error); + } + }, false); + } + + //Загружаем расширения для Chrome, Opera, YaBrowser, FireFox, Edge, Safari + function load_extension() + { + + if(isFireFox || isEdge || isSafari){ + // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера. + nmcades_api_onload(); + } else { + // в асинхронном варианте для chrome и opera подключаем оба расширения + var fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", "chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js"); + fileref.onerror = plugin_loaded_error; + fileref.onload = nmcades_api_onload; + document.getElementsByTagName("head")[0].appendChild(fileref); + fileref = document.createElement('script'); + fileref.setAttribute("type", "text/javascript"); + fileref.setAttribute("src", "chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js"); + fileref.onerror = plugin_loaded_error; + fileref.onload = nmcades_api_onload; + document.getElementsByTagName("head")[0].appendChild(fileref); + } + } + + //Загружаем плагин для NPAPI + function load_npapi_plugin() + { + var elem = document.createElement('object'); + elem.setAttribute("id", "cadesplugin_object"); + elem.setAttribute("type", "application/x-cades"); + elem.setAttribute("style", "visibility: hidden"); + document.getElementsByTagName("body")[0].appendChild(elem); + pluginObject = document.getElementById("cadesplugin_object"); + if(isIE()) + { + var elem1 = document.createElement('object'); + elem1.setAttribute("id", "certEnrollClassFactory"); + elem1.setAttribute("classid", "clsid:884e2049-217d-11da-b2a4-000e7bbb2b09"); + elem1.setAttribute("style", "visibility: hidden"); + document.getElementsByTagName("body")[0].appendChild(elem1); + var elem2 = document.createElement('object'); + elem2.setAttribute("id", "webClassFactory"); + elem2.setAttribute("classid", "clsid:B04C8637-10BD-484E-B0DA-B8A039F60024"); + elem2.setAttribute("style", "visibility: hidden"); + document.getElementsByTagName("body")[0].appendChild(elem2); + } + } + + //Отправляем событие что все ок. + function plugin_loaded() + { + plugin_resolved = 1; + if(canPromise) + { + plugin_resolve(); + }else { + window.postMessage("cadesplugin_loaded", "*"); + } + } + + //Отправляем событие что сломались. + function plugin_loaded_error(msg) + { + if(isNativeMessageSupported()) + { + //в асинхронном варианте подключаем оба расширения, если сломались оба пробуем установить для Opera + failed_extensions++; + if(failed_extensions<2) + return; + if(isOpera && (typeof(msg) === 'undefined'|| typeof(msg) === 'object')) + { + install_opera_extension(); + return; + } + } + if(typeof(msg) === 'undefined' || typeof(msg) === 'object') + msg = "Плагин недоступен"; + plugin_resolved = 1; + if(canPromise) + { + plugin_reject(msg); + } else { + window.postMessage("cadesplugin_load_error", "*"); + } + } + + //проверяем что у нас хоть какое то событие ушло, и если не уходило кидаем еще раз ошибку + function check_load_timeout() + { + if(plugin_resolved === 1) + return; + if(isFireFox) + { + show_firefox_missing_extension_dialog(); + } + plugin_resolved = 1; + if(canPromise) + { + plugin_reject("Истекло время ожидания загрузки плагина"); + } else { + window.postMessage("cadesplugin_load_error", "*"); + } + + } + + //Вспомогательная функция для NPAPI + function createPromise(arg) + { + return new Promise(arg); + } + + function check_npapi_plugin (){ + try { + var oAbout = CreateObject("CAdESCOM.About"); + plugin_loaded(); + } + catch (err) { + document.getElementById("cadesplugin_object").style.display = 'none'; + // Объект создать не удалось, проверим, установлен ли + // вообще плагин. Такая возможность есть не во всех браузерах + var mimetype = navigator.mimeTypes["application/x-cades"]; + if (mimetype) { + var plugin = mimetype.enabledPlugin; + if (plugin) { + plugin_loaded_error("Плагин загружен, но не создаются обьекты"); + }else + { + plugin_loaded_error("Ошибка при загрузке плагина"); + } + }else + { + plugin_loaded_error("Плагин недоступен"); + } + } + } + + //Проверяем работает ли плагин + function check_plugin_working() + { + var div = document.createElement("div"); + div.innerHTML = ""; + var isIeLessThan9 = (div.getElementsByTagName("i").length === 1); + if (isIeLessThan9) { + plugin_loaded_error("Internet Explorer версии 8 и ниже не поддерживается"); + return; + } + + if(isNativeMessageSupported()) + { + load_extension(); + }else if(!canPromise) { + window.addEventListener("message", function (event){ + if (event.data !== "cadesplugin_echo_request") + return; + load_npapi_plugin(); + check_npapi_plugin(); + }, + false); + }else + { + if(document.readyState === "complete"){ + load_npapi_plugin(); + check_npapi_plugin(); + } else { + window.addEventListener("load", function (event) { + load_npapi_plugin(); + check_npapi_plugin(); + }, false); + } + } + } + + function set_pluginObject(obj) + { + pluginObject = obj; + } + + function is_capilite_enabled() + { + if ((typeof (cadesplugin.EnableInternalCSP) !== 'undefined') && cadesplugin.EnableInternalCSP) + return true; + return false; + }; + + //Export + cadesplugin.JSModuleVersion = "2.1.2"; + cadesplugin.async_spawn = async_spawn; + cadesplugin.set = set_pluginObject; + cadesplugin.set_log_level = set_log_level; + cadesplugin.getLastError = getLastError; + cadesplugin.is_capilite_enabled = is_capilite_enabled; + + if(isNativeMessageSupported()) + { + cadesplugin.CreateObjectAsync = CreateObjectAsync; + cadesplugin.ReleasePluginObjects = ReleasePluginObjects; + } + + if(!isNativeMessageSupported()) + { + cadesplugin.CreateObject = CreateObject; + } + + if(window.cadesplugin_load_timeout) + { + setTimeout(check_load_timeout, window.cadesplugin_load_timeout); + } + else + { + setTimeout(check_load_timeout, 20000); + } + + set_constantValues(); + + cadesplugin.current_log_level = cadesplugin.LOG_LEVEL_ERROR; + window.cadesplugin = cadesplugin; + check_plugin_working(); +}()); + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=crypto-pro.js.map \ No newline at end of file diff --git a/lib/crypto-pro.js.map b/lib/crypto-pro.js.map new file mode 100644 index 0000000..8aa16c3 --- /dev/null +++ b/lib/crypto-pro.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://cryptoPro/webpack/universalModuleDefinition","webpack://cryptoPro/webpack/bootstrap","webpack://cryptoPro/./api/certificate/certificate.ts","webpack://cryptoPro/./api/certificate/exportBase64.ts","webpack://cryptoPro/./api/certificate/getAlgorithm.ts","webpack://cryptoPro/./api/certificate/getCadesProp.ts","webpack://cryptoPro/./api/certificate/getDecodedExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/getInfo.ts","webpack://cryptoPro/./api/certificate/hasExtendedKeyUsage.ts","webpack://cryptoPro/./api/certificate/index.ts","webpack://cryptoPro/./api/certificate/isValid.ts","webpack://cryptoPro/./api/createSignature.ts","webpack://cryptoPro/./api/getCertificate.ts","webpack://cryptoPro/./api/getSystemInfo.ts","webpack://cryptoPro/./api/getUserCertificates.ts","webpack://cryptoPro/./api/index.ts","webpack://cryptoPro/./api/isValidSystemSetup.ts","webpack://cryptoPro/./constants/cades-constants.ts","webpack://cryptoPro/./constants/index.ts","webpack://cryptoPro/./constants/issuer-tags-translations.ts","webpack://cryptoPro/./constants/oids-dictionary.ts","webpack://cryptoPro/./constants/subject-tags-translations.ts","webpack://cryptoPro/./crypto-pro.ts","webpack://cryptoPro/./helpers/_afterPluginsLoaded.ts","webpack://cryptoPro/./helpers/_extractCommonName.ts","webpack://cryptoPro/./helpers/_extractMeaningfulErrorMessage.ts","webpack://cryptoPro/./helpers/_generateCadesFn.ts","webpack://cryptoPro/./helpers/_getCadesCert.ts","webpack://cryptoPro/./helpers/_getDateObj.ts","webpack://cryptoPro/./helpers/_isSupportedCSPVersion.ts","webpack://cryptoPro/./helpers/_isSupportedCadesVersion.ts","webpack://cryptoPro/./helpers/_parseCertInfo.ts","webpack://cryptoPro/./vendor/cadesplugin_api.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BA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ACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA,gBAAgB;AAChB;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;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;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,yDAAyD;AACzD;AACA;;AAEA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB,WAAW,UAAU,YAAY,aAAa;AAC3G,qFAAqF,aAAa,mBAAmB,uBAAuB,uBAAuB,cAAc,mBAAmB,YAAY;AAChN,4EAA4E,iBAAiB,yBAAyB,WAAW;AACjI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,iBAAiB,WAAW,UAAU,YAAY,aAAa;AAC/G,yFAAyF,aAAa,mBAAmB,uBAAuB,uBAAuB,cAAc,mBAAmB,YAAY;AACpN,gFAAgF,iBAAiB,yBAAyB,WAAW;AACrI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,oCAAoC;AACpC,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;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,SAAS;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,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,CAAC","file":"crypto-pro.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"cryptoPro\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"cryptoPro\"] = factory();\n\telse\n\t\troot[\"cryptoPro\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./crypto-pro.ts\");\n","import { ISSUER_TAGS_TRANSLATIONS, SUBJECT_TAGS_TRANSLATIONS } from '../../constants';\nimport { TagTranslation } from '../../helpers/_parseCertInfo';\nimport { exportBase64 } from './exportBase64';\nimport { getAlgorithm } from './getAlgorithm';\nimport { getCadesProp } from './getCadesProp';\nimport { getDecodedExtendedKeyUsage, ExtendedKeysTranslations } from './getDecodedExtendedKeyUsage';\nimport { getExtendedKeyUsage } from './getExtendedKeyUsage';\nimport { getInfo } from './getInfo';\nimport { hasExtendedKeyUsage } from './hasExtendedKeyUsage';\nimport { isValid } from './isValid';\n\nexport type CadesCertificate = any;\n\nexport class Certificate {\n constructor(\n public _cadesCertificate: CadesCertificate,\n public name: string,\n public issuerName: string,\n public subjectName: string,\n public thumbprint: string,\n public validFrom: string,\n public validTo: string,\n ) {}\n\n public getOwnerInfo(): Promise {\n return getInfo.call(this, SUBJECT_TAGS_TRANSLATIONS, 'SubjectName');\n }\n\n public getIssuerInfo(): Promise {\n return getInfo.call(this, ISSUER_TAGS_TRANSLATIONS, 'IssuerName');\n }\n\n public getExtendedKeyUsage(): Promise {\n return getExtendedKeyUsage.call(this);\n }\n\n public getDecodedExtendedKeyUsage(): Promise {\n return getDecodedExtendedKeyUsage.call(this);\n }\n\n public getAlgorithm(): Promise {\n return getAlgorithm.call(this);\n }\n\n public getCadesProp(propName): Promise {\n return getCadesProp.call(this, propName);\n }\n\n public isValid(): Promise {\n return isValid.call(this);\n }\n\n public exportBase64(): Promise {\n return exportBase64.call(this);\n }\n\n public hasExtendedKeyUsage(oids): Promise {\n return hasExtendedKeyUsage.call(this, oids);\n }\n}\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Экспортирует сертификат в формате base64\n *\n * @returns сертификат в формате base64\n */\nexport const exportBase64 = _afterPluginsLoaded(function (): string {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function exportBase64(): string {\n let base64: string;\n\n try {\n base64 = __cadesAsyncToken__ + cadesCertificate.Export(0);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при экспорте сертификата');\n }\n\n return base64;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\ninterface AlgorithmInfo {\n algorithm: string;\n oid: string;\n}\n\n/**\n * Возвращает информацию об алгоритме сертификата\n *\n * @returns информацию об алгоритме и его OID'е\n */\nexport const getAlgorithm = _afterPluginsLoaded(function (): AlgorithmInfo {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getAlgorithm(): AlgorithmInfo {\n const algorithmInfo: AlgorithmInfo = {\n algorithm: null,\n oid: null,\n };\n let cadesPublicKey;\n\n try {\n cadesPublicKey = __cadesAsyncToken__ + cadesCertificate.PublicKey();\n cadesPublicKey = __cadesAsyncToken__ + cadesPublicKey.Algorithm;\n algorithmInfo.algorithm = __cadesAsyncToken__ + cadesPublicKey.FriendlyName;\n algorithmInfo.oid = __cadesAsyncToken__ + cadesPublicKey.Value;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении алгоритма');\n }\n\n return algorithmInfo;\n }),\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает указанное внутренее свойство у сертификата в формате Cades\n *\n * @param propName = наименование свойства\n * @returns значение запрошенного свойства\n */\nexport const getCadesProp = _afterPluginsLoaded(function (propName: string): any {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getCadesProp() {\n let propertyValue;\n\n try {\n propertyValue = __cadesAsyncToken__ + cadesCertificate[propName];\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при обращении к свойству сертификата');\n }\n\n return propertyValue;\n }),\n );\n});\n","import { OIDS_DICTIONARY } from '../../constants';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\nexport interface ExtendedKeysTranslations {\n [key: string]: string | null;\n}\n\n/**\n * Возвращает расшифрованные ОИД'ы сертификата\n *\n * @returns словарь расшифрованных ОИД'ов\n */\nexport const getDecodedExtendedKeyUsage = _afterPluginsLoaded(async function (): Promise {\n const certificateOids = await (this as Certificate).getExtendedKeyUsage();\n\n return certificateOids.reduce(\n (decodedOids, oidCode) => ({\n ...decodedOids,\n [oidCode]: OIDS_DICTIONARY[oidCode] || null,\n }),\n {},\n );\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Возвращает ОИД'ы сертификата\n *\n * @returns список ОИД'ов\n */\nexport const getExtendedKeyUsage = _afterPluginsLoaded(function (): string[] {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function getExtendedKeyUsage(): string[] {\n const OIDS: string[] = [];\n let count: any;\n\n try {\n count = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n count = __cadesAsyncToken__ + count.EKUs;\n count = __cadesAsyncToken__ + count.Count;\n\n if (count > 0) {\n while (count > 0) {\n let cadesExtendedKeyUsage;\n\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesCertificate.ExtendedKeyUsage();\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.EKUs;\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.Item(count);\n cadesExtendedKeyUsage = __cadesAsyncToken__ + cadesExtendedKeyUsage.OID;\n\n OIDS.push(cadesExtendedKeyUsage);\n\n count--;\n }\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || \"Ошибка при получении ОИД'ов\");\n }\n\n return OIDS;\n }),\n );\n});\n","import { TagsTranslations } from '../../constants/tags-translations';\nimport { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { _parseCertInfo, TagTranslation } from '../../helpers/_parseCertInfo';\nimport { getCadesProp } from './getCadesProp';\n\n/**\n * Возвращает расшифрованную информацию о сертификате из указанного свойства по тэгам\n *\n * @param tags = словарь\n * @param entitiesPath = путь к разбираемой сущности\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const getInfo = _afterPluginsLoaded(async function (\n tags: TagsTranslations[],\n entitiesPath: string,\n): Promise {\n let entities: string;\n\n try {\n entities = await getCadesProp.call(this, entitiesPath);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при извлечении информации из сертификата');\n }\n\n return _parseCertInfo(tags, entities);\n});\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет наличие ОИД'а (ОИД'ов) у сертификата\n *\n * @param oids - ОИД'ы для проверки\n * @returns флаг наличия ОИД'ов у сертификата\n */\nexport const hasExtendedKeyUsage = _afterPluginsLoaded(async function (oids: string | string[]): Promise {\n const certOids = await (this as Certificate).getExtendedKeyUsage();\n\n let result: boolean;\n\n if (Array.isArray(oids)) {\n result = oids.every((oidToCheck) => certOids.some((certOid) => certOid === oidToCheck));\n } else {\n result = certOids.some((certOid) => certOid === oids);\n }\n\n return result;\n});\n","export * from './certificate';\n","import { _afterPluginsLoaded } from '../../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, _generateCadesFn } from '../../helpers/_generateCadesFn';\nimport { Certificate } from './certificate';\n\n/**\n * Проверяет действительность сертификата\n *\n * @returns флаг валидности\n */\nexport const isValid = _afterPluginsLoaded(function (): boolean {\n const cadesCertificate = (this as Certificate)._cadesCertificate;\n\n return eval(\n _generateCadesFn(function isValid() {\n let isValid;\n\n try {\n isValid = __cadesAsyncToken__ + cadesCertificate.IsValid();\n isValid = __cadesAsyncToken__ + isValid.Result;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при проверке сертификата');\n }\n\n return Boolean(isValid);\n }),\n );\n});\n","import { CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\nimport { _getCadesCert } from '../helpers/_getCadesCert';\nimport { _getDateObj } from '../helpers/_getDateObj';\n\n/**\n * Создает подпись base64 строки по отпечатку сертификата\n *\n * @param thumbprint - отпечаток сертификата\n * @param dataBase64 - строковые данные в формате base64\n * @param detachedSignature = true - тип подписи открепленная (true) / присоединенная (false)\n * @returns подпись\n */\nexport const createSignature = _afterPluginsLoaded(\n async (thumbprint: string, dataBase64: string, detachedSignature: boolean = true): Promise => {\n const { cadesplugin } = window;\n const cadesCertificate = await _getCadesCert(thumbprint);\n\n return eval(\n _generateCadesFn(function signData(): string {\n let cadesAttrs;\n let cadesSignedData;\n let cadesSigner;\n\n try {\n cadesAttrs = __cadesAsyncToken__ + __createCadesPluginObject__('CADESCOM.CPAttribute');\n cadesSignedData = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CadesSignedData');\n cadesSigner = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.CPSigner');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации подписи');\n }\n\n const currentTime = _getDateObj(new Date());\n\n try {\n void (__cadesAsyncToken__ + cadesAttrs.propset_Name(CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME));\n void (__cadesAsyncToken__ + cadesAttrs.propset_Value(currentTime));\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при установке времени подписи');\n }\n\n let cadesAuthAttrs;\n\n try {\n void (__cadesAsyncToken__ + cadesSigner.propset_Certificate(cadesCertificate));\n cadesAuthAttrs = __cadesAsyncToken__ + cadesSigner.AuthenticatedAttributes2;\n void (__cadesAsyncToken__ + cadesAuthAttrs.Add(cadesAttrs));\n void (__cadesAsyncToken__ + cadesSignedData.propset_ContentEncoding(cadesplugin.CADESCOM_BASE64_TO_BINARY));\n void (__cadesAsyncToken__ + cadesSignedData.propset_Content(dataBase64));\n void (\n __cadesAsyncToken__ + cadesSigner.propset_Options(cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY)\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при указании данных для подписи');\n }\n\n let signature: string;\n\n try {\n signature =\n __cadesAsyncToken__ +\n cadesSignedData.SignCades(cadesSigner, cadesplugin.CADESCOM_CADES_BES, detachedSignature);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при подписании данных');\n }\n\n return signature;\n }),\n );\n },\n);\n","import { Certificate } from './certificate';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { getUserCertificates } from './getUserCertificates';\n\n/**\n * Возвращает сертификат по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат\n */\nexport const getCertificate = _afterPluginsLoaded(\n async (thumbprint: string): Promise => {\n if (!thumbprint) {\n throw new Error('Отпечаток не указан');\n }\n\n const availableCertificates: Certificate[] = await getUserCertificates();\n const foundCertificate: Certificate = availableCertificates.find((cert) => cert.thumbprint === thumbprint);\n\n if (!foundCertificate) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n return foundCertificate;\n },\n);\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nexport interface SystemInfo {\n cadesVersion: string;\n cspVersion: string;\n}\n\n/**\n * Предоставляет информацию о системе\n *\n * @returns информацию о CSP и плагине\n */\nexport const getSystemInfo = _afterPluginsLoaded(\n (): SystemInfo => {\n const sysInfo = {\n cadesVersion: null,\n cspVersion: null,\n };\n\n return eval(\n _generateCadesFn(function getSystemInfo(): SystemInfo {\n let cadesAbout;\n\n try {\n cadesAbout = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.About');\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.PluginVersion;\n sysInfo.cspVersion = __cadesAsyncToken__ + cadesAbout.CSPVersion();\n\n if (!sysInfo.cadesVersion) {\n sysInfo.cadesVersion = __cadesAsyncToken__ + cadesAbout.Version;\n }\n\n sysInfo.cadesVersion = __cadesAsyncToken__ + sysInfo.cadesVersion.toString();\n sysInfo.cspVersion = __cadesAsyncToken__ + sysInfo.cspVersion.toString();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении информации о системе');\n }\n\n return sysInfo;\n }),\n );\n },\n);\n","import { CadesCertificate, Certificate } from './certificate';\nimport { CAPICOM_PROPID_KEY_PROV_INFO } from '../constants';\nimport { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractCommonName } from '../helpers/_extractCommonName';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from '../helpers/_generateCadesFn';\n\nlet certificatesCache: Certificate[];\n\n/**\n * Возвращает список сертификатов, доступных пользователю в системе\n *\n * @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов\n * @returns список сертификатов\n */\nexport const getUserCertificates = _afterPluginsLoaded((resetCache: boolean = false): Certificate[] => {\n const { cadesplugin } = window;\n\n if (!resetCache && certificatesCache) {\n return certificatesCache;\n }\n\n return eval(\n _generateCadesFn(function getCertsList(): Certificate[] {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificates;\n let cadesCertificatesCount;\n\n try {\n cadesCertificates = __cadesAsyncToken__ + cadesStore.Certificates;\n\n if (cadesCertificates) {\n cadesCertificates =\n __cadesAsyncToken__ + cadesCertificates.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID);\n\n /**\n * Не рассматриваются сертификаты, в которых отсутствует закрытый ключ\n * или не действительны на данный момент\n */\n cadesCertificates =\n __cadesAsyncToken__ +\n cadesCertificates.Find(\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY,\n CAPICOM_PROPID_KEY_PROV_INFO,\n );\n\n cadesCertificatesCount = __cadesAsyncToken__ + cadesCertificates.Count;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!cadesCertificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n const certificateList: Certificate[] = [];\n\n try {\n while (cadesCertificatesCount) {\n const cadesCertificate: CadesCertificate =\n __cadesAsyncToken__ + cadesCertificates.Item(cadesCertificatesCount);\n\n certificateList.push(\n new Certificate(\n cadesCertificate,\n _extractCommonName(__cadesAsyncToken__ + cadesCertificate.SubjectName),\n __cadesAsyncToken__ + cadesCertificate.IssuerName,\n __cadesAsyncToken__ + cadesCertificate.SubjectName,\n __cadesAsyncToken__ + cadesCertificate.Thumbprint,\n __cadesAsyncToken__ + cadesCertificate.ValidFromDate,\n __cadesAsyncToken__ + cadesCertificate.ValidToDate,\n ),\n );\n\n cadesCertificatesCount--;\n }\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка обработки сертификатов');\n }\n\n cadesStore.Close();\n\n certificatesCache = certificateList;\n\n return certificatesCache;\n }),\n );\n});\n","export * from './getCertificate';\nexport * from './getUserCertificates';\nexport * from './getSystemInfo';\nexport * from './isValidSystemSetup';\nexport * from './createSignature';\nexport * from './certificate';\n","import { _afterPluginsLoaded } from '../helpers/_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from '../helpers/_extractMeaningfulErrorMessage';\nimport { _isSupportedCadesVersion } from '../helpers/_isSupportedCadesVersion';\nimport { _isSupportedCSPVersion } from '../helpers/_isSupportedCSPVersion';\nimport { getSystemInfo, SystemInfo } from './getSystemInfo';\n\n/**\n * Проверяет корректность настроек ЭП на машине\n *\n * @returns флаг корректности настроек\n */\nexport const isValidSystemSetup = _afterPluginsLoaded(\n async (): Promise => {\n let systemInfo: SystemInfo;\n\n try {\n systemInfo = await getSystemInfo();\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Настройки ЭП на данной машине не верны');\n }\n\n if (!_isSupportedCadesVersion(systemInfo.cadesVersion)) {\n throw new Error('Не поддерживаемая версия плагина');\n }\n\n if (!_isSupportedCSPVersion(systemInfo.cspVersion)) {\n throw new Error('Не поддерживаемая версия CSP');\n }\n\n return true;\n },\n);\n","export const CADESCOM_ATTRIBUTE_OTHER = -1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CADESCOM_AllowNoOutstandingRequest = 1;\nexport const CADESCOM_AllowNone = 0;\nexport const CADESCOM_AllowUntrustedCertificate = 2;\nexport const CADESCOM_AllowUntrustedRoot = 4;\nexport const CADESCOM_BASE64_TO_BINARY = 0x01;\nexport const CADESCOM_CADES_BES = 1;\nexport const CADESCOM_CADES_DEFAULT = 0;\nexport const CADESCOM_CADES_T = 5;\nexport const CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\nexport const CADESCOM_CONTAINER_STORE = 100;\nexport const CADESCOM_CURRENT_USER_STORE = 2;\nexport const CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\nexport const CADESCOM_DISPLAY_DATA_CONTENT = 1;\nexport const CADESCOM_DISPLAY_DATA_NONE = 0;\nexport const CADESCOM_ENCODE_ANY = -1;\nexport const CADESCOM_ENCODE_BASE64 = 0;\nexport const CADESCOM_ENCODE_BINARY = 1;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\nexport const CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\nexport const CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\nexport const CADESCOM_HASH_ALGORITHM_MD2 = 1;\nexport const CADESCOM_HASH_ALGORITHM_MD4 = 2;\nexport const CADESCOM_HASH_ALGORITHM_MD5 = 3;\nexport const CADESCOM_HASH_ALGORITHM_SHA1 = 0;\nexport const CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\nexport const CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\nexport const CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\nexport const CADESCOM_LOCAL_MACHINE_STORE = 1;\nexport const CADESCOM_PKCS7_TYPE = 65535;\nexport const CADESCOM_STRING_TO_UCS2LE = 0x00;\nexport const CADESCOM_SkipInstallToStore = 268435456;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\nexport const CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\nexport const CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\nexport const CAPICOM_ACTIVE_DIRECTORY_USER_STORE = 3;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\nexport const CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\nexport const CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\nexport const CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\nexport const CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\nexport const CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\nexport const CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\nexport const CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\nexport const CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\nexport const CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\nexport const CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\nexport const CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\nexport const CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\nexport const CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\nexport const CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\nexport const CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\nexport const CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\nexport const CAPICOM_CURRENT_USER_STORE = 2;\nexport const CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\nexport const CAPICOM_EKU_CLIENT_AUTH = 2;\nexport const CAPICOM_EKU_OTHER = 0;\nexport const CAPICOM_EKU_SMARTCARD_LOGON = 5;\nexport const CAPICOM_LOCAL_MACHINE_STORE = 1;\nexport const CAPICOM_MEMORY_STORE = 0;\nexport const CAPICOM_MY_STORE = 'My';\nexport const CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\nexport const CAPICOM_OID_OTHER = 0;\nexport const CAPICOM_PROPID_ACCESS_STATE = 14;\nexport const CAPICOM_PROPID_ARCHIVED = 19;\nexport const CAPICOM_PROPID_ARCHIVED_KEY_HASH = 65;\nexport const CAPICOM_PROPID_AUTO_ENROLL = 21;\nexport const CAPICOM_PROPID_CROSS_CERT_DIST_POINTS = 23;\nexport const CAPICOM_PROPID_CTL_USAGE = 9;\nexport const CAPICOM_PROPID_DATE_STAMP = 27;\nexport const CAPICOM_PROPID_DESCRIPTION = 13;\nexport const CAPICOM_PROPID_EFS = 17;\nexport const CAPICOM_PROPID_ENHKEY_USAGE = 9;\nexport const CAPICOM_PROPID_ENROLLMENT = 26;\nexport const CAPICOM_PROPID_EXTENDED_ERROR_INFO = 30;\nexport const CAPICOM_PROPID_FIRST_RESERVED = 66;\nexport const CAPICOM_PROPID_FIRST_USER = 0x00008000;\nexport const CAPICOM_PROPID_FORTEZZA_DATA = 18;\nexport const CAPICOM_PROPID_FRIENDLY_NAME = 11;\nexport const CAPICOM_PROPID_HASH_PROP = 3;\nexport const CAPICOM_PROPID_IE30_RESERVED = 7;\nexport const CAPICOM_PROPID_ISSUER_PUBLIC_KEY_MD5_HASH = 24;\nexport const CAPICOM_PROPID_ISSUER_SERIAL_NUMBER_MD5_HASH = 28;\nexport const CAPICOM_PROPID_KEY_CONTEXT = 5;\nexport const CAPICOM_PROPID_KEY_IDENTIFIER = 20;\nexport const CAPICOM_PROPID_KEY_PROV_HANDLE = 1;\nexport const CAPICOM_PROPID_KEY_PROV_INFO = 2;\nexport const CAPICOM_PROPID_KEY_SPEC = 6;\nexport const CAPICOM_PROPID_LAST_RESERVED = 0x00007fff;\nexport const CAPICOM_PROPID_LAST_USER = 0x0000ffff;\nexport const CAPICOM_PROPID_MD5_HASH = 4;\nexport const CAPICOM_PROPID_NEXT_UPDATE_LOCATION = 10;\nexport const CAPICOM_PROPID_PUBKEY_ALG_PARA = 22;\nexport const CAPICOM_PROPID_PUBKEY_HASH_RESERVED = 8;\nexport const CAPICOM_PROPID_PVK_FILE = 12;\nexport const CAPICOM_PROPID_RENEWAL = 64;\nexport const CAPICOM_PROPID_SHA1_HASH = 3;\nexport const CAPICOM_PROPID_SIGNATURE_HASH = 15;\nexport const CAPICOM_PROPID_SMART_CARD_DATA = 16;\nexport const CAPICOM_PROPID_SUBJECT_NAME_MD5_HASH = 29;\nexport const CAPICOM_PROPID_SUBJECT_PUBLIC_KEY_MD5_HASH = 25;\nexport const CAPICOM_PROPID_UNKNOWN = 0;\nexport const CAPICOM_SMART_CARD_USER_STORE = 4;\nexport const CAPICOM_STORE_OPEN_EXISTING_ONLY = 128;\nexport const CAPICOM_STORE_OPEN_INCLUDE_ARCHIVED = 256;\nexport const CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\nexport const CAPICOM_STORE_OPEN_READ_ONLY = 0;\nexport const CAPICOM_STORE_OPEN_READ_WRITE = 1;\nexport const CHECK_NONE = 0;\nexport const CHECK_OFFLINE_REVOCATION_STATUS = 16;\nexport const CHECK_ONLINE_REVOCATION_STATUS = 8;\nexport const CHECK_SIGNATURE_VALIDITY = 4;\nexport const CHECK_TIME_VALIDITY = 2;\nexport const CHECK_TRUSTED_ROOT = 1;\nexport const LOG_LEVEL_DEBUG = 4;\nexport const LOG_LEVEL_ERROR = 1;\nexport const LOG_LEVEL_INFO = 2;\nexport const TRUST_CTL_IS_NOT_SIGNATURE_VALID = 262144;\nexport const TRUST_CTL_IS_NOT_TIME_VALID = 131072;\nexport const TRUST_CTL_IS_NOT_VALID_FOR_USAGE = 524288;\nexport const TRUST_IS_CYCLIC = 128;\nexport const TRUST_IS_NOT_SIGNATURE_VALID = 8;\nexport const TRUST_IS_NOT_TIME_NESTED = 2;\nexport const TRUST_IS_NOT_TIME_VALID = 1;\nexport const TRUST_IS_NOT_VALID_FOR_USAGE = 16;\nexport const TRUST_IS_PARTIAL_CHAIN = 65536;\nexport const TRUST_IS_REVOKED = 4;\nexport const TRUST_IS_UNTRUSTED_ROOT = 32;\nexport const TRUST_REVOCATION_STATUS_UNKNOWN = 64;\nexport const XmlDsigGost3410Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411';\nexport const XmlDsigGost3410UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411';\nexport const XmlDsigGost3411Url = 'urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411';\nexport const XmlDsigGost3411UrlObsolete = 'http://www.w3.org/2001/04/xmldsig-more#gostr3411';\n","export * from './cades-constants';\nexport * from './issuer-tags-translations';\nexport * from './oids-dictionary';\nexport * from './subject-tags-translations';\n","import { TagsTranslations } from './tags-translations';\n\nexport const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Удостоверяющий центр' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Тип' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","export const OIDS_DICTIONARY = {\n '1.2.643.2.2.34.6': 'Пользователь Центра Регистрации',\n '1.2.643.2.39.1.1': 'Использование в программных продуктах системы \"1С:Предприятие 8\"',\n '1.2.643.3.131.1.1': 'ИНН',\n '1.2.643.3.141.1.1': 'РНС ФСС',\n '1.2.643.3.141.1.2': 'КП ФСС',\n '1.2.643.3.2.100.65.13.11': 'Использование в системе АИС \"Госзакупки\" Сахалинской области.',\n '1.2.643.3.8.100.1': 'Сертификат типа \"ekey-ГОСТ\"',\n '1.2.643.3.8.100.1.1': 'Общее использование в системах ИОК без права заверения финансовых документов',\n '1.2.643.3.8.100.1.10':\n 'Для участия в электронных торгах и подписания государственного контракта в информационных системах Тендерного комитета города Москвы уполномоченными лицами участников размещения государственного заказа города Москвы',\n '1.2.643.3.8.100.1.11':\n 'Подписание электронных документов в автоматизированной информационной системе размещения государственного и муниципального заказа Саратовской области',\n '1.2.643.3.8.100.1.12': 'Использование в системе государственного заказа Иркутской области',\n '1.2.643.3.8.100.1.13':\n 'Использование в электронной торговой площадке агентства государственного заказа Красноярского края',\n '1.2.643.3.8.100.1.14': 'Использование в электронной торговой площадке \"Тендер\"',\n '1.2.643.3.8.100.1.2': 'Передача отчетности по ТКС',\n '1.2.643.3.8.100.1.3': 'Оформление взаимных обязательств, соглашений, договоров, актов и т.п.',\n '1.2.643.3.8.100.1.4': 'Внутрикорпоративный документооборот',\n '1.2.643.3.8.100.1.5': 'Использование в системах электронной торговли',\n '1.2.643.3.8.100.1.6': 'Использование в торгово-закупочной системе \"ЭЛЕКТРА\"',\n '1.2.643.3.8.100.1.7': 'Использование в системе Портал государственных закупок Ставропольского края.',\n '1.2.643.3.8.100.1.8': 'Использование в Единой системе электронной торговли B2B-Center и B2G.',\n '1.2.643.3.8.100.1.9':\n 'Для участия в электронных торгах и подписания государственного контракта в электронной площадке ОАО «ЕЭТП» уполномоченными лицами участников размещения государственного или муниципального заказа',\n '1.2.643.5.1.24.2.1.3':\n 'Формирование документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.1.3.1':\n 'Формирование кадастровым инженером документов для получения государственных услуг в сфере ведения государственного кадастра недвижимости со стороны заявителя',\n '1.2.643.5.1.24.2.2.2': 'Формирование документов как результата оказания услуги со стороны органов регистрации прав',\n '1.2.643.5.1.24.2.2.3':\n 'Формирование документов для получения государственных услуг в сфере государственной регистрации прав на недвижимое имущество и сделок с ним со стороны заявителя',\n '1.2.643.6.2.1.7.1':\n 'Использование единоличным исполнительным органом юридического лица или уполномоченными представителями юридического лица в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских и иных прав и обязанностей в сфере негосударственного пенсионного обеспечения, негосударственного пенсионного страхования, в сфере деятельности паевых инвестиционных фондов, акционерных инвестиционных фондов, профессиональных участников рынка ценных бумаг, а также связанной с обслуживанием указанной деятельности услуг кредитных и иных организаций',\n '1.2.643.6.2.1.7.2':\n 'Использование физическим лицом в отношениях, связанных с возникновением, исполнением (осуществлением) и прекращением гражданских прав и обязанностей в отношении инвестиционных паев паевых инвестиционных фондов, в том числе отношения, связанные с учетом и/или фиксацией прав на инвестиционные паи паевых инвестиционных фондов',\n '1.2.643.6.3':\n 'Использование в электронных торговых системах и в программном обеспечении, связанным с обменом электронных сообщений',\n '1.2.643.6.3.1.1': 'Использование на электронных площадок отобранных для проведения аукционах в электронной форме',\n '1.2.643.6.3.1.2.1': 'Тип участника - Юридическое лицо',\n '1.2.643.6.3.1.2.2': 'Тип участника - Физическое лицо',\n '1.2.643.6.3.1.2.3': 'Тип участника - Индивидуальный предприниматель',\n '1.2.643.6.3.1.3.1': 'Участник размещения заказа',\n '1.2.643.6.3.1.4.1': 'Администратор организации',\n '1.2.643.6.3.1.4.2': 'Уполномоченный специалист',\n '1.2.643.6.3.1.4.3': 'Специалист с правом подписи контракта',\n '1.2.840.113549.1.9.2': 'Неструктурированное имя',\n '1.3.6.1.4.1.24138.1.1.8.1': 'Обеспечение юридической значимости в Системе \"Электронная Торговая Площадка\"',\n '1.3.6.1.4.1.29919.21': 'Использование в системе Портал государственных закупок Ростовской области \"Рефери\".',\n '1.3.6.1.5.5.7.3.2': 'Проверка подлинности клиента',\n '1.3.6.1.5.5.7.3.4': 'Защищенная электронная почта',\n '1.3.643.3.8.100.15': 'Использование в ЭТП \"uTender\"',\n};\n","import { TagsTranslations } from './tags-translations';\n\nexport const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[] = [\n { possibleNames: ['UnstructuredName'], translation: 'Неструктурированное имя' },\n { possibleNames: ['CN'], translation: 'Владелец' },\n { possibleNames: ['SN'], translation: 'Фамилия' },\n { possibleNames: ['G'], translation: 'Имя Отчество' },\n { possibleNames: ['C'], translation: 'Страна' },\n { possibleNames: ['S'], translation: 'Регион' },\n { possibleNames: ['STREET'], translation: 'Адрес' },\n { possibleNames: ['O'], translation: 'Компания' },\n { possibleNames: ['OU'], translation: 'Отдел/подразделение' },\n { possibleNames: ['T'], translation: 'Должность' },\n { possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },\n { possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },\n { possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },\n { possibleNames: ['ИНН', 'INN'], translation: 'ИНН' },\n { possibleNames: ['E'], translation: 'Email' },\n { possibleNames: ['L'], translation: 'Город' },\n];\n","export * from './api';\n","import { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\n\ntype Unpromisify = T extends Promise ? R : T;\n\nlet isSetLogLevel = false;\nlet isPluginLoaded = false;\n\nexport const _afterPluginsLoaded = any>(\n fn: T,\n): ((...args: Parameters) => Promise>>) => {\n const canPromise = Boolean(window.Promise);\n\n return async function (...args: Parameters): Promise>> {\n if (!isPluginLoaded) {\n try {\n require('../vendor/cadesplugin_api');\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при подключении модуля для работы с Cades plugin',\n );\n }\n\n isPluginLoaded = true;\n }\n\n const { cadesplugin } = window;\n\n if (!canPromise) {\n throw new Error('Необходим полифилл для Promise');\n }\n\n if (!cadesplugin) {\n throw new Error('Не подключен модуль для работы с Cades plugin');\n }\n\n if (!isSetLogLevel) {\n cadesplugin.set_log_level(cadesplugin.LOG_LEVEL_ERROR);\n\n isSetLogLevel = true;\n }\n\n try {\n await cadesplugin;\n } catch (error) {\n console.error(error);\n\n throw new Error(\n _extractMeaningfulErrorMessage(error) || 'Ошибка при инициализации модуля для работы с Cades plugin',\n );\n }\n\n return await fn.apply(this, args);\n };\n};\n","export const _extractCommonName = (subjectName: string): string | undefined =>\n subjectName.match(/CN=(.+?)(?:,|$)/)?.[1];\n","export const _extractMeaningfulErrorMessage = (error: Error): string | null => {\n let errorContainer = window.cadesplugin?.getLastError && window.cadesplugin.getLastError(error);\n\n if (!errorContainer?.message) {\n if (!error.message) {\n return null;\n }\n\n errorContainer = error;\n }\n\n const containsRussianLetters = /[а-яА-Я]/.test(errorContainer.message);\n\n if (!containsRussianLetters) {\n return null;\n }\n\n const searchResult = errorContainer.message.match(/^(.*?)(?:(?:\\.?\\s?\\(?0x)|(?:\\.?$))/);\n\n return searchResult ? searchResult[1] : null;\n};\n","// синтетические переменные, которые подменяются в рантайме\nexport const __cadesAsyncToken__ = {};\nexport const __createCadesPluginObject__ = (...args): any => ({});\n\nfunction getGeneratorConstructor(): GeneratorFunction {\n return new Function('', 'return Object.getPrototypeOf(function*(){}).constructor')();\n}\n\nexport const _generateCadesFn = (callback: Function): string => {\n const { cadesplugin } = window;\n const cadesGeneratorsAPI = Boolean(cadesplugin.CreateObjectAsync);\n const callbackName = callback.name || 'dynamicFn';\n const callbackLiteral = String(callback);\n const callbackArguments = callbackLiteral.match(/^function[\\s\\w]*?\\((.*?)\\)/)?.[1] || '';\n const callbackBody = callbackLiteral.replace(/^.*?{([\\s\\S]*?)}$/, '$1');\n let crossEnvCallbackLiteral = String(\n new (cadesGeneratorsAPI ? getGeneratorConstructor() : Function)(callbackArguments, callbackBody),\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__createCadesPluginObject__(\\([\\s\\S]*?\\))/gm,\n `cadesplugin.CreateObject${cadesGeneratorsAPI ? 'Async' : ''}$1`,\n );\n\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(\n /\\w+?\\.__cadesAsyncToken__\\s*?\\+\\s*?\\b/gm,\n cadesGeneratorsAPI ? 'yield ' : '',\n );\n\n if (!cadesGeneratorsAPI) {\n crossEnvCallbackLiteral = crossEnvCallbackLiteral.replace(/propset_(.*?)\\((.*?)\\)/gm, '$1 = $2');\n }\n\n return [\n cadesGeneratorsAPI ? `cadesplugin.async_spawn(${crossEnvCallbackLiteral});` : `(${crossEnvCallbackLiteral})();`,\n `//# sourceURL=crypto-pro_${callbackName}.js`,\n ].join('');\n};\n","import { CadesCertificate } from '../api/certificate';\nimport { _afterPluginsLoaded } from './_afterPluginsLoaded';\nimport { _extractMeaningfulErrorMessage } from './_extractMeaningfulErrorMessage';\nimport { __cadesAsyncToken__, __createCadesPluginObject__, _generateCadesFn } from './_generateCadesFn';\n\n/**\n * Возвращает сертификат в формате Cades по отпечатку\n *\n * @param thumbprint - отпечаток сертификата\n * @returns сертификат в формате Cades\n */\nexport const _getCadesCert = _afterPluginsLoaded(\n (thumbprint: string): CadesCertificate => {\n const { cadesplugin } = window;\n\n return eval(\n _generateCadesFn(function _getCadesCert() {\n let cadesStore;\n\n try {\n cadesStore = __cadesAsyncToken__ + __createCadesPluginObject__('CAdESCOM.Store');\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при попытке доступа к хранилищу');\n }\n\n if (!cadesStore) {\n throw new Error('Не удалось получить доступ к хранилищу сертификатов');\n }\n\n try {\n void (\n __cadesAsyncToken__ +\n cadesStore.Open(\n cadesplugin.CAPICOM_CURRENT_USER_STORE,\n cadesplugin.CAPICOM_MY_STORE,\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED,\n )\n );\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при открытии хранилища');\n }\n\n let cadesCertificateList;\n let certificatesCount;\n\n try {\n cadesCertificateList = __cadesAsyncToken__ + cadesStore.Certificates;\n certificatesCount = __cadesAsyncToken__ + cadesCertificateList.Count;\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка получения списка сертификатов');\n }\n\n if (!certificatesCount) {\n throw new Error('Нет доступных сертификатов');\n }\n\n let cadesCertificate: CadesCertificate;\n\n try {\n cadesCertificateList =\n __cadesAsyncToken__ + cadesCertificateList.Find(cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH, thumbprint);\n\n const count = __cadesAsyncToken__ + cadesCertificateList.Count;\n\n if (!count) {\n throw new Error(`Сертификат с отпечатком: \"${thumbprint}\" не найден`);\n }\n\n cadesCertificate = __cadesAsyncToken__ + cadesCertificateList.Item(1);\n } catch (error) {\n console.error(error);\n\n throw new Error(_extractMeaningfulErrorMessage(error) || 'Ошибка при получении сертификата');\n }\n\n cadesStore.Close();\n\n return cadesCertificate;\n }),\n );\n },\n);\n","/**\n * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера.\n *\n * В IE необходимо использовать специфичный формат \"VT_DATE\"\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate\n */\nexport const _getDateObj = (dateObj): Date => (dateObj.getVarDate ? dateObj.getVarDate() : dateObj);\n","const oldestSupportedCSPVersion = 4.0;\n\nexport const _isSupportedCSPVersion = (version: string): boolean => {\n version = version.match(/\\d+?\\b(?:\\.\\d+)?/)?.[0];\n\n return Number(version) >= oldestSupportedCSPVersion;\n};\n","export const _isSupportedCadesVersion = (version: string): boolean => {\n const match = version.match(/(\\d+)\\.(\\d+)\\.(\\d+)/);\n\n if (!match) {\n return false;\n }\n\n const [, major, minor, patch] = match;\n\n if (Number(major) < 2) {\n return false;\n }\n\n if (Number(major) === 2 && Number(patch) < 12438) {\n return false;\n }\n\n return true;\n};\n","import { OIDS_DICTIONARY } from '../constants';\nimport { TagsTranslations } from '../constants/tags-translations';\n\nexport interface TagTranslation {\n description: string;\n title: string;\n isTranslated: boolean;\n}\n\n/**\n * Парсит информацию из строки с информацией о сертификате\n *\n * @param tagsTranslations - словарь с расшифровками тэгов\n * @param rawInfo - данные для парсинга\n * @returns расшифрованная информация по отдельным тэгам\n */\nexport const _parseCertInfo = (tagsTranslations: TagsTranslations[], rawInfo: string): TagTranslation[] => {\n const extractedEntities: string[] = rawInfo.match(/([а-яА-Яa-zA-Z0-9.]+)=(?:(\"[^\"]+?\")|(.+?))(?:,|$)/g);\n\n if (extractedEntities) {\n return extractedEntities.map((group) => {\n const segmentsMatch = group.match(/^([а-яА-Яa-zA-Z0-9.]+)=(.+?),?$/);\n let title = segmentsMatch?.[1];\n // Вырезаем лишние кавычки\n const description = segmentsMatch?.[2]?.replace(/^\"(.*)\"/, '$1')?.replace(/\"{2}/g, '\"');\n const oidIdentifierMatch = title?.match(/^OID\\.(.*)/);\n const oidIdentifier = oidIdentifierMatch?.[1];\n let isTranslated = false;\n\n // Если нашли в тайтле ОИД, пытаемся его расшифровать\n if (oidIdentifier) {\n const oidTranslation = OIDS_DICTIONARY[oidIdentifier];\n\n if (oidTranslation) {\n title = oidTranslation;\n isTranslated = true;\n }\n }\n\n const tagTranslation = tagsTranslations.find((tag) => tag.possibleNames.find((name) => name === title))\n ?.translation;\n\n if (tagTranslation) {\n title = tagTranslation;\n isTranslated = true;\n }\n\n return { description, title, isTranslated };\n });\n }\n};\n",";(function () {\n //already loaded\n if(window.cadesplugin)\n return;\n\n var pluginObject;\n var plugin_resolved = 0;\n var plugin_reject;\n var plugin_resolve;\n var isOpera = 0;\n var isFireFox = 0;\n var isEdge = 0;\n var isSafari = 0;\n var failed_extensions = 0;\n\n var canPromise = !!window.Promise;\n var cadesplugin;\n\n if(canPromise)\n {\n cadesplugin = new Promise(function(resolve, reject)\n {\n plugin_resolve = resolve;\n plugin_reject = reject;\n });\n } else\n {\n cadesplugin = {};\n }\n\n function check_browser() {\n var ua= navigator.userAgent, tem, M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\n if(/trident/i.test(M[1])){\n tem= /\\brv[ :]+(\\d+)/g.exec(ua) || [];\n return {name:'IE',version:(tem[1] || '')};\n }\n if(M[1]=== 'Chrome'){\n tem= ua.match(/\\b(OPR|Edge)\\/(\\d+)/);\n if(tem!= null) return {name:tem[1].replace('OPR', 'Opera'),version:tem[2]};\n }\n M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];\n if((tem= ua.match(/version\\/(\\d+)/i))!= null) M.splice(1, 1, tem[1]);\n return {name:M[0],version:M[1]};\n }\n var browserSpecs = check_browser();\n\n function cpcsp_console_log(level, msg){\n //IE9 не может писать в консоль если не открыта вкладка developer tools\n if(typeof(console) === 'undefined')\n return;\n if (level <= cadesplugin.current_log_level ){\n if (level === cadesplugin.LOG_LEVEL_DEBUG)\n console.log(\"DEBUG: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_INFO)\n console.info(\"INFO: %s\", msg);\n if (level === cadesplugin.LOG_LEVEL_ERROR)\n console.error(\"ERROR: %s\", msg);\n return;\n }\n }\n\n function set_log_level(level){\n if (!((level === cadesplugin.LOG_LEVEL_DEBUG) ||\n (level === cadesplugin.LOG_LEVEL_INFO) ||\n (level === cadesplugin.LOG_LEVEL_ERROR))){\n cpcsp_console_log(cadesplugin.LOG_LEVEL_ERROR, \"cadesplugin_api.js: Incorrect log_level: \" + level);\n return;\n }\n cadesplugin.current_log_level = level;\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = DEBUG\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = INFO\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n cpcsp_console_log(cadesplugin.LOG_LEVEL_INFO, \"cadesplugin_api.js: log_level = ERROR\");\n if(isNativeMessageSupported())\n {\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_DEBUG)\n window.postMessage(\"set_log_level=debug\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_INFO)\n window.postMessage(\"set_log_level=info\", \"*\");\n if (cadesplugin.current_log_level === cadesplugin.LOG_LEVEL_ERROR)\n window.postMessage(\"set_log_level=error\", \"*\");\n }\n }\n\n function set_constantValues()\n {\n cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CAPICOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1;\n cadesplugin.CADESCOM_CURRENT_USER_STORE = 2;\n cadesplugin.CADESCOM_CONTAINER_STORE = 100;\n\n cadesplugin.CAPICOM_MY_STORE = \"My\";\n\n cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPED = 0;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_ENVELOPING = 1;\n cadesplugin.CADESCOM_XML_SIGNATURE_TYPE_TEMPLATE = 2;\n\n cadesplugin.XmlDsigGost3410UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411UrlObsolete = \"http://www.w3.org/2001/04/xmldsig-more#gostr3411\";\n cadesplugin.XmlDsigGost3410Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr34102001-gostr3411\";\n cadesplugin.XmlDsigGost3411Url = \"urn:ietf:params:xml:ns:cpxmlsec:algorithms:gostr3411\";\n\n cadesplugin.CADESCOM_CADES_DEFAULT = 0;\n cadesplugin.CADESCOM_CADES_BES = 1;\n cadesplugin.CADESCOM_CADES_T = 0x5;\n cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1 = 0x5d;\n cadesplugin.CADESCOM_PKCS7_TYPE = 0xffff;\n\n cadesplugin.CADESCOM_ENCODE_BASE64 = 0;\n cadesplugin.CADESCOM_ENCODE_BINARY = 1;\n cadesplugin.CADESCOM_ENCODE_ANY = -1;\n\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_CHAIN_EXCEPT_ROOT = 0;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_WHOLE_CHAIN = 1;\n cadesplugin.CAPICOM_CERTIFICATE_INCLUDE_END_ENTITY_ONLY = 2;\n\n cadesplugin.CAPICOM_CERT_INFO_SUBJECT_SIMPLE_NAME = 0;\n cadesplugin.CAPICOM_CERT_INFO_ISSUER_SIMPLE_NAME = 1;\n\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SHA1_HASH = 0;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ISSUER_NAME = 2;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_ROOT_NAME = 3;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TEMPLATE_NAME = 4;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENSION = 5;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_EXTENDED_PROPERTY = 6;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_APPLICATION_POLICY = 7;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_CERTIFICATE_POLICY = 8;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_VALID = 9;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_NOT_YET_VALID = 10;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_TIME_EXPIRED = 11;\n cadesplugin.CAPICOM_CERTIFICATE_FIND_KEY_USAGE = 12;\n\n cadesplugin.CAPICOM_DIGITAL_SIGNATURE_KEY_USAGE = 128;\n\n cadesplugin.CAPICOM_PROPID_ENHKEY_USAGE = 9;\n\n cadesplugin.CAPICOM_OID_OTHER = 0;\n cadesplugin.CAPICOM_OID_KEY_USAGE_EXTENSION = 10;\n\n cadesplugin.CAPICOM_EKU_CLIENT_AUTH = 2;\n cadesplugin.CAPICOM_EKU_SMARTCARD_LOGON = 5;\n cadesplugin.CAPICOM_EKU_OTHER = 0;\n\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CAPICOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_SIGNING_TIME = 0;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_NAME = 1;\n cadesplugin.CADESCOM_AUTHENTICATED_ATTRIBUTE_DOCUMENT_DESCRIPTION = 2;\n cadesplugin.CADESCOM_ATTRIBUTE_OTHER = -1;\n\n cadesplugin.CADESCOM_STRING_TO_UCS2LE = 0;\n cadesplugin.CADESCOM_BASE64_TO_BINARY = 1;\n\n cadesplugin.CADESCOM_DISPLAY_DATA_NONE = 0;\n cadesplugin.CADESCOM_DISPLAY_DATA_CONTENT = 1;\n cadesplugin.CADESCOM_DISPLAY_DATA_ATTRIBUTE = 2;\n\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC2 = 0;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_RC4 = 1;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_DES = 2;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_3DES = 3;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_AES = 4;\n cadesplugin.CADESCOM_ENCRYPTION_ALGORITHM_GOST_28147_89 = 25;\n\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA1 = 0;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD2 = 1;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD4 = 2;\n cadesplugin.CADESCOM_HASH_ALGORITHM_MD5 = 3;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_256 = 4;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_384 = 5;\n cadesplugin.CADESCOM_HASH_ALGORITHM_SHA_512 = 6;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411 = 100;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256 = 101;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512 = 102;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_HMAC = 110;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_256_HMAC = 111;\n cadesplugin.CADESCOM_HASH_ALGORITHM_CP_GOST_3411_2012_512_HMAC = 112;\n\n cadesplugin.LOG_LEVEL_DEBUG = 4;\n cadesplugin.LOG_LEVEL_INFO = 2;\n cadesplugin.LOG_LEVEL_ERROR = 1;\n\n cadesplugin.CADESCOM_AllowNone = 0;\n cadesplugin.CADESCOM_AllowNoOutstandingRequest = 0x1;\n cadesplugin.CADESCOM_AllowUntrustedCertificate = 0x2;\n cadesplugin.CADESCOM_AllowUntrustedRoot = 0x4;\n cadesplugin.CADESCOM_SkipInstallToStore = 0x10000000;\n }\n\n function async_spawn(generatorFunc) {\n function continuer(verb, arg) {\n var result;\n try {\n result = generator[verb](arg);\n } catch (err) {\n return Promise.reject(err);\n }\n if (result.done) {\n return result.value;\n } else {\n return Promise.resolve(result.value).then(onFulfilled, onRejected);\n }\n }\n var generator = generatorFunc(Array.prototype.slice.call(arguments, 1));\n var onFulfilled = continuer.bind(continuer, \"next\");\n var onRejected = continuer.bind(continuer, \"throw\");\n return onFulfilled();\n }\n\n function isIE() {\n // var retVal = ((\"Microsoft Internet Explorer\" == navigator.appName) || // IE < 11\n // navigator.userAgent.match(/Trident\\/./i)); // IE 11\n return (browserSpecs.name === 'IE' || browserSpecs.name === 'MSIE');\n }\n\n function isIOS() {\n return (navigator.userAgent.match(/ipod/i) ||\n navigator.userAgent.match(/ipad/i) ||\n navigator.userAgent.match(/iphone/i));\n }\n\n function isNativeMessageSupported()\n {\n // В IE работаем через NPAPI\n if(isIE())\n return false;\n // В Edge работаем через NativeMessage\n if(browserSpecs.name === 'Edge') {\n isEdge = true;\n return true;\n }\n // В Chrome, Firefox, Safari и Opera работаем через асинхронную версию в зависимости от версии\n if(browserSpecs.name === 'Opera') {\n isOpera = true;\n if(browserSpecs.version >= 33){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Firefox') {\n isFireFox = true;\n if(browserSpecs.version >= 52){\n return true;\n }\n else{\n return false;\n }\n }\n if(browserSpecs.name === 'Chrome') {\n if(browserSpecs.version >= 42){\n return true;\n }\n else{\n return false;\n }\n }\n //В Сафари начиная с 12 версии нет NPAPI\n if(browserSpecs.name === 'Safari') {\n isSafari = true;\n if(browserSpecs.version >= 12) {\n return true;\n } else {\n return false;\n }\n }\n }\n\n // Функция активации объектов КриптоПро ЭЦП Browser plug-in\n function CreateObject(name) {\n if (isIOS()) {\n // На iOS для создания объектов используется функция\n // call_ru_cryptopro_npcades_10_native_bridge, определенная в IOS_npcades_supp.js\n return call_ru_cryptopro_npcades_10_native_bridge(\"CreateObject\", [name]);\n }\n if (isIE()) {\n // В Internet Explorer создаются COM-объекты\n if (name.match(/X509Enrollment/i)) {\n try {\n // Объекты CertEnroll пробуем создавать через нашу фабрику,\n // если не получилось то через CX509EnrollmentWebClassFactory\n var objCertEnrollClassFactory = document.getElementById(\"webClassFactory\");\n return objCertEnrollClassFactory.CreateObject(name);\n }\n catch (e) {\n try {\n var objWebClassFactory = document.getElementById(\"certEnrollClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (err) {\n throw (\"Для создания обьектов X509Enrollment следует настроить веб-узел на использование проверки подлинности по протоколу HTTPS\");\n }\n }\n }\n // Объекты CAPICOM и CAdESCOM создаются через CAdESCOM.WebClassFactory\n try {\n var objWebClassFactory = document.getElementById(\"webClassFactory\");\n return objWebClassFactory.CreateObject(name);\n }\n catch (e) {\n // Для версий плагина ниже 2.0.12538\n return new ActiveXObject(name);\n }\n }\n // создаются объекты NPAPI\n return pluginObject.CreateObject(name);\n }\n\n function decimalToHexString(number) {\n if (number < 0) {\n number = 0xFFFFFFFF + number + 1;\n }\n\n return number.toString(16).toUpperCase();\n }\n\n function GetMessageFromException(e) {\n var err = e.message;\n if (!err) {\n err = e;\n } else if (e.number) {\n err += \" (0x\" + decimalToHexString(e.number) + \")\";\n }\n return err;\n }\n\n function getLastError(exception) {\n if(isNativeMessageSupported() || isIE() || isIOS() ) {\n return GetMessageFromException(exception);\n }\n\n try {\n return pluginObject.getLastError();\n } catch(e) {\n return GetMessageFromException(exception);\n }\n }\n\n // Функция для удаления созданных объектов\n function ReleasePluginObjects() {\n return cpcsp_chrome_nmcades.ReleasePluginObjects();\n }\n\n // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in\n function CreateObjectAsync(name) {\n return pluginObject.CreateObjectAsync(name);\n }\n\n //Функции для IOS\n var ru_cryptopro_npcades_10_native_bridge = {\n callbacksCount : 1,\n callbacks : {},\n\n // Automatically called by native layer when a result is available\n resultForCallback : function resultForCallback(callbackId, resultArray) {\n var callback = ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId];\n if (!callback) return;\n callback.apply(null,resultArray);\n },\n\n // Use this in javascript to request native objective-c code\n // functionName : string (I think the name is explicit :p)\n // args : array of arguments\n // callback : function with n-arguments that is going to be called when the native code returned\n call : function call(functionName, args, callback) {\n var hasCallback = callback && typeof callback === \"function\";\n var callbackId = hasCallback ? ru_cryptopro_npcades_10_native_bridge.callbacksCount++ : 0;\n\n if (hasCallback)\n ru_cryptopro_npcades_10_native_bridge.callbacks[callbackId] = callback;\n\n var iframe = document.createElement(\"IFRAME\");\n var arrObjs = new Array(\"_CPNP_handle\");\n try{\n iframe.setAttribute(\"src\", \"cpnp-js-call:\" + functionName + \":\" + callbackId+ \":\" + encodeURIComponent(JSON.stringify(args, arrObjs)));\n } catch(e){\n alert(e);\n }\n document.documentElement.appendChild(iframe);\n iframe.parentNode.removeChild(iframe);\n iframe = null;\n }\n };\n\n function call_ru_cryptopro_npcades_10_native_bridge(functionName, array){\n var tmpobj;\n var ex;\n ru_cryptopro_npcades_10_native_bridge.call(functionName, array, function(e, response){\n ex = e;\n var str='tmpobj='+response;\n eval(str);\n if (typeof (tmpobj) === \"string\"){\n tmpobj = tmpobj.replace(/\\\\\\n/gm, \"\\n\");\n tmpobj = tmpobj.replace(/\\\\\\r/gm, \"\\r\");\n }\n });\n if(ex)\n throw ex;\n return tmpobj;\n }\n\n function show_firefox_missing_extension_dialog()\n {\n if (!window.cadesplugin_skip_extension_install)\n {\n var ovr = document.createElement('div');\n ovr.id = \"cadesplugin_ovr\";\n ovr.style = \"visibility: hidden; position: fixed; left: 0px; top: 0px; width:100%; height:100%; background-color: rgba(0,0,0,0.7)\";\n ovr.innerHTML = \"
\" +\n \"\" +\n \"

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

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

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

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

\" +\n \"
\";\n document.getElementsByTagName(\"Body\")[0].appendChild(ovr);\n var btn_install = document.getElementById(\"cadesplugin_install\");\n btn_install.addEventListener('click', function(event) {\n opr.addons.installExtension(\"epebfcehmdedogndhlcacafjaacknbcm\",\n function()\n {\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n location.reload();\n },\n function(){})\n });\n document.getElementById(\"cadesplugin_close_install\").addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n\n ovr.addEventListener('click',function()\n {\n plugin_loaded_error(\"Плагин недоступен\");\n document.getElementById(\"cadesplugin_ovr\").style.visibility = 'hidden';\n });\n ovr.style.visibility=\"visible\";\n document.getElementById(\"cadesplugin_ovr_item\").addEventListener('click',function(e){\n e.stopPropagation();\n });\n });\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n\n function firefox_or_edge_nmcades_onload() {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n\n function nmcades_api_onload () {\n window.postMessage(\"cadesplugin_echo_request\", \"*\");\n window.addEventListener(\"message\", function (event){\n if (typeof(event.data) !== \"string\" || !event.data.match(\"cadesplugin_loaded\"))\n return;\n if(isFireFox || isEdge || isSafari)\n {\n // Для Firefox, Сафари, Edge вместе с сообщением cadesplugin_loaded прилетает url для загрузки nmcades_plugin_api.js\n var url = event.data.substring(event.data.indexOf(\"url:\") + 4);\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", url);\n fileref.onerror = plugin_loaded_error;\n fileref.onload = firefox_or_edge_nmcades_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n // Для Firefox, Safari и Edge у нас только по одному расширению.\n failed_extensions++;\n }else {\n cpcsp_chrome_nmcades.check_chrome_plugin(plugin_loaded, plugin_loaded_error);\n }\n }, false);\n }\n\n //Загружаем расширения для Chrome, Opera, YaBrowser, FireFox, Edge, Safari\n function load_extension()\n {\n\n if(isFireFox || isEdge || isSafari){\n // вызываем callback руками т.к. нам нужно узнать ID расширения. Он уникальный для браузера.\n nmcades_api_onload();\n } else {\n // в асинхронном варианте для chrome и opera подключаем оба расширения\n var fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://iifchhfnnmpdbibifmljnfjhpififfog/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n fileref = document.createElement('script');\n fileref.setAttribute(\"type\", \"text/javascript\");\n fileref.setAttribute(\"src\", \"chrome-extension://epebfcehmdedogndhlcacafjaacknbcm/nmcades_plugin_api.js\");\n fileref.onerror = plugin_loaded_error;\n fileref.onload = nmcades_api_onload;\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n }\n }\n\n //Загружаем плагин для NPAPI\n function load_npapi_plugin()\n {\n var elem = document.createElement('object');\n elem.setAttribute(\"id\", \"cadesplugin_object\");\n elem.setAttribute(\"type\", \"application/x-cades\");\n elem.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem);\n pluginObject = document.getElementById(\"cadesplugin_object\");\n if(isIE())\n {\n var elem1 = document.createElement('object');\n elem1.setAttribute(\"id\", \"certEnrollClassFactory\");\n elem1.setAttribute(\"classid\", \"clsid:884e2049-217d-11da-b2a4-000e7bbb2b09\");\n elem1.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem1);\n var elem2 = document.createElement('object');\n elem2.setAttribute(\"id\", \"webClassFactory\");\n elem2.setAttribute(\"classid\", \"clsid:B04C8637-10BD-484E-B0DA-B8A039F60024\");\n elem2.setAttribute(\"style\", \"visibility: hidden\");\n document.getElementsByTagName(\"body\")[0].appendChild(elem2);\n }\n }\n\n //Отправляем событие что все ок.\n function plugin_loaded()\n {\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_resolve();\n }else {\n window.postMessage(\"cadesplugin_loaded\", \"*\");\n }\n }\n\n //Отправляем событие что сломались.\n function plugin_loaded_error(msg)\n {\n if(isNativeMessageSupported())\n {\n //в асинхронном варианте подключаем оба расширения, если сломались оба пробуем установить для Opera\n failed_extensions++;\n if(failed_extensions<2)\n return;\n if(isOpera && (typeof(msg) === 'undefined'|| typeof(msg) === 'object'))\n {\n install_opera_extension();\n return;\n }\n }\n if(typeof(msg) === 'undefined' || typeof(msg) === 'object')\n msg = \"Плагин недоступен\";\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(msg);\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n }\n\n //проверяем что у нас хоть какое то событие ушло, и если не уходило кидаем еще раз ошибку\n function check_load_timeout()\n {\n if(plugin_resolved === 1)\n return;\n if(isFireFox)\n {\n show_firefox_missing_extension_dialog();\n }\n plugin_resolved = 1;\n if(canPromise)\n {\n plugin_reject(\"Истекло время ожидания загрузки плагина\");\n } else {\n window.postMessage(\"cadesplugin_load_error\", \"*\");\n }\n\n }\n\n //Вспомогательная функция для NPAPI\n function createPromise(arg)\n {\n return new Promise(arg);\n }\n\n function check_npapi_plugin (){\n try {\n var oAbout = CreateObject(\"CAdESCOM.About\");\n plugin_loaded();\n }\n catch (err) {\n document.getElementById(\"cadesplugin_object\").style.display = 'none';\n // Объект создать не удалось, проверим, установлен ли\n // вообще плагин. Такая возможность есть не во всех браузерах\n var mimetype = navigator.mimeTypes[\"application/x-cades\"];\n if (mimetype) {\n var plugin = mimetype.enabledPlugin;\n if (plugin) {\n plugin_loaded_error(\"Плагин загружен, но не создаются обьекты\");\n }else\n {\n plugin_loaded_error(\"Ошибка при загрузке плагина\");\n }\n }else\n {\n plugin_loaded_error(\"Плагин недоступен\");\n }\n }\n }\n\n //Проверяем работает ли плагин\n function check_plugin_working()\n {\n var div = document.createElement(\"div\");\n div.innerHTML = \"\";\n var isIeLessThan9 = (div.getElementsByTagName(\"i\").length === 1);\n if (isIeLessThan9) {\n plugin_loaded_error(\"Internet Explorer версии 8 и ниже не поддерживается\");\n return;\n }\n\n if(isNativeMessageSupported())\n {\n load_extension();\n }else if(!canPromise) {\n window.addEventListener(\"message\", function (event){\n if (event.data !== \"cadesplugin_echo_request\")\n return;\n load_npapi_plugin();\n check_npapi_plugin();\n },\n false);\n }else\n {\n if(document.readyState === \"complete\"){\n load_npapi_plugin();\n check_npapi_plugin();\n } else {\n window.addEventListener(\"load\", function (event) {\n load_npapi_plugin();\n check_npapi_plugin();\n }, false);\n }\n }\n }\n\n function set_pluginObject(obj)\n {\n pluginObject = obj;\n }\n\n function is_capilite_enabled()\n {\n if ((typeof (cadesplugin.EnableInternalCSP) !== 'undefined') && cadesplugin.EnableInternalCSP)\n return true;\n return false;\n };\n\n //Export\n cadesplugin.JSModuleVersion = \"2.1.2\";\n cadesplugin.async_spawn = async_spawn;\n cadesplugin.set = set_pluginObject;\n cadesplugin.set_log_level = set_log_level;\n cadesplugin.getLastError = getLastError;\n cadesplugin.is_capilite_enabled = is_capilite_enabled;\n\n if(isNativeMessageSupported())\n {\n cadesplugin.CreateObjectAsync = CreateObjectAsync;\n cadesplugin.ReleasePluginObjects = ReleasePluginObjects;\n }\n\n if(!isNativeMessageSupported())\n {\n cadesplugin.CreateObject = CreateObject;\n }\n\n if(window.cadesplugin_load_timeout)\n {\n setTimeout(check_load_timeout, window.cadesplugin_load_timeout);\n }\n else\n {\n setTimeout(check_load_timeout, 20000);\n }\n\n set_constantValues();\n\n cadesplugin.current_log_level = cadesplugin.LOG_LEVEL_ERROR;\n window.cadesplugin = cadesplugin;\n check_plugin_working();\n}());\n"],"sourceRoot":""} \ No newline at end of file diff --git a/lib/helpers/_afterPluginsLoaded.d.ts b/lib/helpers/_afterPluginsLoaded.d.ts new file mode 100644 index 0000000..bea0be7 --- /dev/null +++ b/lib/helpers/_afterPluginsLoaded.d.ts @@ -0,0 +1,3 @@ +declare type Unpromisify = T extends Promise ? R : T; +export declare const _afterPluginsLoaded: any>(fn: T) => (...args: Parameters) => Promise>>; +export {}; diff --git a/lib/helpers/_extractCommonName.d.ts b/lib/helpers/_extractCommonName.d.ts new file mode 100644 index 0000000..25df5a9 --- /dev/null +++ b/lib/helpers/_extractCommonName.d.ts @@ -0,0 +1 @@ +export declare const _extractCommonName: (subjectName: string) => string; diff --git a/lib/helpers/_extractMeaningfulErrorMessage.d.ts b/lib/helpers/_extractMeaningfulErrorMessage.d.ts new file mode 100644 index 0000000..827d8d9 --- /dev/null +++ b/lib/helpers/_extractMeaningfulErrorMessage.d.ts @@ -0,0 +1 @@ +export declare const _extractMeaningfulErrorMessage: (error: Error) => string; diff --git a/lib/helpers/_generateCadesFn.d.ts b/lib/helpers/_generateCadesFn.d.ts new file mode 100644 index 0000000..b229e00 --- /dev/null +++ b/lib/helpers/_generateCadesFn.d.ts @@ -0,0 +1,3 @@ +export declare const __cadesAsyncToken__: {}; +export declare const __createCadesPluginObject__: (...args: any[]) => any; +export declare const _generateCadesFn: (callback: Function) => string; diff --git a/lib/helpers/_getCadesCert.d.ts b/lib/helpers/_getCadesCert.d.ts new file mode 100644 index 0000000..ec08b1c --- /dev/null +++ b/lib/helpers/_getCadesCert.d.ts @@ -0,0 +1,7 @@ +/** + * Возвращает сертификат в формате Cades по отпечатку + * + * @param thumbprint - отпечаток сертификата + * @returns сертификат в формате Cades + */ +export declare const _getCadesCert: (thumbprint: string) => Promise; diff --git a/lib/helpers/_getDateObj.d.ts b/lib/helpers/_getDateObj.d.ts new file mode 100644 index 0000000..045929d --- /dev/null +++ b/lib/helpers/_getDateObj.d.ts @@ -0,0 +1,7 @@ +/** + * Возвращает объект даты, совместимый с Cades plugin'ом, зависящий от браузера. + * + * В IE необходимо использовать специфичный формат "VT_DATE" + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Microsoft_Extensions/Date.getVarDate + */ +export declare const _getDateObj: (dateObj: any) => Date; diff --git a/lib/helpers/_isSupportedCSPVersion.d.ts b/lib/helpers/_isSupportedCSPVersion.d.ts new file mode 100644 index 0000000..2c28293 --- /dev/null +++ b/lib/helpers/_isSupportedCSPVersion.d.ts @@ -0,0 +1 @@ +export declare const _isSupportedCSPVersion: (version: string) => boolean; diff --git a/lib/helpers/_isSupportedCadesVersion.d.ts b/lib/helpers/_isSupportedCadesVersion.d.ts new file mode 100644 index 0000000..8e0be50 --- /dev/null +++ b/lib/helpers/_isSupportedCadesVersion.d.ts @@ -0,0 +1 @@ +export declare const _isSupportedCadesVersion: (version: string) => boolean; diff --git a/lib/helpers/_parseCertInfo.d.ts b/lib/helpers/_parseCertInfo.d.ts new file mode 100644 index 0000000..59edf42 --- /dev/null +++ b/lib/helpers/_parseCertInfo.d.ts @@ -0,0 +1,14 @@ +import { TagsTranslations } from '../constants/tags-translations'; +export interface TagTranslation { + description: string; + title: string; + isTranslated: boolean; +} +/** + * Парсит информацию из строки с информацией о сертификате + * + * @param tagsTranslations - словарь с расшифровками тэгов + * @param rawInfo - данные для парсинга + * @returns расшифрованная информация по отдельным тэгам + */ +export declare const _parseCertInfo: (tagsTranslations: TagsTranslations[], rawInfo: string) => TagTranslation[];