|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fhg.igd.semoa.server.Ticket
Represents the address of an agent's hop. Agents set tickets in order to tell agent servers where to send them next. Agent servers pass tickets to agents in order to tell them where they came from.
This ticket supports methods for specifying QoS parameters that shall apply to the transport of the agent. The parameters which can be specified cover security parameters to be met by agent transport gateways. Furthermore, certificate information of the ticket's target can be passed in a ticket.
An agents server should set the certificate chain of an agent's sender in the ticket that is given to the agent. This enables agents to acquire evidence on their senders' identities. However, trust in a ticket requires trust in the hosting server, always remember that.
Please note that not all protocols support secure transport. QoS parameters are only checked by gateways which implement protocols that do support the requested security services. There is no guarantee whatsoever that the agent server or the gateways actually enable the requested security services.
This implementation is preliminary. A more elaborate version will be implemented when the nature of the parameters to be specified are better understood.
This class uses de.fhg.igd.util.URL rather than
java.net.URLbecause no connection handlers need
to be implemented that way.
| Field Summary | |
private X509Certificate |
cachedCert_
The cached certificate object. |
private byte[] |
certificate_
The encoded certificate of the agent's sender. |
private String |
cipherSuite_
The SSL cipher suite that was used for the agent's transport, or null if the transport
wasn't protected. |
private ShipService |
ship_
The reference to the Ship service. |
private URL[] |
target_
The list of alternative URLs to the destination. |
| Constructor Summary | |
Ticket(String url)
Creates a ticket with the given URL as the destination for this ticket. |
|
Ticket(URL url)
Creates a ticket with the given URL as the destination for this ticket. |
|
Ticket(URL[] urls)
Creates a ticket with a list of alternative URLs for the next hop. |
|
Ticket(URL senderURL,
byte[] senderCert,
String cipherSuite)
Creates a ticket with the given URL and certificate. |
|
Ticket(URL senderURL,
X509Certificate senderCert)
Creates a ticket with the given URL and certificate. |
|
| Method Summary | |
X509Certificate |
getCertificate()
Returns the certificate of the sender of the agent, or null if no cert is available. |
String |
getCipherSuite()
|
String[] |
getProtocols()
Returns the list of protocols defined in the ticket such that each protocol appears at most once. |
URL |
getTarget()
Returns the preferred target of this ticket. |
URL[] |
getTarget(String protocol)
Returns the target URLs matching the given protocol in the preferred order (as defined in the constructor). |
URL[] |
getTargets()
|
boolean |
isLocal()
This method determines whether this ticket is pointing to the local host. |
private Object |
isLocal0()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private URL[] target_
private byte[] certificate_
private String cipherSuite_
null if the transport
wasn't protected.
private ShipService ship_
Ship service.
Since we only need the service to obtain the local
ship server URL including the ship port,
it is sufficient to use the Server
interface of the service.
private transient X509Certificate cachedCert_
| Constructor Detail |
public Ticket(URL url)
de.fhg.igd.util.URL rather than
java.net.URL.
url - The URL where this ticket should point to.
NullPointerException - if the given URL is
null.
public Ticket(String url)
throws MalformedURLException
url - The URL where this ticket should point to.
NullPointerException - if the given URL is
null.
MalformedURLException - if the given URL is
not well-formed.public Ticket(URL[] urls)
urls - The list of alternative URLs for the next hop.
NullPointerException - if urls is
null or the length of the array is 0.
public Ticket(URL senderURL,
X509Certificate senderCert)
throws CertificateEncodingException
senderURL - The URL of the agent's sender.senderCert - The certificate of the agent's sender.
CertificateEncodingException - if the given
certificate is not null and cannot be
encoded properly.
NullPointerException - if senderURL is
null.
public Ticket(URL senderURL,
byte[] senderCert,
String cipherSuite)
throws CertificateEncodingException
senderURL - The URL of the agent's sender.senderCert - The encoding of the certificate of
the agent's sender.cipherSuite - The SSL cipher suite that was used
for the agent's transport, or null if
the transport wasn't protected. If there is a certificate
then there should also be a cipher suite and vice versa.
NullPointerException - if senderURL is
null.
CertificateEncodingException| Method Detail |
public final URL getTarget()
constructor that accepts muliple URLs on
initialization, the preferred target is always first target in the
list. If the ticket was issued by an agent server in order to
pass information to an agent on where it came from then the
returned URL is probably incomplete. In other words, the
returned URL does not contain sufficient information to create
return tickets from it. The only way to generate a valid return
ticket is to look up an appropriate URL based on the host name
that is contained in the returned URL.
public final URL[] getTargets()
public String getCipherSuite()
null if the transport was not
protected.public final URL[] getTarget(String protocol)
protocol is null then all target
URLs are returned.
protocol - The protocol that returned target URLs
should match.
public String[] getProtocols()
public final boolean isLocal()
This implementation simply compares the INET address of
the local host with those of the hosts of the stored
URLs. If a match is found the true is
returned.
true<\code> iff the ticket is pointing
to the local host.private final Object isLocal0()
public final X509Certificate getCertificate()
throws CertificateException
null if no cert is available.The certificate is decoded from the encoded representation stored in the ticket. The local installation must support an appropriate certificate decoding. Decoding is done by means of the default Java Security Provider (the first provider which implements a "X.509" certificate factory).
null if no cert
is stored in the ticket.
CertificateException - if no X.509 certificate
factory is available or the certficate could not be
decoded properly.public final String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||