style(lint): fix lint errors

This commit is contained in:
microshine 2022-11-02 13:25:33 +03:00
parent 5175704e8e
commit d0ea632eea
7 changed files with 8 additions and 8 deletions

View File

@ -3,6 +3,6 @@ import { CryptoKey } from "./key";
export class SymmetricKey extends CryptoKey {
public override readonly kty = "oct";
public override readonly type: "secret" = "secret";
public override readonly type = "secret" as const;
}

View File

@ -5,7 +5,7 @@ import { AsymmetricKey } from "../../keys";
import { getOidByNamedCurve } from "./helper";
export class EcPrivateKey extends AsymmetricKey implements IJsonConvertible {
public readonly type: "private" = "private";
public readonly type = "private" as const;
public override algorithm!: EcKeyAlgorithm;
public getKey() {

View File

@ -6,7 +6,7 @@ import { getOidByNamedCurve } from "./helper";
export class EcPublicKey extends AsymmetricKey implements IJsonConvertible {
public readonly type: "public" = "public";
public readonly type = "public" as const;
public override algorithm!: EcKeyAlgorithm;
public getKey() {
@ -39,7 +39,7 @@ export class EcPublicKey extends AsymmetricKey implements IJsonConvertible {
keyInfo.publicKeyAlgorithm.parameters = AsnSerializer.serialize(
new core.asn1.ObjectIdentifier(getOidByNamedCurve(json.crv)),
);
keyInfo.publicKey = AsnSerializer.toASN(key).valueHex;
keyInfo.publicKey = (AsnSerializer.toASN(key) as any).valueHex;
this.data = Buffer.from(AsnSerializer.serialize(keyInfo));

View File

@ -5,7 +5,7 @@ import { AsymmetricKey } from "../../keys";
import { getOidByNamedCurve } from "./helper";
export class EdPrivateKey extends AsymmetricKey implements IJsonConvertible {
public readonly type: "private" = "private";
public readonly type = "private" as const;
public override algorithm!: EcKeyAlgorithm;
public getKey() {

View File

@ -7,7 +7,7 @@ import { getOidByNamedCurve } from "./helper";
export class EdPublicKey extends AsymmetricKey implements IJsonConvertible {
public readonly type: "public" = "public";
public readonly type = "public" as const;
public override algorithm!: EcKeyAlgorithm;
public getKey() {

View File

@ -5,7 +5,7 @@ import { AsymmetricKey } from "../../keys";
import { getJwkAlgorithm } from "./helper";
export class RsaPrivateKey extends AsymmetricKey {
public readonly type: "private" = "private";
public readonly type = "private" as const;
public override algorithm!: RsaHashedKeyAlgorithm;
public getKey() {

View File

@ -5,7 +5,7 @@ import { AsymmetricKey } from "../../keys/asymmetric";
import { getJwkAlgorithm } from "./helper";
export class RsaPublicKey extends AsymmetricKey {
public readonly type: "public" = "public";
public readonly type = "public" as const;
public override algorithm!: RsaHashedKeyAlgorithm;
public getKey() {