import * as crypto from 'crypto' ; export class AuthenticationProvider { public readonly publicKey : string ; private _privateKey : Buffer ; constructor ( publicKey , privateKey ) { this . publicKey = publicKey ; this . _privateKey = new Buffer ( privateKey , 'base64' ) ; } public sign ( prehashString ) { const hmac = crypto . createHmac ( 'sha256' , this . _privateKey ) ; return hmac . update ( prehashString ) . digest ( 'base64' ) ; } }