|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectP2PWNC.P2PWNCProto
P2PWNC.P2PWNCConverter
This class provides conversion functionality from the internal representation to text messages and vice versa. The methods provided have to do with parsing text messages read from the network (that is from the socket the client listens for and sends messages to the service provider).
Field Summary | |
protected Base64 |
b64Encoder
Base64 encoder/decoder. |
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). |
Constructor Summary | |
(package private) |
P2PWNCConverter()
Constructs a new P2PWNCConverter object, initializing its b64encoder field. |
Method Summary | |
java.lang.String |
constructConnMsg(P2PWNCCert cert)
Constructs a CONN text message. |
static void |
main(java.lang.String[] args)
|
(package private) int |
parseCACKMsg(java.lang.String text)
Parses a CACK text message. |
(package private) P2PWNCRREQMsgInfo |
parseRREQMsg(java.lang.String text)
Parses an RREQ text message. |
java.lang.String |
receiptToTextMsg(P2PWNCReceipt rcpt)
Converts a P2PWNCReceipt object to an RCPT text message to be sent to the service provider. |
P2PWNCReceipt |
textMsgToReceipt(java.lang.String text)
Parses an RCPT text message to the correspondent P2PWNCReceipt object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Base64 b64Encoder
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 |
P2PWNCConverter()
Method Detail |
public java.lang.String receiptToTextMsg(P2PWNCReceipt rcpt)
Field | Description |
---|---|
Message Type | RCPT |
Content-length | Length of the message in octets |
Algorithm | Algorithm identifier and bit length of signature(for example RSA1024) |
Timestamp | Session timestamp (in RFC822 format) |
Weight | Current session traffic (in bytes) |
Client certificate | The client certificate data, that is the certificate issuer's public key, user's public key and issuer signature. These fields are base64-encoded and separated by two CRLF sequences. |
Service provider public key | This field is the base64 encoded public key of the service provider, ending with two CRLF sequences |
Receipt signature | This is the base64 signature of the receipt, produced by the service consumer (client) using its private key. |
rcpt
- P2PWNCReceipt
The P2PWNCReceipt object that is to be converted to a text RCPT message
public P2PWNCReceipt textMsgToReceipt(java.lang.String text)
text
- String
The text message to be parsed.
public java.lang.String constructConnMsg(P2PWNCCert cert)
Field | Description |
---|---|
Message Type | CONN |
Content-length | Length of the message in octets |
Client certificate | The client certificate data, that is the certificate issuer's public key, user's public key and issuer signature. These fields are base64-encoded and separated by two CRLF sequences. |
cert
- P2PWNCCert
The client certificate.
int parseCACKMsg(java.lang.String text)
Field | Description |
---|---|
Message Type | CACK |
Content-length | Length of the message in octets |
Timestamp | The session timestamp (in RFC822 format). |
text
- String
The CACK text message to be parsed.
P2PWNCRREQMsgInfo parseRREQMsg(java.lang.String text)
Field | Description |
---|---|
Message Type | RREQ |
Content-length | Length of the message in octets |
Algorithm | Algorithm identifier and bit length of the provider's public key (for example RSA1024) |
Weight | Current session traffic (in bytes, as measured by the provider) |
Service provider public key | This field is the base64 encoded public key of the service provider |
text
- String
The RREQ text message to be parsed.
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |