import { isNode } from '../util/platform' ; /**
 * Stores keys and implement cipher / decipher
 */ export interface CryptoStore { toAESEncrypted ( buffer , iv ) : Uint8Array ; toAESDecrypted ( buffer , iv ) : Uint8Array ; toRSAEncrypted ( buffer ) : Uint8Array ; randomCipherIV ( ) : Uint8Array ; getRSAEncryptedKey ( ) : Uint8Array ; } param { string } pubKey export async function newCryptoStore ( pubKey ) { if ( isNode ( ) ) { return ( await import ( './node-crypto-store' ) ) . createNodeCrypto ( pubKey ) ; } else { return ( await import ( './forge-crypto-store' ) ) . createForgeCrypto ( pubKey ) ; } }