Ok, but let’s back it up one step.
Am I (a random internet guy) allowed to call the company you claim you currently work for on LinkedIn, and ask them whether you work there in such and such a position? Can I ask them how much they pay you?
Sure, I can ask, but can they answer? Is all or some of that really privileged information? There are two parties in your employment, and both own the information. Are you prohibited from telling others you work there or how much they pay you? If not, why would the employer be prohibited from telling others?