complete signature validation logic