negotiationRequestReceived(org.ssonet.net.SSONETContext context,
int negotiationType)
The method negotiationRequestReceived() is called by
SSONETProtocolStream , when a request for a
security goal and mechanisms negotiation, or only a mechanisms negotiation
was received, but before the negotiation of security parameters starts.

TestServer

TestServer

main

The main method of the server. It first initializes the server socket,
and waits for a connection of a client. When a client has connected,
it receives data packets and sends them back to the client.

Parameters:

arg - command line arguments (not used).

createContext

public org.ssonet.net.SSONETContext createContext()

Method of the implemented SSONETContextFactory.
It creates a SSONETContext object from the security
configuration of the predefined user named "Standardkunde".
Further, it registers the listeners, which are implemented by this server,
with the created SSONETContext.
This server implements all
listeners needed to influence SSONET connection establishment
according to the servers preferences.

contextChanged

public void contextChanged(org.ssonet.net.SSONETContext c)

Method of the implemented listener SSONETContextListener.
This method is called, if data in the SSONETContext has changed. This listener is
particularily usefull, if an application using SSONET has different modules,
which need to react to changes in the context data.

replaceContext

Method of the implemented listener SSONETContextListener.
In applications with different modules, the according method in SSONETContext
can be called by a module,
which want do completely replace a SSONETContext. Other modules may update
their SSONETContexts by this method.

checkCertificate

Method of the implemented listener CertificateListener.
When a certificate is received from the communication partner, this method
is called. It should decide about the validity the the certificate.
In SSONETContext, multiple CertificateListeners
can be registered. A certificate is considered valid, if no CertificateListener
says "invalid" and at least one CertificateListener says "valid".

context - the SSONETContext object, which requested the certificate check

cert - the certificate to check

Returns:

CertificateListener.VALID if the certificate is valid,CertificateListener.INVALID if the certificate is invalid,CertificateListener.NOT_TESTED if this method did not decide about the certificates validity.

decideSecurityGoal

Method of the implemented listener NegotiationListener.
If the first round of negotiation of security goals resulted in a conflict,
but it was configured to make a new decision in case of a conflict, this
method is called. It decides about giving in or not for the conflicting
security goal.
In SSONETContext, multiple NegotiationListeners
can be registered. If at least one listener gives in, i.e. returns true,
it is giving in in this conflict.

negotiationRequestReceived

The method negotiationRequestReceived() is called by
SSONETProtocolStream , when a request for a
security goal and mechanisms negotiation, or only a mechanisms negotiation
was received, but before the negotiation of security parameters starts.