As Rick wrote the pid is some changing value and so no use is in it. I see rather their a
FLAW in your concept for using the pid for some nasty operation. Dont do it - find some other way.
When you need no allowed apps than you need some authorization process. Sound you need some password or PKI implementation. See
overview PKI.
Another appproach is that the client provides some interface to get some authentication like some
challenge and response logic.