import { IPrivateKey , IPublicKey , ICrypto , ICardCrypto , Data } from './types' ; export class VirgilCardCrypto implements ICardCrypto { readonly crypto : ICrypto ; constructor ( crypto ) { if ( crypto == null ) { throw new Error ( '`crypto` is required' ) ; } this . crypto = crypto ; } generateSignature ( data , privateKey ) { return this . crypto . calculateSignature ( data , privateKey ) ; } verifySignature ( data , signature , publicKey ) { return this . crypto . verifySignature ( data , signature , publicKey ) ; } exportPublicKey ( publicKey ) { return this . crypto . exportPublicKey ( publicKey ) ; } importPublicKey ( publicKeyData ) { return this . crypto . importPublicKey ( publicKeyData ) ; } generateSha512 ( data ) { return this . crypto . calculateHash ( data ) ; } }