Code being executed is always considered to come from a particular "code source" (represented by an object of type CodeSource). The code source includes not only the location (URL) where the code originated from, but also a reference to the certificate(s) containing the public key(s) corresponding to the private key(s) used to sign the code. Certificates in a code source are referenced by symbolic alias names from the user's keystore.
Each grant entry includes one or more "permission entries" preceded by optional codeBase and signedBy name/value pairs that specify which code you want to grant the permissions. The basic format of a grant entry is the following:
I want to access this codebase value(URL) in the policy file. Any way, aPI can be used? I read that it is represented by an object of type CodeSource. But how to access this object i didnt get that. Can you please help me with this?
I don't get it. The grant block doesn't have a unique identity, so how are you going to specify which one you want the codebase for? This all seems back to front to me. Surely what you want is the grant block, or rather the permissions it contains, for the codebase in question?