|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.token.Token
|
+--webfunds.token.TokenSpender
This class represents a valuable token -- a withdrawn coin that may or may not at this stage be spent.
| Field Summary | |
static int |
SPENDER_ORIGINAL
The version number for this structure: 0: current |
static int |
TOK_CANCELLING
The state that the token is in within this phase (received, verified, spending, receipted.) How it is set and advanced is up to the higher layers. |
static int |
TOK_RECEIPTED
The state that the token is in within this phase (received, verified, spending, receipted.) How it is set and advanced is up to the higher layers. |
static int |
TOK_SENT
The state that the token is in within this phase (received, verified, spending, receipted.) How it is set and advanced is up to the higher layers. |
static int |
TOK_START
The state that the token is in within this phase (received, verified, spending, receipted.) How it is set and advanced is up to the higher layers. |
static int |
TOK_VERIFIED
The state that the token is in within this phase (received, verified, spending, receipted.) How it is set and advanced is up to the higher layers. |
| Fields inherited from class webfunds.token.Token |
expiry,
item,
log,
phase,
PHASE_BUILDER,
PHASE_DEAD,
PHASE_SIGNER,
PHASE_SPEND,
phaseVersion,
ps,
series,
state,
subversion,
TOK_ORIGINAL,
type |
| Constructor Summary | |
TokenSpender()
Create an uninitialised token. |
|
TokenSpender(byte[] buf)
Construct a token object from a byte array that was previously returned from the encode() method of a token object. |
|
TokenSpender(java.io.InputStream is)
Construct a token object from data in an input stream, where the data was previously returned from the encode() method of a token object. |
|
| Method Summary | |
void |
decode(java.io.InputStream is)
Update this token object with the values from a token encoded as a byte array (such as previously returned from the encode() method of a token object). |
void |
encode(java.io.OutputStream os)
Encode a token as a byte array, suitable for sending to third parties for depositing. |
boolean |
isCancelling()
|
boolean |
isReceipted()
|
boolean |
isSent()
|
boolean |
isStart()
|
boolean |
isVerified()
|
void |
setCancelling()
|
void |
setReceipted()
|
void |
setSent()
|
java.lang.String |
toString()
|
void |
unblind(byte[] token,
AbstractPublicParams params)
|
abstract void |
unblind(java.security.SecureRandom sr,
byte[] token,
AbstractPublicParams params)
Mint returns a blinded, signed coin for Client to unblind and spend. |
| Methods inherited from class webfunds.token.Token |
equals,
getExpiry,
getItem,
getLog,
getPhase,
getPhaseString,
getPhaseVersion,
getQty,
getSeries,
getState,
getSubVersion,
getType,
getUniqueId,
getVersion,
isBuilder,
isDead,
isSigner,
isSpender,
isValidPhase,
setState,
vString |
| Methods inherited from class webfunds.sox.Encodable |
decode,
encode,
main,
readByteArray,
readCertificate,
readProperties,
readString,
writeByteArray,
writeCertificate,
writeProperties,
writeString |
| Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int SPENDER_ORIGINAL
public static final int TOK_START
public static final int TOK_VERIFIED
public static final int TOK_SENT
public static final int TOK_CANCELLING
public static final int TOK_RECEIPTED
| Constructor Detail |
public TokenSpender()
type - of token, being the blinding or coin schemesubversion - is the version of the parent coin classlog - the coin size, log base 2 of quantity
public TokenSpender(byte[] buf)
throws TokenPacketException
token - the previously encoded token
public TokenSpender(java.io.InputStream is)
throws TokenPacketException
is - the input stream from which to read the token data| Method Detail |
public boolean isStart()
public boolean isVerified()
public boolean isSent()
public boolean isCancelling()
public boolean isReceipted()
public abstract void unblind(java.security.SecureRandom sr,
byte[] token,
AbstractPublicParams params)
throws TokenKeyException
params - includes the blinding paramaters from the mint
public void unblind(byte[] token,
AbstractPublicParams params)
throws TokenKeyException
public void setSent()
public void setCancelling()
public void setReceipted()
public void decode(java.io.InputStream is)
throws java.io.IOException
token - the previosly encoded token
public void encode(java.io.OutputStream os)
throws java.io.IOException
public java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||