import { combine } from '@typed/effects' ; import { importExportedKeyPair } from '../asymmetrical/importExportedKeyPair' ; import { AesEncryptedKeys , CryptoEffects } from '../common' ; import { decryptWithAesKey } from '../symmetrical/decryptWithAesKey' ; export function * importEncryptedKeys ( decryptionKey , params , encryptedKeys ) { const [ publicKey , privateKey ] = yield * combine ( decryptWithAesKey ( decryptionKey , ... encryptedKeys . publicKey ) , decryptWithAesKey ( decryptionKey , ... encryptedKeys . privateKey ) ) ; return yield * importExportedKeyPair ( params , { publicKey , privateKey , } ) ; }