Pretty sure most officers would consider that "brandishing" and you'd be on the wrong end of a conversation with them about it. Sucks, but it is what it is.
In the past I've answered the door with a gun in my hand hidden behind the door. Now I don't even bother answering if I'm not expecting someone, and again, a firearm is always within reach - whether on my person or not.
I've had a few roaming "salespeople" come up my driveway while I've been outside and I never let them get to the house or the garage. I will halt them as soon as I see them and then approach them but keep my distance, and tell them to hit the bricks. I've only had one moron try to come closer to me and I cut him short and told him to either turn around and go or it was going to get ugly for him.
He cussed me the entire way off my property. No skin off my nose; my job is protecting my family - not making friends with random strangers who can't follow simple instructions.