mirror of
https://github.com/crypto-pro-web/crypto-pro-js.git
synced 2025-08-26 10:42:38 +03:00
feat: lint
This commit is contained in:
parent
d1a163f823
commit
92a1a8f988
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "crypto-pro-js-m",
|
"name": "crypto-pro-js-m",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/crypto-pro-web/crypto-pro-js",
|
"description": "Асинхронный JavaScript API для работы с КриптоПРО ЭЦП Browser Plug-In. Forked from https://github.com/crypto-pro-web/crypto-pro-js",
|
||||||
"main": "./lib/crypto-pro-js.js",
|
"main": "./lib/crypto-pro-js.js",
|
||||||
"types": "./lib/crypto-pro-js.d.ts",
|
"types": "./lib/crypto-pro-js.d.ts",
|
||||||
|
@ -76,12 +76,10 @@ export const createDetachedSignature = _afterPluginsLoaded(
|
|||||||
|
|
||||||
let signature: string;
|
let signature: string;
|
||||||
|
|
||||||
const signTypeConst = getSignType(cadesplugin, signType);
|
const signTypeConst = getSignType(cadesplugin, signType);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
signature =
|
signature = __cadesAsyncToken__ + cadesSignedData.SignHash(cadesHashedData, cadesSigner, signTypeConst);
|
||||||
__cadesAsyncToken__ +
|
|
||||||
cadesSignedData.SignHash(cadesHashedData, cadesSigner, signTypeConst);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
export type SignType = 'CAdES BES' | 'CAdES-X Long Type 1' | 'CAdES T' | 'PKCS7';
|
export type SignType = 'CAdES BES' | 'CAdES-X Long Type 1' | 'CAdES T' | 'PKCS7';
|
||||||
|
|
||||||
export const getSignType = (cadesplugin: any, signType: SignType) => {
|
export const getSignType = (cadesplugin: any, signType: SignType) => {
|
||||||
switch (signType) {
|
switch (signType) {
|
||||||
case 'CAdES BES': {
|
case 'CAdES BES': {
|
||||||
return cadesplugin.CADESCOM_CADES_BES
|
return cadesplugin.CADESCOM_CADES_BES;
|
||||||
};
|
|
||||||
case 'CAdES-X Long Type 1': {
|
|
||||||
return cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1;
|
|
||||||
}
|
|
||||||
case 'CAdES T': {
|
|
||||||
return cadesplugin.CADESCOM_CADES_T;
|
|
||||||
}
|
|
||||||
case 'PKCS7': {
|
|
||||||
return cadesplugin.CADESCOM_PKCS7_TYPE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
case 'CAdES-X Long Type 1': {
|
||||||
|
return cadesplugin.CADESCOM_CADES_X_LONG_TYPE_1;
|
||||||
|
}
|
||||||
|
case 'CAdES T': {
|
||||||
|
return cadesplugin.CADESCOM_CADES_T;
|
||||||
|
}
|
||||||
|
case 'PKCS7': {
|
||||||
|
return cadesplugin.CADESCOM_PKCS7_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user