A PolicyEntry is a (CodeSource,Permission) pair. The CodeSource contains the (URL, PublicKey) that together identify where the Java bytecodes come from and who (if anyone) signed them. The URL could refer to localhost. The URL could also be null, meaning that this policy entry is given to all comers, as long as they match the signer field. The signer could be null, meaning the code is not signed.
The Permission contains the (Type, Name, Action) triplet.
For now, the Policy object retrieves the public key from the X.509 certificate on disk that corresponds to the signedBy alias specified in the Policy config file. For reasons of efficiency, the Policy object keeps a hashtable of certs already read in. This could be replaced by a secure internal key store.
For example, the entry
permission java.io.File "/tmp", "read,write", signedBy "Duke";is represented internally
FilePermission f = new FilePermission("/tmp", "read,write"); PublicKey p = publickeys.get("Duke"); URL u = InetAddress.getLocalHost(); CodeBase c = new CodeBase( p, u ); pe = new PolicyEntry(f, c);@author Marianne Mueller @author Roland Schemers @see java.security.CodeSource @see java.security.Policy @see java.security.Permissions @see java.security.ProtectionDomain
|
|
|
|
|
|
|
|