|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.Token
|
+--webfunds.sox.RandomToken
This class represents a Big Random Number Token. The token derives its security from the unguessability of the random number; this is mostly useful for demonstration purposes than in actual live fire as its characteristics for payment systems use are dominated by other methods. RandomToken objects are usually created by the mint.
| Field Summary | |
static int |
RANDOM_TYPE
The type of token encoded by this class. |
protected byte[] |
sig
The signature on the token (generally made by the mint). |
static int |
SUB_VERSION
The sub version number for this payment structure: 0: first cut. |
protected byte[] |
token
The token payload (generally made by the client). |
| Fields inherited from class webfunds.sox.Token |
expiry,
log,
series,
sig,
state,
subversion,
TOK_PROTO,
TOK_RAW,
TOK_RECEIVED,
TOK_SETTLED,
TOK_SIGNED,
TOK_SPENT,
TOK_UNBLIND,
TOK_VALID,
type,
version,
VERSION |
| Constructor Summary | |
RandomToken(byte[] paymentData)
|
|
RandomToken(java.io.InputStream is)
|
|
RandomToken(int log)
Create a RandomToken |
|
| Method Summary | |
protected static void |
cycle()
|
void |
decode(java.io.InputStream is)
Update this payment object with the values from a payment encoded as a byte array (such as previously returned from the encode() method of a payment object). |
void |
encode(java.io.OutputStream os)
Encode a payment as a byte array, suitable for sending to third parties for depositing. |
boolean |
equals(java.lang.Object obj)
|
static RandomToken |
example()
|
byte[] |
getPayload()
|
static Token[] |
getProtoTokens(int[] coins)
Make a set of Tokens matched to a set of coin sizes. |
static Token[] |
getProtoTokens(long qty)
Make a set of Tokens that can handle a quantity. |
byte[] |
getSignature()
|
byte[] |
getUniqueId()
Return the unique identifier that can be used for double- spend checking. |
protected static void |
input()
|
static void |
main(java.lang.String[] args)
|
protected static void |
output()
|
void |
prototype()
Create the prototype coin. |
protected static void |
readWrite()
|
void |
sign(java.security.PrivateKey key,
byte[] series)
Sign a protocoin. |
java.lang.String |
toString()
|
void |
unblind()
Unblind the signed coin, revealing the signed, private coin. |
boolean |
verify(java.security.PublicKey key)
Sign a protocoin. |
| Methods inherited from class webfunds.sox.Token |
getExpiry,
getLog,
getQty,
getSeries,
getState,
getSubVersion,
getType,
getVersion,
isProto,
isRaw,
isReceived,
isSettled,
isSigned,
isSpent,
isUnblinded,
setState,
vString |
| Methods inherited from class webfunds.sox.Encodable |
decode,
encode,
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 SUB_VERSION
public static final int RANDOM_TYPE
protected byte[] sig
protected byte[] token
| Constructor Detail |
public RandomToken(int log)
log - the coin size, log base 2 of quantity
public RandomToken(byte[] paymentData)
throws SOXPacketException
public RandomToken(java.io.InputStream is)
throws SOXPacketException
| Method Detail |
public byte[] getSignature()
public byte[] getPayload()
public static Token[] getProtoTokens(long qty)
public static Token[] getProtoTokens(int[] coins)
public void sign(java.security.PrivateKey key,
byte[] series)
throws java.security.KeyException
series - is a string identifying batchkey - is the signing key of the mint
public boolean verify(java.security.PublicKey key)
throws java.security.KeyException
key - is the signer's public key (of the mint)public void prototype()
public void unblind()
public byte[] getUniqueId()
key - is the signer's public key (of the mint)
public void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
paymentData - the previosly encoded payment
public void encode(java.io.OutputStream os)
throws java.io.IOException
public java.lang.String toString()
public static RandomToken example()
public boolean equals(java.lang.Object obj)
public static void main(java.lang.String[] args)
protected static void cycle()
throws java.lang.Exception
protected static void output()
throws java.lang.Exception
protected static void readWrite()
throws java.lang.Exception
protected static void input()
throws java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||