lib/signature.js
function( signature, input, key ) {

    if( !Buffer.isBuffer( input ) )
      throw new TypeError( 'Input must be a buffer' )

    if( !Buffer.isBuffer( signature ) )
      throw new TypeError( 'Signature must be a buffer' )

    if( this.type === 'PLAIN' )
      return signature.length === 0

    if( !Buffer.isBuffer( key ) )
      throw new TypeError( 'Key must be a buffer' )

    switch( this.type ) {
      case 'HS': return this._verifyHMAC( signature, input, key )
      case 'RS': return this._verifyRSA( signature, input, key )
      case 'ES': return this._verifyECDSA( signature, input, key )
      default:
        throw new Error( 'Unsupported type "' + this.type + '"' )
    }

  }
function( signature, input, key ) {

    if( !Buffer.isBuffer( input ) )
      throw new TypeError( 'Input must be a buffer' )

    if( !Buffer.isBuffer( signature ) )
      throw new TypeError( 'Signature must be a buffer' )

    if( this.type === 'PLAIN' )
      return signature.length === 0

    if( !Buffer.isBuffer( key ) )
      throw new TypeError( 'Key must be a buffer' )

    switch( this.type ) {
      case 'HS': return this._verifyHMAC( signature, input, key )
      case 'RS': return this._verifyRSA( signature, input, key )
      case 'ES': return this._verifyECDSA( signature, input, key )
      default:
        throw new Error( 'Unsupported type "' + this.type + '"' )
    }

  }
function ( signature , input , key ) { if ( ! Buffer . isBuffer ( input ) ) throw new TypeError ( 'Input must be a buffer' ) if ( ! Buffer . isBuffer ( signature ) ) throw new TypeError ( 'Signature must be a buffer' ) if ( this . type === 'PLAIN' ) return signature . length === 0 if ( ! Buffer . isBuffer ( key ) ) throw new TypeError ( 'Key must be a buffer' ) switch ( this . type ) { case 'HS' : return this . _verifyHMAC ( signature , input , key ) case 'RS' : return this . _verifyRSA ( signature , input , key ) case 'ES' : return this . _verifyECDSA ( signature , input , key ) default : throw new Error ( 'Unsupported type "' + this . type + '"' ) } }
Verify a signature against an input & key
@param  {Buffer} signature
@param  {Buffer} input
@param  {Buffer} key
@return {Boolean}
Verify a signature against an input & key