style: fix lint errors

This commit is contained in:
microshine 2020-11-25 12:58:53 +03:00
parent 61e5dc13be
commit 5ce0c267f4
4 changed files with 1 additions and 8 deletions

View File

@ -18,6 +18,7 @@
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/semi": 1,
"@typescript-eslint/explicit-module-boundary-types": 0,
"semi": "off",
"import/order": ["error", {
"groups": ["builtin", "external", "internal"],

View File

@ -23,14 +23,12 @@ export class EcCrypto {
publicKey.extractable = true;
publicKey.usages = keyUsages.filter((usage) => this.publicKeyUsages.indexOf(usage) !== -1);
// @ts-ignore NodeJs d.ts error
const keys = crypto.generateKeyPairSync("ec", {
namedCurve: this.getOpenSSLNamedCurve(algorithm.namedCurve),
publicKeyEncoding: {
format: "der",
type: "spki",
},
// @ts-ignore NodeJs d.ts error
privateKeyEncoding: {
format: "der",
type: "pkcs8",

View File

@ -34,7 +34,6 @@ export class RsaCrypto {
Buffer.from(algorithm.publicExponent),
]).readInt32BE(0);
// @ts-ignore NodeJs d.ts error
const keys = crypto.generateKeyPairSync("rsa", {
modulusLength: algorithm.modulusLength,
publicExponent,
@ -199,7 +198,6 @@ export class RsaCrypto {
key: key.pem,
};
if (algorithm.name.toUpperCase() === "RSA-PSS") {
// @ts-ignore
options.padding = crypto.constants.RSA_PKCS1_PSS_PADDING;
options.saltLength = (algorithm as RsaPssParams).saltLength;
}
@ -220,7 +218,6 @@ export class RsaCrypto {
key: key.pem,
};
if (algorithm.name.toUpperCase() === "RSA-PSS") {
// @ts-ignore
options.padding = crypto.constants.RSA_PKCS1_PSS_PADDING;
options.saltLength = (algorithm as RsaPssParams).saltLength;
}
@ -232,7 +229,6 @@ export class RsaCrypto {
protected static encryptOAEP(algorithm: RsaOaepParams, key: RsaPublicKey, data: Uint8Array) {
const options: crypto.RsaPublicKey = {
key: `-----BEGIN PUBLIC KEY-----\n${key.data.toString("base64")}\n-----END PUBLIC KEY-----`,
// @ts-ignore
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
};
if (algorithm.label) {
@ -245,7 +241,6 @@ export class RsaCrypto {
protected static decryptOAEP(algorithm: RsaOaepParams, key: RsaPrivateKey, data: Uint8Array) {
const options: crypto.RsaPrivateKey = {
key: `-----BEGIN PRIVATE KEY-----\n${key.data.toString("base64")}\n-----END PRIVATE KEY-----`,
// @ts-ignore
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
};
if (algorithm.label) {

View File

@ -87,7 +87,6 @@ export class RsaEsProvider extends core.ProviderCrypto {
const type = key.type.toUpperCase();
return {
key: `-----BEGIN ${type} KEY-----\n${getCryptoKey(key).data.toString("base64")}\n-----END ${type} KEY-----`,
// @ts-ignore
padding: crypto.constants.RSA_PKCS1_PADDING,
};
}