|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--webfunds.sox.Encodable
|
+--webfunds.sox.Account
This class contains all information needed about an account in order to be able to generate authentication information, except perhaps for holding a key passphrase, which is not stored in the Store (only in a runtime object).
| Field Summary | |
protected java.lang.String |
appl
The Application string - can be set by a super application. |
protected IssuerFinder |
finder
Subaccounts need some way to find an Issuer for an Item. |
protected long |
flags
The Application flags - can be set by a super application. |
protected AccountId |
id
The account id (which must match the public key fingerprint) |
protected java.security.PrivateKey |
key
The private key that authorises account transactions. |
protected java.lang.String |
name
The account name, can be assigned locally. |
protected java.security.PublicKey |
pubKey
The public key that verifies account transactions. |
protected int |
req_version
|
protected java.util.Hashtable |
subs
Each subaccount is one-to-one with an item. |
static int |
VERSION
The version of the encoded object: 6 - added record of registrations 5 - added application string. |
| Constructor Summary | |
Account(byte[] data)
Recover an Account object from a byte array. |
|
Account(java.io.InputStream is)
Recover an Account from an input stream. |
|
Account(java.security.PublicKey pub,
java.security.PrivateKey key)
Create a new Account object |
|
| Method Summary | |
void |
decode(java.io.InputStream is)
|
void |
encode(java.io.OutputStream os)
|
boolean |
equals(java.lang.Object obj)
|
static Account |
example()
|
java.lang.String |
fp()
|
java.lang.String |
getApplication()
|
IssuerFinder |
getFinder()
|
long |
getFlags()
|
AccountId |
getId()
|
static Account |
getInstance()
|
static Account |
getInstance(int bits)
Make a valid account. |
Issuer |
getIssuer(ItemId id)
|
ItemId[] |
getItemIds()
|
java.security.PrivateKey |
getKey()
|
java.lang.String |
getName()
|
java.security.PublicKey |
getPublicKey()
|
SubAccount |
getSub(ItemId item)
|
SubAccount[] |
getSubAccounts()
|
static Account |
getTestInstance()
|
void |
insertSub(SubAccount sub)
To add a sub into the account. |
boolean |
isFlags(long f)
|
static void |
main(java.lang.String[] arg)
|
void |
newSub(SubAccount sub)
To add a new sub into the account. |
void |
removeSubAccount(ItemId item)
Only within this object, caller is responsible for other objects / persistant copies... |
void |
setApplication(java.lang.String appl)
|
void |
setFinder(IssuerFinder f)
|
void |
setFlags(long f)
|
void |
setName(java.lang.String name)
|
byte[] |
sign(byte[] b)
Sign a block of data. |
void |
sign(Request req)
Sign a Request. |
boolean |
subExists(ItemId item)
|
java.lang.String |
toString()
Convert this object to a string |
| 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 VERSION
protected int req_version
protected java.lang.String name
protected java.lang.String appl
protected long flags
protected java.security.PublicKey pubKey
protected java.security.PrivateKey key
protected AccountId id
protected java.util.Hashtable subs
protected IssuerFinder finder
| Constructor Detail |
public Account(java.security.PublicKey pub,
java.security.PrivateKey key)
throws SOXAccountException
pub - the public key for authenticationkey - the private key used for account authorisationSOXAccountException - the key was bad
public Account(byte[] data)
throws SOXPacketException
SOXPacketException - the data was bad
public Account(java.io.InputStream is)
throws SOXPacketException
SOXPacketException - the data was bad| Method Detail |
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getApplication()
public void setApplication(java.lang.String appl)
public long getFlags()
public void setFlags(long f)
public boolean isFlags(long f)
public java.security.PublicKey getPublicKey()
public java.security.PrivateKey getKey()
public AccountId getId()
public IssuerFinder getFinder()
public void setFinder(IssuerFinder f)
public Issuer getIssuer(ItemId id)
throws SOXIssuerException,
SOXLaterException
public static Account getInstance()
throws SOXAccountException
public static Account getTestInstance()
throws SOXAccountException
public static Account getInstance(int bits)
throws SOXAccountException
public byte[] sign(byte[] b)
throws java.security.KeyException
public void sign(Request req)
throws SOXKeyException
public SubAccount[] getSubAccounts()
public ItemId[] getItemIds()
public void removeSubAccount(ItemId item)
public boolean subExists(ItemId item)
public SubAccount getSub(ItemId item)
public void insertSub(SubAccount sub)
public void newSub(SubAccount sub)
throws SOXSubAccountException,
SOXAccountException
public void encode(java.io.OutputStream os)
throws java.io.IOException
public void decode(java.io.InputStream is)
throws java.io.IOException,
SOXPacketException
public boolean equals(java.lang.Object obj)
public java.lang.String toString()
public java.lang.String fp()
public static Account example()
public static void main(java.lang.String[] arg)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||