Skip to content

Commit

Permalink
Исправления в соответсвии с приказом ФСБ России (#40)
Browse files Browse the repository at this point in the history
Внесены изменения с учётом Приказа ФСБ России от 13.04.2021 N 142 "О внесении изменения в приказ ФСБ России от 27 декабря 2011 г. N 796 "Об утверждении Требований к средствам электронной подписи и Требований к средствам удостоверяющего центра"

* Добавил чтение полей, перечисленных в приказе ФСБ России от 27 декабря 2011 г. N 796

* Добавил OIDы полей, перечисленных в приказе ФСБ России от 27 декабря 2011 г. N 796

* Расширил варианты названия для полей подписи, в соответствии с рекомендациями ISO/IEC 9594-8:2008

* Выпуск версии 2.3.3
  • Loading branch information
kernusr committed Nov 11, 2022
1 parent 35d9990 commit c09fac3
Show file tree
Hide file tree
Showing 22 changed files with 345 additions and 178 deletions.
4 changes: 4 additions & 0 deletions dist/constants/oids-dictionary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ 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.100.4': string;
'1.2.643.100.1': string;
'1.2.643.100.5': string;
'1.2.643.100.3': 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;
Expand Down
2 changes: 1 addition & 1 deletion dist/crypto-pro-js.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for crypto-pro-js 2.3.2
// Type definitions for crypto-pro-js 2.3.3
// Project: crypto-pro-js
// Definitions by: Artem Vasilev https://github.com/kernusr

Expand Down
195 changes: 135 additions & 60 deletions dist/crypto-pro-js.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/crypto-pro-js.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/crypto-pro-js.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/crypto-pro-js.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/helpers/_extractCommonName.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const _extractCommonName: (subjectName: string) => string;
export declare const _extractCommonName: (subjectName: string) => string | undefined;
2 changes: 1 addition & 1 deletion dist/helpers/_extractMeaningfulErrorMessage.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const _extractMeaningfulErrorMessage: (error: Error) => string;
export declare const _extractMeaningfulErrorMessage: (error: Error) => string | null;
21 changes: 12 additions & 9 deletions examples/script-tag/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/script-tag/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crypto-pro-example-es5-script-tag",
"version": "0.0.0",
"version": "2.3.3",
"description": "Пример использования пакета crypto-pro через тэг script",
"private": true,
"scripts": {
Expand All @@ -13,6 +13,6 @@
"symlink-dir": "3.1.2"
},
"dependencies": {
"crypto-pro-js": "^2.3.2"
"crypto-pro-js": "^2.3.3"
}
}
4 changes: 4 additions & 0 deletions lib/constants/oids-dictionary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ 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.100.4': string;
'1.2.643.100.1': string;
'1.2.643.100.5': string;
'1.2.643.100.3': 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;
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto-pro-js.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for crypto-pro-js 2.3.2
// Type definitions for crypto-pro-js 2.3.3
// Project: crypto-pro-js
// Definitions by: Artem Vasilev https://github.com/kernusr

Expand Down
195 changes: 135 additions & 60 deletions lib/crypto-pro-js.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/crypto-pro-js.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/helpers/_extractCommonName.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const _extractCommonName: (subjectName: string) => string;
export declare const _extractCommonName: (subjectName: string) => string | undefined;
2 changes: 1 addition & 1 deletion lib/helpers/_extractMeaningfulErrorMessage.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare const _extractMeaningfulErrorMessage: (error: Error) => string;
export declare const _extractMeaningfulErrorMessage: (error: Error) => string | null;
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crypto-pro-js",
"version": "2.3.2",
"version": "2.3.3",
"description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/vgoma/crypto-pro",
"main": "./lib/crypto-pro-js.js",
"types": "./lib/crypto-pro-js.d.ts",
Expand Down
23 changes: 12 additions & 11 deletions src/constants/issuer-tags-translations.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { TagsTranslations } from './tags-translations';

export const ISSUER_TAGS_TRANSLATIONS: TagsTranslations[] = [
{ 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: ['UN', 'UnstructuredName'], translation: 'Неструктурированное имя' },
{ possibleNames: ['CN', 'commonName'], translation: 'Удостоверяющий центр' },
{ possibleNames: ['C', 'countryName'], translation: 'Страна' },
{ possibleNames: ['S', 'ST', 'stateOrProvinceName'], translation: 'Регион' },
{ possibleNames: ['STREET', 'streetAddress'], translation: 'Адрес' },
{ possibleNames: ['O', 'organizationName'], translation: 'Компания' },
{ possibleNames: ['OU', 'organizationalUnitName'], translation: 'Тип' },
{ possibleNames: ['T', 'TITLE'], translation: 'Должность' },
{ possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },
{ possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },
{ possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },
{ possibleNames: ['ИНН', 'INN', 'ИНН организации'], translation: 'ИНН' },
{ possibleNames: ['E'], translation: 'Email' },
{ possibleNames: ['L'], translation: 'Город' },
{ possibleNames: ['ИНН', 'ИННФЛ', 'ИНН ФЛ', 'INN', 'ИНН физического лица'], translation: 'ИНН' },
{ possibleNames: ['ИННЮЛ', 'ИНН ЮЛ', 'INN LE', 'INNLE', 'ИНН организации'], translation: 'ИНН организации' },
{ possibleNames: ['E', 'email', 'emailAddress', 'pkcs9email'], translation: 'Email' },
{ possibleNames: ['L', 'localityName'], translation: 'Город' },
];
4 changes: 4 additions & 0 deletions src/constants/oids-dictionary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ export const 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.100.4': 'ИНН организации',
'1.2.643.100.1': 'ОГРН',
'1.2.643.100.5': 'ОГРНИП',
'1.2.643.100.3': 'СНИЛС',
'1.2.643.3.141.1.1': 'РНС ФСС',
'1.2.643.3.141.1.2': 'КП ФСС',
'1.2.643.3.2.100.65.13.11': 'Использование в системе АИС "Госзакупки" Сахалинской области.',
Expand Down
27 changes: 14 additions & 13 deletions src/constants/subject-tags-translations.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import { TagsTranslations } from './tags-translations';

export const SUBJECT_TAGS_TRANSLATIONS: TagsTranslations[] = [
{ 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: ['UN', 'UnstructuredName'], translation: 'Неструктурированное имя' },
{ possibleNames: ['CN', 'commonName'], translation: 'Владелец' },
{ possibleNames: ['SN', 'surname'], translation: 'Фамилия' },
{ possibleNames: ['G', 'givenName', 'gn'], translation: 'Имя Отчество' },
{ possibleNames: ['C', 'countryName'], translation: 'Страна' },
{ possibleNames: ['S', 'ST', 'stateOrProvinceName'], translation: 'Регион' },
{ possibleNames: ['STREET', 'streetAddress'], translation: 'Адрес' },
{ possibleNames: ['O', 'organizationName'], translation: 'Компания' },
{ possibleNames: ['OU', 'organizationalUnitName'], translation: 'Отдел/подразделение' },
{ possibleNames: ['T', 'TITLE'], translation: 'Должность' },
{ possibleNames: ['ОГРН', 'OGRN'], translation: 'ОГРН' },
{ possibleNames: ['ОГРНИП', 'OGRNIP'], translation: 'ОГРНИП' },
{ possibleNames: ['СНИЛС', 'SNILS'], translation: 'СНИЛС' },
{ possibleNames: ['ИНН', 'INN', 'ИНН организации'], translation: 'ИНН' },
{ possibleNames: ['E'], translation: 'Email' },
{ possibleNames: ['L'], translation: 'Город' },
{ possibleNames: ['ИНН', 'ИННФЛ', 'ИНН ФЛ', 'INN', 'ИНН физического лица'], translation: 'ИНН' },
{ possibleNames: ['ИННЮЛ', 'ИНН ЮЛ', 'INN LE', 'INNLE', 'ИНН организации'], translation: 'ИНН организации' },
{ possibleNames: ['E', 'email', 'emailAddress', 'pkcs9email'], translation: 'Email' },
{ possibleNames: ['L', 'localityName'], translation: 'Город' },
];
16 changes: 8 additions & 8 deletions src/helpers/_parseCertInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe('_parseCertInfo', () => {
'OID.1.2.643.6.3.1.4.1=Петров',
'UNKNOWN=неизвестный тэг',
'E=email@example.ru',
'INN=007811514257',
'ИНН организации=007811514257',
'INN=997811514257',
'ИНН ЮЛ=007811514257',
'OGRN=1127847087885',
'SNILS=11617693460',
].join(', ');
Expand Down Expand Up @@ -96,13 +96,13 @@ describe('_parseCertInfo', () => {
isTranslated: true,
},
{
description: '007811514257',
description: '997811514257',
title: 'ИНН',
isTranslated: true,
},
{
description: '007811514257',
title: 'ИНН',
title: 'ИНН организации',
isTranslated: true,
},
{
Expand All @@ -128,8 +128,8 @@ describe('_parseCertInfo', () => {
'L=Санкт-Петербург',
'S=78 Санкт-Петербург',
'C=RU',
'INN=007813317783',
'ИНН организации=007813317783',
'INN=997813317783',
'INNLE=007813317783',
'OGRN=1057810150892',
'E=uc@sampokey.ru',
].join(', ');
Expand Down Expand Up @@ -176,13 +176,13 @@ describe('_parseCertInfo', () => {
isTranslated: true,
},
{
description: '007813317783',
description: '997813317783',
title: 'ИНН',
isTranslated: true,
},
{
description: '007813317783',
title: 'ИНН',
title: 'ИНН организации',
isTranslated: true,
},
{
Expand Down

0 comments on commit c09fac3

Please sign in to comment.