We assume that the same rule would apply to the contents of his or her purse, wallet, or pockets.
To require such a performance is a serious invasion of personal privacy and dignity, and so unlawful if 'unwarranted'.