Fix type errors

This commit is contained in:
microshine 2019-03-02 10:24:48 +03:00
parent e512422a2b
commit 6af540418f
1 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import { AesCryptoKey } from "./key";
export class AesKwProvider extends core.AesKwProvider { export class AesKwProvider extends core.AesKwProvider {
public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey> { public async onGenerateKey(algorithm: AesKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey> {
return await AesCrypto.generateKey( return await AesCrypto.generateKey(
{ {
name: this.name, name: this.name,
@ -23,11 +23,11 @@ export class AesKwProvider extends core.AesKwProvider {
return AesCrypto.importKey(format, keyData, { name: algorithm.name }, extractable, keyUsages); return AesCrypto.importKey(format, keyData, { name: algorithm.name }, extractable, keyUsages);
} }
public async onEncrypt(algorithm: AesKeyAlgorithm, key: AesCryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> { public async onEncrypt(algorithm: Algorithm, key: AesCryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {
return AesCrypto.encrypt(algorithm, key, new Uint8Array(data)); return AesCrypto.encrypt(algorithm, key, new Uint8Array(data));
} }
public async onDecrypt(algorithm: AesKeyAlgorithm, key: AesCryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> { public async onDecrypt(algorithm: Algorithm, key: AesCryptoKey, data: ArrayBuffer): Promise<ArrayBuffer> {
return AesCrypto.decrypt(algorithm, key, new Uint8Array(data)); return AesCrypto.decrypt(algorithm, key, new Uint8Array(data));
} }