index.js
function(message, signatureObject, cb = null){
        var result = false
        var ethSig = toEthUtilsSignature(signatureObject)
        try {
            var isSigValid = ethUtils.isValidSignature(ethSig.v, ethSig.r, ethSig.s)
            var isPubKeyValid = ethUtils.isValidPublic(signatureObject.publicKey)
            //convert public key to secp256k1 format
            signatureObject.publicKey = getSecp256k1PublicKey(signatureObject.publicKey)
            var isSigVerified = secp256k1.verify(ethUtils.sha3(message), signatureObject.signature, signatureObject.publicKey)
            if(isSigVerified){
                result = true
            }
        }   catch(err){
            result = err
        }
        if(isFunction(cb)){
            if(result instanceof Error){
                return cb(result)
            } else {
                return cb(null, result)
            }
        } else {
            return result
        }
    }
function(message, signatureObject, cb = null){
        var result = false
        var ethSig = toEthUtilsSignature(signatureObject)
        try {
            var isSigValid = ethUtils.isValidSignature(ethSig.v, ethSig.r, ethSig.s)
            var isPubKeyValid = ethUtils.isValidPublic(signatureObject.publicKey)
            //convert public key to secp256k1 format
            signatureObject.publicKey = getSecp256k1PublicKey(signatureObject.publicKey)
            var isSigVerified = secp256k1.verify(ethUtils.sha3(message), signatureObject.signature, signatureObject.publicKey)
            if(isSigVerified){
                result = true
            }
        }   catch(err){
            result = err
        }
        if(isFunction(cb)){
            if(result instanceof Error){
                return cb(result)
            } else {
                return cb(null, result)
            }
        } else {
            return result
        }
    }
function ( message , signatureObject , cb = null ) { var result = false var ethSig = toEthUtilsSignature ( signatureObject ) try { var isSigValid = ethUtils . isValidSignature ( ethSig . v , ethSig . r , ethSig . s ) var isPubKeyValid = ethUtils . isValidPublic ( signatureObject . publicKey ) //convert public key to secp256k1 format signatureObject . publicKey = getSecp256k1PublicKey ( signatureObject . publicKey ) var isSigVerified = secp256k1 . verify ( ethUtils . sha3 ( message ) , signatureObject . signature , signatureObject . publicKey ) if ( isSigVerified ) { result = true } } catch ( err ) { result = err } if ( isFunction ( cb ) ) { if ( result instanceof Error ) { return cb ( result ) } else { return cb ( null , result ) } } else { return result } }
verify signature easier handing over the complete signature object containing the signature, recovery and the public key in one object
@param  {String}   message         message to verify
@param  {Object}   signatureObject Signature object. must contain recovery (Number), signature and publicKey (both buffers)
@param  {Function} cb              callback function (optional)
@return {boolean}                  true, if signature and public key are valid, otherwise false
verify signature easier handing over the complete signature object containing the signature recovery and the public key in one object