Fix type errors
This commit is contained in:
parent
53b8ab534c
commit
eda6bc4f0a
|
@ -4,7 +4,7 @@ import { AesCryptoKey } from "./key";
|
||||||
|
|
||||||
export class AesCbcProvider extends core.AesCbcProvider {
|
export class AesCbcProvider extends core.AesCbcProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
const key = await AesCrypto.generateKey(
|
const key = await AesCrypto.generateKey(
|
||||||
{
|
{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { AesCryptoKey } from "./key";
|
||||||
|
|
||||||
export class AesCmacProvider extends core.AesCmacProvider {
|
export class AesCmacProvider extends core.AesCmacProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
const key = await AesCrypto.generateKey(
|
const key = await AesCrypto.generateKey(
|
||||||
{
|
{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { AesCryptoKey } from "./key";
|
||||||
|
|
||||||
export class AesCtrProvider extends core.AesCtrProvider {
|
export class AesCtrProvider extends core.AesCtrProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
const key = await AesCrypto.generateKey(
|
const key = await AesCrypto.generateKey(
|
||||||
{
|
{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { AesCryptoKey } from "./key";
|
||||||
|
|
||||||
export class AesGcmProvider extends core.AesGcmProvider {
|
export class AesGcmProvider extends core.AesGcmProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
const key = await AesCrypto.generateKey(
|
const key = await AesCrypto.generateKey(
|
||||||
{
|
{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -11,7 +11,7 @@ export class DesCbcProvider extends core.DesProvider {
|
||||||
public ivSize = 8;
|
public ivSize = 8;
|
||||||
public name = "DES-CBC";
|
public name = "DES-CBC";
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: core.DesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: core.DesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
const key = await DesCrypto.generateKey(
|
const key = await DesCrypto.generateKey(
|
||||||
{
|
{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -11,7 +11,7 @@ export class DesEde3CbcProvider extends core.DesProvider {
|
||||||
public ivSize = 8;
|
public ivSize = 8;
|
||||||
public name = "DES-EDE3-CBC";
|
public name = "DES-EDE3-CBC";
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: core.DesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: core.DesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
const key = await DesCrypto.generateKey(
|
const key = await DesCrypto.generateKey(
|
||||||
{
|
{
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { EcPublicKey } from "./public_key";
|
||||||
|
|
||||||
export class EcdhProvider extends core.EcdhProvider {
|
export class EcdhProvider extends core.EcdhProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair> {
|
||||||
const key = await EcCrypto.generateKey(
|
const key = await EcCrypto.generateKey(
|
||||||
{
|
{
|
||||||
...algorithm,
|
...algorithm,
|
||||||
|
|
|
@ -8,7 +8,7 @@ export class EcdsaProvider extends core.EcdsaProvider {
|
||||||
|
|
||||||
public namedCurves = ["P-256", "P-384", "P-521", "K-256"];
|
public namedCurves = ["P-256", "P-384", "P-521", "K-256"];
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair> {
|
||||||
const key = await EcCrypto.generateKey(
|
const key = await EcCrypto.generateKey(
|
||||||
{
|
{
|
||||||
...algorithm,
|
...algorithm,
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class Pbkdf2Provider extends core.Pbkdf2Provider {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async importKey(format: KeyFormat, keyData: JsonWebKey | ArrayBuffer, algorithm: Algorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
public async onImportKey(format: KeyFormat, keyData: JsonWebKey | ArrayBuffer, algorithm: Algorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
|
||||||
if (format === "raw") {
|
if (format === "raw") {
|
||||||
const key = new PbkdfCryptoKey();
|
const key = new PbkdfCryptoKey();
|
||||||
key.data = Buffer.from(keyData as ArrayBuffer);
|
key.data = Buffer.from(keyData as ArrayBuffer);
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { RsaPublicKey } from "./public_key";
|
||||||
|
|
||||||
export class RsaOaepProvider extends core.RsaOaepProvider {
|
export class RsaOaepProvider extends core.RsaOaepProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair> {
|
||||||
const key = await RsaCrypto.generateKey(
|
const key = await RsaCrypto.generateKey(
|
||||||
{
|
{
|
||||||
...algorithm,
|
...algorithm,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { RsaPublicKey } from "./public_key";
|
||||||
|
|
||||||
export class RsaPssProvider extends core.RsaPssProvider {
|
export class RsaPssProvider extends core.RsaPssProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair> {
|
||||||
const key = await RsaCrypto.generateKey(
|
const key = await RsaCrypto.generateKey(
|
||||||
{
|
{
|
||||||
...algorithm,
|
...algorithm,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { RsaPublicKey } from "./public_key";
|
||||||
|
|
||||||
export class RsaSsaProvider extends core.RsaSsaProvider {
|
export class RsaSsaProvider extends core.RsaSsaProvider {
|
||||||
|
|
||||||
public async onGenerateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> {
|
public async onGenerateKey(algorithm: RsaHashedKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair> {
|
||||||
const key = await RsaCrypto.generateKey(
|
const key = await RsaCrypto.generateKey(
|
||||||
{
|
{
|
||||||
...algorithm,
|
...algorithm,
|
||||||
|
|
Reference in New Issue