|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ecash.kernel.Tools
This class provides some tools.
Field Summary | |
static int |
HASH_LENGTH
Defines the length in bits of the result of the hash function. |
Method Summary | |
static java.util.Vector |
notesExpToValues(java.lang.String notesExp)
Splits a notes expression into a vector of values. |
static java.lang.String |
readFile(java.lang.String filename)
Returns the content of a file as a String. |
static java.lang.Object |
readObject(java.lang.String filename)
Reads an object from the specified file. |
static double |
round(double d)
This method rounds a double by keeping only 2 decimals (centimes). |
static double |
round(java.lang.String s)
This method rounds a double by keeping only 2 decimals (centimes). |
static java.math.BigInteger |
sha(java.math.BigInteger message)
Computes a hash of the message, using the SHA function. |
static java.math.BigInteger |
signEnvelope(java.math.BigInteger envelope,
KeyRing keyRing)
Signs an envelope using the private key of the bank. |
static java.math.BigInteger |
unblind(java.math.BigInteger signedEnvelope,
FullNotesList fullNotesList,
BankChoice bankChoice,
PubKey pubKey)
Unblinds a signed envelope in order to get the signed note. |
static java.lang.String |
valuesToNotesExp(java.util.Vector v)
Transforms a vector of values (amounts) into a notes expression. |
static void |
writeFile(java.lang.String filename,
java.lang.String text)
Writes a String in a file. |
static void |
writeObject(java.lang.String filename,
java.lang.Object object)
Writes the specified object into the specified file. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HASH_LENGTH
Method Detail |
public static java.math.BigInteger signEnvelope(java.math.BigInteger envelope, KeyRing keyRing)
envelope
- the envelope to sign
public static java.math.BigInteger unblind(java.math.BigInteger signedEnvelope, FullNotesList fullNotesList, BankChoice bankChoice, PubKey pubKey)
signedEnvelope
- the envelope signed by the bank and containing
the wanted notefullNotesList
- the full notes listbankChoice
- the choice of the bankpubKey
- the public key of the bank
public static java.math.BigInteger sha(java.math.BigInteger message)
message
- the message to hash
public static java.lang.String readFile(java.lang.String filename)
filename
- the filename
Const.DIR
public static void writeFile(java.lang.String filename, java.lang.String text)
filename
- the filenametext
- the String to writeConst.DIR
public static java.lang.Object readObject(java.lang.String filename)
filename
- the filename
public static void writeObject(java.lang.String filename, java.lang.Object object)
filename
- the filenameobject
- the object to save in a filepublic static java.lang.String valuesToNotesExp(java.util.Vector v)
v
- the vector of amounts
notesExpToValues(java.lang.String)
public static java.util.Vector notesExpToValues(java.lang.String notesExp)
notesExp
- the notes expression to split
valuesToNotesExp(java.util.Vector)
public static double round(double d)
d
- the double to round
public static double round(java.lang.String s)
s
- the double to round
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |