I have a jar file that has some business critical functionality. Keeping this logic safe and preventing unauthorized usage of this jar is very important to me.
To achieve this, I have obfuscated the code before packaging it in the jar which provides some security against reverse engineering the logic by an unauthorized user.
Now I want to make sure that no unauthorized person is able to use the jar even if they get access to it. Currently, I am planning to have a root CA in my jar and issue certificates from the same CA to all the authorized consumers. Authorized users will pass this certificate in the code and it would be trusted using chain of command of certificates. Unauthorized parties wouldn't be able to use the jar since they wouldn't have these certs.
Is there any better way of doing this? Is there any problem with this solution?