|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.CodeSource
Untamed:
This class extends the concept of a codebase to encapsulate not only the location (URL) but also the certificate(s) that were used to verify signed code originating from that location.
Field Summary | |
private java.security.cert.Certificate[] |
certs
|
private URL |
location
The code location. |
private SocketPermission |
sp
|
Constructor Summary | |
CodeSource(URL url,
java.security.cert.Certificate[] certs)
Enabled: Constructs a CodeSource and associates it with the specified location and set of certificates. |
Method Summary | |
boolean |
equals(Object obj)
Suppressed: Tests for equality between the specified object and this object. |
java.security.cert.Certificate[] |
getCertificates()
Enabled: Returns the certificates associated with this CodeSource. |
URL |
getLocation()
Enabled: Returns the location associated with this CodeSource. |
int |
hashCode()
Suppressed: Returns the hash code value for this object. |
boolean |
implies(CodeSource codesource)
Enabled: Returns true if this CodeSource object "implies" the specified CodeSource. |
private boolean |
matchCerts(CodeSource that)
Returns true if all the certs in this CodeSource are also in that. |
private boolean |
matchLocation(CodeSource that)
Returns true if two CodeSource's have the "same" location. |
private void |
readObject(ObjectInputStream ois)
Restores this object from a stream (i.e., deserializes it). |
String |
toString()
Suppressed: Returns a string describing this CodeSource, telling its URL and certificates. |
private void |
writeObject(ObjectOutputStream oos)
Writes this object out to a stream (i.e., serializes it). |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private URL location
private transient java.security.cert.Certificate[] certs
private transient SocketPermission sp
Constructor Detail |
public CodeSource(URL url, java.security.cert.Certificate[] certs)
url
- the location (URL).certs
- the certificate(s).Method Detail |
public int hashCode()
hashCode
in class Object
java.lang.Object#equals(java.lang.Object)
,
java.util.Hashtable
public boolean equals(Object obj)
equals
in class Object
obj
- the object to test for equality with this object.
Object.hashCode()
,
java.util.Hashtable
public final URL getLocation()
public final java.security.cert.Certificate[] getCertificates()
public boolean implies(CodeSource codesource)
More specifically, this method makes the following checks, in order. If any fail, it returns false. If they all succeed, it returns true.
For example, the codesource objects with the following locations and null certificates all imply the codesource with the location "http://java.sun.com/classes/foo.jar" and null certificates:
http: http://*.sun.com/classes/* http://java.sun.com/classes/- http://java.sun.com/classes/foo.jarNote that if this CodeSource has a null location and a null certificate chain, then it implies every other CodeSource.
codesource
- CodeSource to compare against.
private boolean matchCerts(CodeSource that)
that
- the CodeSource to check against.private boolean matchLocation(CodeSource that)
that
- CodeSource to compare againstpublic String toString()
toString
in class Object
private void writeObject(ObjectOutputStream oos) throws IOException
IOException
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |