public class NodeCrypto
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
IDENTITY_LENGTH
Length of a node identity
|
FNPPacketMangler |
packetMangler |
Constructor and Description |
---|
NodeCrypto(Node node,
boolean isOpennet,
NodeCryptoConfig config,
long startupTime,
boolean enableARKs)
Get port number from a config, create socket and packet mangler
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowConnection(PeerNode pn,
FreenetInetAddress addr) |
boolean |
definitelyPortForwarded() |
SimpleFieldSet |
exportPrivateFieldSet() |
SimpleFieldSet |
exportPublicFieldSet()
Export my node reference so that another node can connect to me.
|
BlockCipher |
getAnonSetupCipher()
Get the cipher for connection attempts for e.g.
|
PeerNode[] |
getAnonSetupPeerNodes() |
FreenetInetAddress |
getBindTo() |
AddressTracker.Status |
getDetectedConnectivityStatus() |
java.security.interfaces.ECPublicKey |
getECDSAP256Pubkey() |
byte[] |
getIdentity(int negType)
Get my identity.
|
PeerNode[] |
getPeerNodes() |
void |
initCrypto()
Create the cryptographic keys etc from scratch
|
void |
maybeBootConnection(PeerNode peerNode,
FreenetInetAddress address)
If oneConnectionPerAddress is not set, but there are peers with the same
IP for which it is set, disconnect them.
|
byte[] |
myCompressedFullRef()
Our full node reference, compressed.
|
byte[] |
myCompressedHeavySetupRef()
The part of our node reference which is exchanged in the connection setup, if we don't
already have the node, compressed.
|
byte[] |
myCompressedSetupRef()
The part of our node reference which is exchanged in the connection setup, compressed.
|
void |
onSetDropProbability(int val) |
void |
readCrypto(SimpleFieldSet fs)
Read the cryptographic keys etc from a SimpleFieldSet
|
void |
start() |
void |
stop() |
boolean |
wantAnonAuth() |
boolean |
wantAnonAuthChangeIP() |
public static final int IDENTITY_LENGTH
public FNPPacketMangler packetMangler
public NodeCrypto(Node node, boolean isOpennet, NodeCryptoConfig config, long startupTime, boolean enableARKs) throws NodeInitException
NodeInitException
public void readCrypto(SimpleFieldSet fs) throws java.io.IOException
fs
- java.io.IOException
public void initCrypto()
public void start()
public SimpleFieldSet exportPrivateFieldSet()
public SimpleFieldSet exportPublicFieldSet()
exportPublicFieldSet(boolean forSetup).
public byte[] myCompressedSetupRef()
exportSetupFieldSet()
public byte[] myCompressedHeavySetupRef()
exportSetupFieldSet()
public byte[] myCompressedFullRef()
exportSetupFieldSet()
public java.security.interfaces.ECPublicKey getECDSAP256Pubkey()
public void onSetDropProbability(int val)
public void stop()
public PeerNode[] getPeerNodes()
public boolean allowConnection(PeerNode pn, FreenetInetAddress addr)
public void maybeBootConnection(PeerNode peerNode, FreenetInetAddress address)
peerNode
- address
- public BlockCipher getAnonSetupCipher()
public PeerNode[] getAnonSetupPeerNodes()
public byte[] getIdentity(int negType)
public boolean definitelyPortForwarded()
public AddressTracker.Status getDetectedConnectivityStatus()
public FreenetInetAddress getBindTo()
public boolean wantAnonAuth()
public boolean wantAnonAuthChangeIP()