Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавил методы для параллельной (совмещенной) подписи (CoSign) #45

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules/
package/
coverage/

.DS_Store
6 changes: 3 additions & 3 deletions definition-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const path = require('path');
const fs = require('fs');
const tsConfig = require(`./${process.env.TS_CONFIG}`);
const packageJson = require('./package.json');
const typingsPath = path.resolve(__dirname, tsConfig.compilerOptions.outDir, `${packageJson.name}.d.ts`);
const typingsPath = path.resolve(__dirname, tsConfig.compilerOptions.outDir, `${packageJson.entryPoint}.d.ts`);
const typings = fs.readFileSync(typingsPath, 'utf8');

let header = [
`// Type definitions for ${packageJson.name} ${packageJson.version}`,
`// Project: ${packageJson.name}`,
`// Type definitions for ${packageJson.entryPoint} ${packageJson.version}`,
`// Project: ${packageJson.entryPoint}}`,
`// Definitions by: ${packageJson.author.name} ${packageJson.author.url}`
].join('\n');

Expand Down
8 changes: 8 additions & 0 deletions dist/api/addAttachedSignature.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Добавляет присоединенную подпись к подписанному сообщению по отпечатку сертификата
*
* @param thumbprint - отпечаток сертификата
* @param signedMessage - подписанное сообщение
* @returns подпись в формате PKCS#7
*/
export declare const addAttachedSignature: (thumbprint: string, signedMessage: string | ArrayBuffer) => Promise<string>;
9 changes: 9 additions & 0 deletions dist/api/addDetachedSignature.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Добавляет отсоединенную подпись хеша к подписанному сообщению по отпечатку сертификата
*
* @param thumbprint - отпечаток сертификата
* @param signedMessage - подписанное сообщение
* @param unencryptedMessage - подписываемое сообщение
* @returns подпись в формате PKCS#7
*/
export declare const addDetachedSignature: (thumbprint: string, signedMessage: string | ArrayBuffer, unencryptedMessage: string | ArrayBuffer) => Promise<string>;
2 changes: 1 addition & 1 deletion dist/api/createAttachedSignature.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Создает присоединенную подпись сообщения по отпечатку сертификата
*
* @param thumbprint - отпечаток сертификата
* @param message - подписываемое сообщение
* @param unencryptedMessage - подписываемое сообщение
* @returns подпись в формате PKCS#7
*/
export declare const createAttachedSignature: (thumbprint: string, unencryptedMessage: string | ArrayBuffer) => Promise<string>;
8 changes: 8 additions & 0 deletions dist/api/getAllUserCertificates.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Certificate } from './certificate';
/**
* Возвращает все сертификаты без фильтрации по дате и наличию приватного ключа
*
* @param resetCache = false - позволяет сбросить кэш ранее полученных сертификатов
* @returns список сертификатов
*/
export declare const getAllUserCertificates: (resetCache?: boolean) => Promise<Certificate[]>;
6 changes: 6 additions & 0 deletions dist/api/getCspVersion.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Предоставляет информацию о системе
*
* @returns информацию о CSP
*/
export declare const getCspVersion: () => Promise<string>;
6 changes: 6 additions & 0 deletions dist/api/getPluginVersion.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Предоставляет информацию о системе
*
* @returns информацию о плагине
*/
export declare const getPluginVersion: () => Promise<string>;
6 changes: 6 additions & 0 deletions dist/api/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
export * from './getCertificate';
export * from './getUserCertificates';
export * from './getAllUserCertificates';
export * from './getSystemInfo';
export * from './isValidSystemSetup';
export * from './createSignature';
export * from './createXMLSignature';
export * from './createDetachedSignature';
export * from './addDetachedSignature';
export * from './createAttachedSignature';
export * from './addAttachedSignature';
export * from './createHash';
export * from './certificate';
export * from './getCspVersion';
export * from './getPluginVersion';
export * from './setLogLevel';
6 changes: 6 additions & 0 deletions dist/api/setLogLevel.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare type LogLevel = 4 | 2 | 1;
/**
* Устанавливает уровень логирование для плагина Крипто-ПРО
*/
export declare const setLogLevel: (level: LogLevel) => Promise<void>;
export {};
1 change: 1 addition & 0 deletions dist/constants/oids-dictionary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ 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.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
4 changes: 2 additions & 2 deletions dist/crypto-pro.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Type definitions for crypto-pro 2.2.0
// Project: crypto-pro
// Type definitions for crypto-pro 2.6.1
// Project: crypto-pro}
// Definitions by: Vitalii Goma https://github.com/vgoma

export as namespace cryptoPro;
Expand Down
Loading