Class IdentityStoreBlock
- All Implemented Interfaces:
Serializable,Block,Dumpable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class net.messagevortex.asn1.AbstractBlock
CRLF -
Constructor Summary
ConstructorsConstructorDescriptionIdentityStoreBlock(String url) Create an identity store block from an url.IdentityStoreBlock(org.bouncycastle.asn1.ASN1Encodable ae) Create object from ASN.1 code. -
Method Summary
Modifier and TypeMethodDescriptiondumpValueNotation(String prefix, DumpType dumpType) booleanget the currently set identity key.static IdentityStoreBlockgetIdentityStoreBlockDemo(IdentityStoreBlock.IdentityType it, String id, boolean complete) Get a new, random IdentityStoreBlock of the specified type.intGetting the limit for number of incoming messages.Getting the currently set node address.Getting the currently set node key.intGetting the transfer quota in bytes for outgoing messages.getType()Getting the type of identity this key reflects.getUrl()Gets an URL representation of the identity.getValid()Gets the currently set validity period.inthashCode()protected final voidparse(org.bouncycastle.asn1.ASN1Encodable p) Set a new identity key.intsetMessageQuota(int nq) Setting the limit for number of incoming messages.setNodeAddress(String na) Setting the node address.Setting the current node key.intsetTransferQuota(int tq) Setting the limmit for the outgoing transfer quotas in bytes.setValid(UsagePeriod np) The usage period of the identity block.org.bouncycastle.asn1.ASN1ObjecttoAsn1Object(DumpType dumpType) Dumps an ASN.1 representation of the object.Methods inherited from class net.messagevortex.asn1.AbstractBlock
fromBase64, fromHex, parse, prepareDump, toBase64, toBitString, toBytes, toDer, toHex
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
UNENCODABLE
- See Also:
-
-
Constructor Details
-
IdentityStoreBlock
public IdentityStoreBlock() -
IdentityStoreBlock
Create object from ASN.1 code.
- Parameters:
ae- the ASN.1 code- Throws:
IOException- if parsing of ASN.1 code fails
-
IdentityStoreBlock
Create an identity store block from an url.
- Parameters:
url- th url to be parsed- Throws:
IOException- if parsing of the url fails
-
-
Method Details
-
hashCode
public int hashCode() -
getIdentityStoreBlockDemo
public static IdentityStoreBlock getIdentityStoreBlockDemo(IdentityStoreBlock.IdentityType it, String id, boolean complete) throws IOException Get a new, random IdentityStoreBlock of the specified type.
- Parameters:
it- identity type to be generatedid- the id of the generated blockcomplete- provide only the specified subset or a complete entry with private keys- Returns:
- the requessted IdentityStoreBlock
- Throws:
IOException- if generation fails
-
setIdentityKey
Set a new identity key.
- Parameters:
k- the new identity key- Returns:
- the previously set identity key
-
getIdentityKey
get the currently set identity key.
- Returns:
- the identity key currently set
-
setValid
The usage period of the identity block.
- Parameters:
np- the validity period to be set- Returns:
- the previously set validity period
-
getValid
Gets the currently set validity period.
- Returns:
- the currently set validity period
-
setMessageQuota
public int setMessageQuota(int nq) Setting the limit for number of incoming messages.
- Parameters:
nq- the new quota- Returns:
- the previously set quota
-
getMessageQuota
public int getMessageQuota()Getting the limit for number of incoming messages.
- Returns:
- the currently set limit
-
setTransferQuota
public int setTransferQuota(int tq) Setting the limmit for the outgoing transfer quotas in bytes.
- Parameters:
tq- the new transfer quotas in bytes- Returns:
- the previously set quota
-
getTransferQuota
public int getTransferQuota()Getting the transfer quota in bytes for outgoing messages.
- Returns:
- the currently set transfer quota
-
setNodeAddress
Setting the node address.
- Parameters:
na- the new node address- Returns:
- the previously set node address
-
getNodeAddress
Getting the currently set node address.
- Returns:
- the currently set node address
-
setNodeKey
Setting the current node key.
- Parameters:
k- the new node key- Returns:
- the previously set node key
-
getNodeKey
Getting the currently set node key.
- Returns:
- the currently set node key
-
parse
- Specified by:
parsein classAbstractBlock- Throws:
IOException
-
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
-
getUrl
Gets an URL representation of the identity.
- Returns:
- the url or IdentityStoreBlock.UNENCODABLE on fail
- Throws:
IOException- on failure
-
getType
Getting the type of identity this key reflects.
If the type has not been set this methode assumes for a public/private keypair a node key.
- Returns:
- the type of identity
-
equals
-