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",
|
||||
"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",
|
||||
"main": "./lib/crypto-pro-js.js",
|
||||
"types": "./lib/crypto-pro-js.d.ts",
|
||||
|
@ -79,9 +79,7 @@ export const createDetachedSignature = _afterPluginsLoaded(
|
||||
const signTypeConst = getSignType(cadesplugin, signType);
|
||||
|
||||
try {
|
||||
signature =
|
||||
__cadesAsyncToken__ +
|
||||
cadesSignedData.SignHash(cadesHashedData, cadesSigner, signTypeConst);
|
||||
signature = __cadesAsyncToken__ + cadesSignedData.SignHash(cadesHashedData, cadesSigner, signTypeConst);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
export type SignType = 'CAdES BES' | 'CAdES-X Long Type 1' | 'CAdES T' | 'PKCS7';
|
||||
|
||||
export const getSignType = (cadesplugin: any, signType: SignType) => {
|
||||
switch (signType) {
|
||||
case '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;
|
||||
}
|
||||
switch (signType) {
|
||||
case '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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user