How to verify gang signature

How to check if a .jar-File file has a signature and how to check this signature in my code to make sure that my code only runs with a specific library?

+3
source share
1 answer

Not sure if your question is how to program it yourself or if you are referring to how to get Java to automatically check it.

For the second, you can use the security features provided with Java. First, you must digitally sign your jar file (using the jarsigner tool).

Then you must run your program using the security manager ( System.setSecurityManager(new SecurityManager()).

, , , , .

grant signedBy "mrm" {
    permission ...
};

Java .

+2

All Articles