public class CodeSource extends Object implements Serializable
CodeSource
encapsulates the location from where code is loaded and
the certificates that were used to verify that code. This information is used
by SecureClassLoader
to define protection domains for loaded classes.SecureClassLoader
,
ProtectionDomain
,
Serialized FormConstructor and Description |
---|
CodeSource(URL location,
Certificate[] certs)
Constructs a new instance of
CodeSource with the specified
URL and the Certificate s. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares the specified object with this
CodeSource for equality. |
Certificate[] |
getCertificates() |
URL |
getLocation()
Returns the location of this
CodeSource . |
int |
hashCode()
The (default) object hashcode: for transient objects this is simply the
address of the instance in memory, for persistent objects it is the
address at which the instance was first created (maybe in a previous
activation of the VM).
|
boolean |
implies(CodeSource cs) |
String |
toString()
Returns a string containing a concise, human-readable description of the
this
CodeSource including its location, its certificates and its
signers. |
public CodeSource(URL location, Certificate[] certs)
CodeSource
with the specified
URL
and the Certificate
s.location
- the URL
representing the location from where code is
loaded, maybe null
.certs
- the Certificate
used to verify the code, loaded from
the specified location
, maybe null
.public boolean equals(Object obj)
CodeSource
for equality.
Returns true
if the specified object is also an instance of
CodeSource
, points to the same URL
location and the two
code sources encapsulate the same Certificate
s. The order of the
Certificate
s is ignored by this method.public final Certificate[] getCertificates()
null
public final URL getLocation()
CodeSource
.CodeSource
, maybe null
.public int hashCode()
Object
public boolean implies(CodeSource cs)
false
.