@@ -23,6 +23,7 @@ import {
23
23
keyUsageForMaterial ,
24
24
subtleFunctionForMaterial ,
25
25
unwrapDataKey ,
26
+ AwsEsdkJsCryptoKey , // eslint-disable-line no-unused-vars
26
27
WebCryptoMaterial // eslint-disable-line no-unused-vars
27
28
} from '@aws-crypto/material-management'
28
29
@@ -155,7 +156,7 @@ export function getSubtleFunction<T extends WebCryptoMaterial<T>> (
155
156
const { encryption : cipherName , ivLength, tagLength } = suite
156
157
157
158
return ( info : Uint8Array ) => {
158
- const derivedKeyPromise : Promise < CryptoKey | MixedBackendCryptoKey > = isCryptoKey ( cryptoKey )
159
+ const derivedKeyPromise : Promise < AwsEsdkJsCryptoKey | MixedBackendCryptoKey > = isCryptoKey ( cryptoKey )
159
160
? WebCryptoKdf ( getNonZeroByteBackend ( backend ) , material , cryptoKey , [ subtleFunction ] , info )
160
161
: Promise . all ( [
161
162
WebCryptoKdf ( getNonZeroByteBackend ( backend ) , material , cryptoKey . nonZeroByteCryptoKey , [ subtleFunction ] , info ) ,
@@ -190,7 +191,7 @@ export function getSubtleFunction<T extends WebCryptoMaterial<T>> (
190
191
export async function WebCryptoKdf < T extends WebCryptoMaterial < T > > (
191
192
subtle : SubtleCrypto ,
192
193
material : T ,
193
- cryptoKey : CryptoKey ,
194
+ cryptoKey : AwsEsdkJsCryptoKey ,
194
195
keyUsages : SubtleFunction [ ] ,
195
196
info : Uint8Array
196
197
) : Promise < CryptoKey > {
@@ -244,7 +245,7 @@ export async function _importCryptoKey<T extends WebCryptoMaterial<T>> (
244
245
subtle : SubtleCrypto ,
245
246
material : T ,
246
247
keyUsages : KeyUsage [ ] = [ keyUsageForMaterial ( material ) ]
247
- ) {
248
+ ) : Promise < AwsEsdkJsCryptoKey > {
248
249
const { suite } = material
249
250
const extractable = false
250
251
const udk = unwrapDataKey ( material . getUnencryptedDataKey ( ) )
0 commit comments