public class IdentityStoreBlock extends AbstractBlock implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
IdentityStoreBlock.IdentityType |
Modifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
static String |
UNENCODABLE |
CRLF
Constructor and Description |
---|
IdentityStoreBlock() |
IdentityStoreBlock(org.bouncycastle.asn1.ASN1Encodable ae)
Create object from ASN.1 code.
|
IdentityStoreBlock(String url)
Create an identity store block from an url.
|
Modifier and Type | Method and Description |
---|---|
String |
dumpValueNotation(String prefix,
DumpType dumpType) |
boolean |
equals(Object t) |
AsymmetricKey |
getIdentityKey()
get the currently set identity key.
|
static IdentityStoreBlock |
getIdentityStoreBlockDemo(IdentityStoreBlock.IdentityType it,
String id,
boolean complete)
Get a new, random IdentityStoreBlock of the specified type.
|
int |
getMessageQuota()
Getting the limit for number of incoming messages.
|
String |
getNodeAddress()
Getting the currently set node address.
|
AsymmetricKey |
getNodeKey()
Getting the currently set node key.
|
int |
getTransferQuota()
Getting the transfer quota in bytes for outgoing messages.
|
IdentityStoreBlock.IdentityType |
getType()
Getting the type of identity this key reflects.
|
String |
getUrl()
Gets an URL representation of the identity.
|
UsagePeriod |
getValid()
Gets the currently set validity period.
|
int |
hashCode() |
protected void |
parse(org.bouncycastle.asn1.ASN1Encodable p) |
AsymmetricKey |
setIdentityKey(AsymmetricKey k)
Set a new identity key.
|
int |
setMessageQuota(int nq)
Setting the limit for number of incoming messages.
|
String |
setNodeAddress(String na)
Setting the node address.
|
AsymmetricKey |
setNodeKey(AsymmetricKey k)
Setting the current node key.
|
int |
setTransferQuota(int tq)
Setting the limmit for the outgoing transfer quotas in bytes.
|
UsagePeriod |
setValid(UsagePeriod np)
The usage period of the identity block.
|
org.bouncycastle.asn1.ASN1Object |
toAsn1Object(DumpType dumpType)
Dumps an ASN.1 representation of the object.
|
fromBase64, fromHex, parse, prepareDump, toBase64, toBitString, toBytes, toDer, toHex
public static final long serialVersionUID
public static final String UNENCODABLE
public IdentityStoreBlock()
public IdentityStoreBlock(org.bouncycastle.asn1.ASN1Encodable ae) throws IOException
Create object from ASN.1 code.
ae
- the ASN.1 codeIOException
- if parsing of ASN.1 code failspublic IdentityStoreBlock(String url) throws IOException
Create an identity store block from an url.
url
- th url to be parsedIOException
- if parsing of the url failspublic static IdentityStoreBlock getIdentityStoreBlockDemo(IdentityStoreBlock.IdentityType it, String id, boolean complete) throws IOException
Get a new, random IdentityStoreBlock of the specified type.
it
- identity type to be generatedid
- the id of the generated blockcomplete
- provide only the specified subset or a complete entry with private keysIOException
- if generation failspublic AsymmetricKey setIdentityKey(AsymmetricKey k)
Set a new identity key.
k
- the new identity keypublic AsymmetricKey getIdentityKey()
get the currently set identity key.
public UsagePeriod setValid(UsagePeriod np)
The usage period of the identity block.
np
- the validity period to be setpublic UsagePeriod getValid()
Gets the currently set validity period.
public int setMessageQuota(int nq)
Setting the limit for number of incoming messages.
nq
- the new quotapublic int getMessageQuota()
Getting the limit for number of incoming messages.
public int setTransferQuota(int tq)
Setting the limmit for the outgoing transfer quotas in bytes.
tq
- the new transfer quotas in bytespublic int getTransferQuota()
Getting the transfer quota in bytes for outgoing messages.
public String setNodeAddress(String na)
Setting the node address.
na
- the new node addresspublic String getNodeAddress()
Getting the currently set node address.
public AsymmetricKey setNodeKey(AsymmetricKey k)
Setting the current node key.
k
- the new node keypublic AsymmetricKey getNodeKey()
Getting the currently set node key.
protected final void parse(org.bouncycastle.asn1.ASN1Encodable p) throws IOException
parse
in class AbstractBlock
IOException
public org.bouncycastle.asn1.ASN1Object toAsn1Object(DumpType dumpType) throws IOException
Dumpable
Dumps an ASN.1 representation of the object.
toAsn1Object
in interface Dumpable
dumpType
- the dump type to be usedIOException
- if dumping of the object fails due to an illegal internal state of the
objectpublic String dumpValueNotation(String prefix, DumpType dumpType) throws IOException
dumpValueNotation
in interface Block
IOException
public String getUrl() throws IOException
Gets an URL representation of the identity.
IOException
- on failurepublic IdentityStoreBlock.IdentityType 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.
Copyright © 2023. All rights reserved.