java.lang.Object | |
↳ | java.security.CodeSource |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new instance of
CodeSource with the specified
URL and the Certificate s. | |||||||||||
Constructs a new instance of
CodeSource with the specified
URL and the CodeSigner s. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compares the specified object with this
CodeSource for equality. | |||||||||||
Returns the certificates of this
CodeSource . | |||||||||||
Returns the
CodeSigner s of this CodeSource . | |||||||||||
Returns the location of this
CodeSource . | |||||||||||
Returns the hash code value for this
CodeSource . | |||||||||||
Indicates whether the specified code source is implied by this
CodeSource . | |||||||||||
Returns a string containing a concise, human-readable description of the
this
CodeSource including its location, its certificates and its
signers. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Constructs a new instance of 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 .
|
Constructs a new instance of CodeSource
with the specified
URL
and the CodeSigner
s.
location | the URL representing the location from where code is
loaded, maybe null . |
---|---|
signers | the CodeSigner s of the code, loaded from the specified
location . Maybe null .
|
Compares the specified object with this 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.
obj | object to be compared for equality with this CodeSource . |
---|
true
if the specified object is equal to this CodeSource
, otherwise false
.
Returns the certificates of this CodeSource
. If the
CodeSource(URL, CodeSigner[])
constructor was used to create
this instance, the certificates are obtained from the supplied signers.
External modifications of the returned Certificate[]
has no
impact on this CodeSource
.
CodeSource
or null
if
there is none.
Returns the CodeSigner
s of this CodeSource
. If the
CodeSource(URL, Certificate[])
constructor was used to create
this instance, the signers are obtained from the supplied certificates.
Only X.509 certificates are analyzed.
CodeSource
, or null
if there
is none.
Returns the location of this CodeSource
.
CodeSource
, maybe null
.
Returns the hash code value for this CodeSource
.
Returns the same hash code for CodeSource
s that are
equal to each other as required by the general contract of
hashCode()
.
CodeSource
.Indicates whether the specified code source is implied by this CodeSource
. Returns true
if all of the following conditions are
true
, otherwise false
:
cs
is not null
CodeSource
has associated certificates, all
certificates are present in cs
. The certificates are extracted
from the signers if signers are present.
CodeSource
's location is not null
, the
following conditions are checked
CodeSource
's location is not null
CodeSource
's location protocol is equal to cs
's
location protocol
CodeSource
's location host is not null
, the
following conditions are checked
cs
's host is not null
SocketPermission
of this CodeSource
's location
host implies the SocketPermission
of cs
's location host
CodeSource
's location port != -1 the port of cs
's location is equal to this CodeSource
's location port
CodeSource
's location file matches cs
's file
whereas special wildcard matching applies as described below
CodeSource
's location reference is equal to to cs
's location reference
Note: If this CodeSource
has a null
location and not any
certificates, this method returns true
.
Matching rules for the CodeSource
's location file:
CodeSource
's location file ends with "/-"
,
then cs
's file must start with CodeSource
's location file
(exclusive the trailing '-')
CodeSource
's location file ends with "/*"
,
then cs
's file must start with CodeSource
's location file
(exclusive the trailing '*') and must not have any further '/'
CodeSource
's location file ends with "/"
,
then cs
's file must start with CodeSource
's location file
CodeSource
's location file does not end with "/"
, then cs
's file must start with CodeSource
's
location file with the '/' appended to it.
http: http://*/milestones/M9/* http://*.apache.org/milestones/M9/* http://harmony.apache.org/milestones/- http://harmony.apache.org/milestones/M9/apache-harmony.jar
cs | the code source to check. |
---|
true
if the argument code source is implied by this
CodeSource
, otherwise false
.
Returns a string containing a concise, human-readable description of the
this CodeSource
including its location, its certificates and its
signers.
CodeSource
.