|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ecash.kernel.Note
Contains a bank note and its corresponding signed hash. This allows a user to check that the bank note is valid, and of course that the bank signed it.
Constructor Summary | |
Note(java.math.BigInteger bigM,
java.math.BigInteger signedNote)
Constructs a Note object from a bank note, called bigM, and its corresponding signed hash, called signedNote. |
|
Note(java.lang.String value)
Re-build the object from it's string representation. |
Method Summary | |
boolean |
checkRIS(java.math.BigInteger challengeRIS,
RISPart risPart)
Checks if the revealed part of the RIS is correct. |
boolean |
checkSignature(PubKey pubKey)
Checks if the signature on the note is valid, or that the hash of the signed note corresponds to the note. |
java.lang.String |
getAmount()
Returns the amount of the note. |
java.math.BigInteger |
getBigM()
Returns the bank note. |
java.math.BigInteger |
getSignedNote()
Returns the signed hash of the note. |
static Note |
load(java.lang.String filename)
Re-build the object from it's file representation. |
void |
save(java.lang.String filename)
Saves this object into it's file representation. |
java.lang.String |
toString()
Returns a string representation of this Note. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Note(java.math.BigInteger bigM, java.math.BigInteger signedNote)
bigM
- the bank notesignedNote
- a signed hash of the notepublic Note(java.lang.String value)
value
- the string representation of the objectMethod Detail |
public java.math.BigInteger getBigM()
public java.math.BigInteger getSignedNote()
public boolean checkSignature(PubKey pubKey)
pubKey
- the public key of the bank
public boolean checkRIS(java.math.BigInteger challengeRIS, RISPart risPart)
challengeRIS
- the challenge asked by the sellerrisPart
- the revealed part of the RIS, given by the buyer
public java.lang.String getAmount()
public static Note load(java.lang.String filename)
filename
- the filenamepublic void save(java.lang.String filename)
filename
- the filenamepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |