Perfect. You gave him the comfort of knowing you were just going about your business, and yet refused to divulge personal info, which he had no problem with. He has absolutely every right to ask, which he did. He did not demand.
THIS should be a good example of how police encounters with law abiding citizens should go!