|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ecash.internet.ECashGen
Generic class for ECashBank, ECashBuyer and ECashSeller.
ECashBank
,
ECashBuyer
,
ECashSeller
Field Summary | |
static int |
BANK_PORT
This constant defines on which port the bank is waiting for requests. |
static int |
CHEAT_AMOUNTS_NOT_ALL_THE_SAME
This code, used locally in reports or as function returned value, indicates that the amounts of the revealed notes are not all the same. |
static int |
CHEAT_NOTE_REUSED_BY_BUYER
This code, used locally in reports or as function returned value, indicates that the buyer re-used twice the same note. |
static int |
CHEAT_NOTE_REUSED_BY_SELLER
This code, used locally in reports or as function returned value, indicates that the seller re-used twice the same note. |
static int |
CHEAT_WRONG_PASSWORD
This code, used locally in reports or as function returned value, indicates that the password (or the bank account) is not correct. |
static int |
CHEAT_WRONG_REVEALED_NOTES
This code, used locally in reports or as function returned value, indicates that the revealed notes are not correct. |
static int |
CHEAT_WRONG_RIS
This code, used locally in reports or as function returned value, indicates that the RIS is not correct. |
static int |
CHEAT_WRONG_SIGNATURE
This code, used locally in reports or as function returned value, indicates that the signature is not correct (or that the signed part doesn't correspond to the unsigned one). |
static int |
CONNECTION_CLOSED_BY_SERVER
This code, used locally in reports or as function returned value, indicates that the connection was closed by the server. |
static int |
KEY_NOT_AVAILABLE
This code, used locally in reports or as function returned value, indicates that the public key is not available. |
static int |
NOTES_EXP_SYNTAX_ERROR
This code, used locally in reports or as function returned value, indicates that the notes expression carries one or several syntax errors. |
static int |
NOTES_NOT_AVAILABLE
This code, used locally in reports or as function returned value, indicates that the requested notes (for example during a paying operation) are not availables. |
static int |
OK
This code, used locally in reports or as function returned value, indicates that the operation (buy, deposit, ...) was correct and no cheating has been detected (like re-using a note twice, wrong signature, ...). |
static java.lang.String |
OP_BUY
This code, transmitted through the network, informs the partner of the current operation: The sender wants to buy some notes. |
static java.lang.String |
OP_DEPOSIT
This code, transmitted through the network, informs the partner of the current operation: The sender wants to deposit some notes at the bank. |
static java.lang.String |
OP_GET_KEY
This code, transmitted through the network, informs the partner of the current operation: The sender wants the public key of the bank. |
static java.lang.String |
OP_PAY
This code, transmitted through the network, informs the partner of the current operation: The sender wants to give some notes to the seller. |
static int |
SELLER_PORT
This constant defines on which port the seller is waiting for requests. |
static int |
SERVER_NOT_READY
This code, used locally in reports or as function returned value, indicates that the server (bank or seller) is not ready yet. |
static java.lang.String |
TRANS_OK
This code, transmitted through the network, informs the partner that the last set of transactions was successful. |
Method Summary | |
boolean |
checkIfNotesAvailable(java.util.Vector notesExpItems,
java.util.Vector amountList)
Returns true if the amounts list contains all the notes found in the notes expression items list, false otherwise. |
void |
close()
Closes the socket. |
PubKey |
getKey()
Returns the public key of the bank. |
int |
getKey(java.lang.String bankAddress)
Connects to the bank and asks its public key. |
java.lang.String |
getREGEXP()
Returns the regular expression that is used to define the syntax of the notes expression. |
boolean |
handshakeClient(java.lang.String serverAddress,
int port)
Connects to a server and constructs a secure crypted channel to it. |
boolean |
handshakeServer(int port)
Connects to a client and constructs a secure crypted channel to it. |
boolean |
hasBankKey()
Returns true if the public key is available, false otherwise. |
java.lang.String |
receiveCrypted()
Receives a message from a secured crypted channel. |
void |
sendCrypted(char[] message)
Sends a array of char, likely a password, over a secured crypted channel. |
void |
sendCrypted(java.lang.String message)
Sends a message over a secured crypted channel. |
void |
setKey(PubKey pubKey)
Sets the public key. |
void |
stopServer()
Stops the server. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String OP_BUY
public static final java.lang.String OP_PAY
public static final java.lang.String OP_DEPOSIT
public static final java.lang.String OP_GET_KEY
public static final java.lang.String TRANS_OK
public static final int OK
public static final int CHEAT_WRONG_PASSWORD
public static final int CHEAT_AMOUNTS_NOT_ALL_THE_SAME
public static final int CHEAT_WRONG_REVEALED_NOTES
public static final int CHEAT_WRONG_SIGNATURE
public static final int CHEAT_WRONG_RIS
public static final int CHEAT_NOTE_REUSED_BY_SELLER
public static final int CHEAT_NOTE_REUSED_BY_BUYER
public static final int CONNECTION_CLOSED_BY_SERVER
public static final int SERVER_NOT_READY
public static final int KEY_NOT_AVAILABLE
public static final int NOTES_EXP_SYNTAX_ERROR
public static final int NOTES_NOT_AVAILABLE
public static final int BANK_PORT
public static final int SELLER_PORT
Method Detail |
public boolean hasBankKey()
public PubKey getKey()
public int getKey(java.lang.String bankAddress)
bankAddress
- the address of the bank, for example
"123.123.33.123"
public void setKey(PubKey pubKey)
pubKey
- the public keypublic java.lang.String getREGEXP()
public void stopServer()
public boolean checkIfNotesAvailable(java.util.Vector notesExpItems, java.util.Vector amountList)
notesExpItems
- a vector of String that represents a splitted
notes expression
public boolean handshakeClient(java.lang.String serverAddress, int port)
serverAddress
- the address of the serverport
- the port of the server
public boolean handshakeServer(int port)
port
- the port of the server
public void sendCrypted(java.lang.String message)
message
- the message to crypt and to sendhandshakeClient(java.lang.String, int)
,
handshakeServer(int)
public void sendCrypted(char[] message)
message
- the message to crypt and to sendhandshakeClient(java.lang.String, int)
,
handshakeServer(int)
public java.lang.String receiveCrypted()
handshakeClient(java.lang.String, int)
,
handshakeServer(int)
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |