|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.security.CodeSource
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.
Constructor Summary | |
CodeSource(URL url,
Certificate[] certs)
Constructs a CodeSource and associates it with the specified location and set of certificates. |
Method Summary | |
boolean |
equals(Object obj)
Tests for equality between the specified object and this object. |
Certificate[] |
getCertificates()
Returns the certificates associated with this CodeSource. |
URL |
getLocation()
Returns the location associated with this CodeSource. |
int |
hashCode()
Returns the hash code value for this object. |
boolean |
implies(CodeSource codesource)
Returns true if this CodeSource object "implies" the specified CodeSource. |
String |
toString()
Returns a string describing this CodeSource, telling its URL and certificates. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CodeSource(URL url, Certificate[] certs)
url
- the location (URL).certs
- the certificate(s).Method Detail |
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public boolean equals(Object obj)
equals
in class Object
obj
- the object to test for equality with this object.
Object.hashCode()
,
Hashtable
public final URL getLocation()
public final 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.
public String toString()
toString
in class Object
|
JavaTM 2 Platform Std. Ed. v1.4.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2002 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.