This class extends the concept of a codebase to encapsulate not only the location (URL) but also the certificate chains that were used to verify signed code originating from that location.
| Modifier and Type | Field and Description |
|---|---|
| private transient Certificate[] | |
| private transient CertificateFactory | |
| private final URL | location
The code location. |
| private transient String | locationNoFragString
A |
| private static final long | |
| private transient CodeSigner[] | |
| private transient SocketPermission | sp
References Deprecated
SocketPermission is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Access | Constructor and Description |
|---|---|
| public | CodeSource(URL
the location (URL). It may be url, Certificate[] null.the certificate(s). It may be certs)null. The contents
of the array are copied to protect against subsequent modification.Constructs a |
| public | CodeSource(URL
the location (URL). It may be url, CodeSigner[] null.the code signers. It may be signers)null. The contents
of the array are copied to protect against subsequent modification.Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| private CodeSigner[] | |
| public boolean | Returns: true if the objects are considered equal,
false otherwise.the object to test for equality with this object. obj)Overrides java. Tests for equality between the specified object and this object. |
| public final Certificate[] | Returns: a copy of the certificate array, ornull if there
is none.Returns the certificates associated with this |
| public final CodeSigner[] | Returns: a copy of the code signer array, ornull if there
is none.Returns the code signers associated with this |
| public final URL | Returns: the location (URL), ornull if no URL was supplied
during construction.Returns the location associated with this |
| pack-priv String | |
| public int | Returns: the hash code value for this objectOverrides java. Returns the hash code value for this object. |
| public boolean | Returns: true if the specified codesource is implied by this
codesource, false if not.CodeSource to compare against.Returns true if this |
| pack-priv boolean | matchCerts(CodeSource
the that, boolean CodeSource to check against.if strict)true then a strict equality match is performed.
Otherwise, a subset match is performed.Returns |
| private boolean | matchLocation(CodeSource
CodeSource to compare againstReturns |
| private void | readObject(ObjectInputStream
the ois)ObjectInputStream from which data is readRestores this object from a stream (i.e., deserializes it). |
| public String | Returns: information about thisCodeSource.Overrides java. Returns a string describing this |
| private void | writeObject(ObjectOutputStream
the oos)ObjectOutputStream to which data is writtenWrites this object out to a stream (i.e., serializes it). |
| certs | back to summary |
|---|---|
| private transient Certificate[] certs | |
| factory | back to summary |
|---|---|
| private transient CertificateFactory factory | |
| location | back to summary |
|---|---|
| private final URL location The code location. | |
| locationNoFragString | back to summary |
|---|---|
| private transient String locationNoFragString A | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID
| |
| signers | back to summary |
|---|---|
| private transient CodeSigner[] signers | |
| sp | back to summary |
|---|---|
| private transient SocketPermission sp
References Deprecated
See corresponding docs for further information.
| |
| CodeSource | back to summary |
|---|---|
| public CodeSource(URL url, Certificate[] certs) Constructs a
| |
| CodeSource | back to summary |
|---|---|
| public CodeSource(URL url, CodeSigner[] signers) Constructs a
| |
| convertCertArrayToSignerArray | back to summary |
|---|---|
| private CodeSigner[] convertCertArrayToSignerArray(Certificate[] certs) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Tests for equality between the specified object and this
object. Two | |
| getCertificates | back to summary |
|---|---|
| public final Certificate[] getCertificates() Returns the certificates associated with this
If this
| |
| getCodeSigners | back to summary |
|---|---|
| public final CodeSigner[] getCodeSigners() Returns the code signers associated with this
If this
| |
| getLocation | back to summary |
|---|---|
| public final URL getLocation() Returns the location associated with this
| |
| getLocationNoFragString | back to summary |
|---|---|
| pack-priv String getLocationNoFragString() Returns a | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hash code value for this object.
| |
| implies | back to summary |
|---|---|
| public boolean implies(CodeSource codesource) Returns true if this
More specifically, this method makes the following checks.
If any fail, it returns
For example, the codesource objects with the following locations
and
http:
http://*.example.com/classes/*
http://www.example.com/classes/-
http://www.example.com/classes/foo.jar
Note that if this CodeSource has a null location and a
null certificate chain, then it implies every other
CodeSource.
| |
| matchCerts | back to summary |
|---|---|
| pack-priv boolean matchCerts(CodeSource that, boolean strict) Returns
| |
| matchLocation | back to summary |
|---|---|
| private boolean matchLocation(CodeSource that) Returns
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException Restores this object from a stream (i.e., deserializes it).
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string describing this | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream oos) throws IOException Writes this object out to a stream (i.e., serializes it).
| |