code: def isSignatureValid(expected, received):
      
      if expected:
          if not received or expected != received:
              return False
      else:
          if received:
              return False
      return True
docs: Verifies that the received signature matches the expected value