|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectP2PWNC.P2PWNCProto
P2PWNC.P2PWNCClient
This class provides the functionality of a P2PWNC protocol client program. That is, it provides functions to connect to the service provider and maintain a session.
Field Summary | |
protected P2PWNCCert |
clientCert
Consumer (client) certificate. |
protected P2PWNCKey |
clientPrivKey
Consumer (client) secret key. |
protected java.net.Socket |
clientSocket
Socket through which the communication to the service provider is performed. |
protected P2PWNCConverter |
converter
Instance of the P2PWNCConverter class, responsible for conversions of messages from wire (text) to internal representation. |
protected P2PWNCCrypt |
cryptHandler
Instance of the P2PWNCCrypt class, responsible for cryptograhic operations performed by the client (such as receipt signing). |
protected int |
currentWeight
Current weight of a provider-consumer session (that is the amount of traffic initiated by/forwarded to the consumer. |
protected P2PWNCio |
ioHandler
Instance of the P2PWNCio class, responsible for i/o operations, such as reading keys and certificates, reading/writing messages from/to the network, etc. |
static int |
P2PWNC_ALGO_ECC
Elliptic Curve cryptosystem identifier. |
static int |
P2PWNC_ALGO_RSA
RSA cryptosystem identifier. |
static int |
P2PWNC_MSG_CACK
This message type corresponds to a P2PWNC "connection acknowledgement" message (CACK). |
static int |
P2PWNC_MSG_CONN
This message type corresponds to a P2PWNC "connect" message (CONN). |
static int |
P2PWNC_MSG_RCPT
This message type corresponds to a P2PWNC "receipt" message (RCPT). |
static int |
P2PWNC_MSG_RREQ
This message type corresponds to a P2PWNC "receipt request" message (RREQ). |
static int |
P2PWNC_MSG_TEAR
This message type corresponds to a P2PWNC "tear connection" message (TEAR). |
static int |
P2PWNC_SERVER_PORT
The standard port a service provider listens for client messages, as specified by the P2PWNC protocol). |
protected P2PWNCKey |
providerKey
Service provider public key. |
protected java.net.InetAddress |
serverAddr
Internet address of the service provider. |
protected int |
sessionTimestamp
Session timestamp. |
Constructor Summary | |
(package private) |
P2PWNCClient(java.lang.String certPath,
java.lang.String privKeyPath)
Constructs a P2PWNCClient object, reading the client certificate and secret key from files. |
Method Summary | |
boolean |
connectToP2PWNCServer(java.lang.String hostname,
int port)
Connects to the service provider. |
static void |
main(java.lang.String[] args)
|
void |
P2PWNCClientFunc()
Main client function. |
static void |
printUsage()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected P2PWNCKey providerKey
protected P2PWNCCert clientCert
protected P2PWNCKey clientPrivKey
protected int sessionTimestamp
protected int currentWeight
protected P2PWNCio ioHandler
protected P2PWNCCrypt cryptHandler
protected P2PWNCConverter converter
protected java.net.Socket clientSocket
protected java.net.InetAddress serverAddr
public static final int P2PWNC_SERVER_PORT
public static final int P2PWNC_ALGO_RSA
public static final int P2PWNC_ALGO_ECC
public static final int P2PWNC_MSG_RCPT
public static final int P2PWNC_MSG_CONN
public static final int P2PWNC_MSG_RREQ
public static final int P2PWNC_MSG_CACK
public static final int P2PWNC_MSG_TEAR
Constructor Detail |
P2PWNCClient(java.lang.String certPath, java.lang.String privKeyPath)
certPath
- String
The path of the client certificate file.privKeyPath
- String
The path of the file where the secret key of the client is stored.Method Detail |
public boolean connectToP2PWNCServer(java.lang.String hostname, int port)
hostname
- String
The IP address of the service provider.port
- int
The TCP port the service provider listens for client messages.
public void P2PWNCClientFunc()
public static void printUsage()
public static void main(java.lang.String[] args) throws java.io.IOException, java.security.SignatureException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.SignatureException
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |