J
James D Carroll
I'm building a application framework that load classes with
Class.forName().NewInstance. The name would be stored in a database and the
code in a .jar in a directory. When a new class is added to the system I
would like to capture some kind of signature (maybe an MD5 hash of the file)
and store it. Then at runtime I would load the class, get its signature,
and compare it to what's in the database. If they match, then processing
would continue. The reason for this, of course, is to make sure that someone
has not altered the code and slipped it into the system or altered the
classpath to point at their code.
Any suggestions would be greatly appreciated.
Class.forName().NewInstance. The name would be stored in a database and the
code in a .jar in a directory. When a new class is added to the system I
would like to capture some kind of signature (maybe an MD5 hash of the file)
and store it. Then at runtime I would load the class, get its signature,
and compare it to what's in the database. If they match, then processing
would continue. The reason for this, of course, is to make sure that someone
has not altered the code and slipped it into the system or altered the
classpath to point at their code.
Any suggestions would be greatly appreciated.