Class IdentityStore
- All Implemented Interfaces:
Serializable,Callable<Integer>,Block,Dumpable,RunningDaemon
- See Also:
-
Field Summary
FieldsFields inherited from class net.messagevortex.asn1.AbstractBlock
CRLF -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(IdentityStoreBlock isb) Adds an existing identity store block to the store.call()dumpValueNotation(String prefix, DumpType dumpType) getAnonSet(int size) Gets a random set of known recipient identities.Get the own identity key.getIdentity(String id) String[]static IdentityStoreCreates a new complete dummy identity store suitable for testing purposes.static IdentityStoregetNewIdentityStoreDemo(boolean complete) Creates a new dummy identity store suitable for testing purposes.protected final voidparse(byte[] p) protected final voidparse(org.bouncycastle.asn1.ASN1Encodable p) voidremoveAddress(String nodeAddress) removes a node address from the identity store.static voidsetHostIdentity(AsymmetricKey identity) Sets the owned key.voidShuts this class down.voidInitializes and starts all threads required to run the daemon.voidStopps all daemon threads and frees all temporary resources.org.bouncycastle.asn1.ASN1ObjecttoAsn1Object(DumpType dumpType) Dumps an ASN.1 representation of the object.Methods inherited from class net.messagevortex.asn1.AbstractBlock
fromBase64, fromHex, prepareDump, toBase64, toBitString, toBytes, toDer, toHex
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
IdentityStore
public IdentityStore() -
IdentityStore
- Throws:
IOException
-
IdentityStore
Create object from ASN.1 encoded file.
- Parameters:
f- the file to be parsed- Throws:
IOException- if parsing of ASN.1 code fails
-
-
Method Details
-
resetDemo
public static void resetDemo() -
getIdentityStoreDemo
Creates a new complete dummy identity store suitable for testing purposes.
- Returns:
- returns a reference identity store
- Throws:
IOException- if building of the store fails
-
getNewIdentityStoreDemo
Creates a new dummy identity store suitable for testing purposes.
the identity store contains an own identity, one hundred node idetities and 40 recipient identities.
- Parameters:
complete- if true the node and recipient identities contain the private key too- Returns:
- the requested identity store
- Throws:
IOException- if building of the store fails
-
getHostIdentity
Get the own identity key.
- Returns:
- the requested key
-
setHostIdentity
Sets the owned key.
- Parameters:
identity- identity key to be set as own key- Returns:
- the previously set key
-
getIdentityList
-
getAnonSet
Gets a random set of known recipient identities.
- Parameters:
size- the size of the anonymity set- Returns:
- the anonymity set
- Throws:
IOException- if requested anonymity set size is too big for this store
-
parse
- Overrides:
parsein classAbstractBlock- Throws:
IOException
-
parse
- Specified by:
parsein classAbstractBlock- Throws:
IOException
-
add
Adds an existing identity store block to the store.
- Parameters:
isb- the block to be added
-
removeAddress
removes a node address from the identity store.
- Parameters:
nodeAddress- the node addrress to be removed- Throws:
IOException- if node address is not contained in identity store
-
toAsn1Object
Description copied from interface:DumpableDumps an ASN.1 representation of the object.
- Specified by:
toAsn1Objectin interfaceDumpable- Parameters:
dumpType- the dump type to be used- Returns:
- the ASN.1 string representation of the object
- Throws:
IOException- if dumping of the object fails due to an illegal internal state of the object
-
dumpValueNotation
- Specified by:
dumpValueNotationin interfaceBlock- Throws:
IOException
-
getIdentity
-
call
-
startDaemon
public void startDaemon()Description copied from interface:RunningDaemonInitializes and starts all threads required to run the daemon.
- Specified by:
startDaemonin interfaceRunningDaemon
-
stopDaemon
public void stopDaemon()Description copied from interface:RunningDaemonStopps all daemon threads and frees all temporary resources.
- Specified by:
stopDaemonin interfaceRunningDaemon
-
shutdownDaemon
public void shutdownDaemon()Description copied from interface:RunningDaemonShuts this class down.
This frees all resources and ends all threads for an application or layer shutdown. It is not possible to call start() after running shutdown().
- Specified by:
shutdownDaemonin interfaceRunningDaemon
-