public class ENCRYPT extends Protocol
Each message is identified as encrypted with a specific encryption header which identifies the type of encrypt header and an MD5 digest that identifies the version of the key being used to encrypt/decrypt the messages.
Note: the current version does not support the concept of perfect forward encryption (PFE)
which means that if a peer leaves the group the keys are re-generated preventing the departed peer from
decrypting future messages if it chooses to listen in on the group. This is not included as it really requires
a suitable authentication scheme as well to make this feature useful as there is nothing to stop the peer rejoining and receiving the new
key. A future release will address this issue.
Modifier and Type | Class and Description |
---|---|
static class |
ENCRYPT.EncryptHeader |
down_handler, down_prot, down_queue, down_thread, down_thread_prio, log, observer, props, stack, stats, up_handler, up_prot, up_queue, up_thread, up_thread_prio
Constructor and Description |
---|
ENCRYPT() |
Modifier and Type | Method and Description |
---|---|
void |
down(Event evt)
An event is to be sent down the stack.
|
protected java.lang.String |
getAsymAlgorithm() |
protected javax.crypto.Cipher |
getAsymCipher() |
protected int |
getAsymInit() |
protected java.lang.String |
getAsymProvider() |
protected javax.crypto.SecretKey |
getDesKey() |
protected Address |
getKeyServerAddr() |
protected java.lang.String |
getKeyStoreName() |
protected java.security.KeyPair |
getKpair() |
protected Address |
getLocal_addr() |
java.lang.String |
getName() |
protected java.security.PublicKey |
getServerPubKey() |
protected java.lang.String |
getSymAlgorithm() |
protected javax.crypto.Cipher |
getSymDecodingCipher() |
protected javax.crypto.Cipher |
getSymEncodingCipher() |
protected int |
getSymInit() |
protected java.lang.String |
getSymProvider() |
void |
init()
Called after instance has been created (null constructor) and before protocol is started.
|
void |
initKeyPair()
Generates the public/private key pair from the init params
|
void |
initSymKey()
Used to initialise the symmetric key if none is supplied in a keystore.
|
void |
reset()
Just remove if you don't need to reset any state
|
protected void |
setKeyServerAddr(Address keyServerAddr) |
protected void |
setLocal_addr(Address local_addr) |
boolean |
setProperties(java.util.Properties props)
Configures the protocol initially.
|
void |
up(Event evt)
An event was received from the layer below.
|
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getDownQueue, getProperties, getUpProtocol, getUpQueue, handleSpecialDownEvent, passDown, passUp, printStats, providedDownServices, providedUpServices, receiveDownEvent, receiveUpEvent, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setObserver, setPropertiesInternal, setProtocolStack, setUpProtocol, start, startDownHandler, startUpHandler, statsEnabled, stop, stopInternal, upThreadEnabled
public boolean setProperties(java.util.Properties props)
Protocol
"loopback=false;unicast_inport=4444"
setProperties
in class Protocol
public void init() throws java.lang.Exception
Protocol
public void initSymKey() throws java.lang.Exception
java.lang.Exception
public void initKeyPair() throws java.lang.Exception
java.lang.Exception
public void reset()
public void up(Event evt)
Protocol
passDown()
or c) the event (or another event) is sent up
the stack using passUp()
.public void down(Event evt)
Protocol
passDown()
. In case of a GET_ADDRESS event (which tries to
retrieve the stack's address from one of the bottom layers), the layer may need to send
a new response event back up the stack using passUp()
.protected int getAsymInit()
protected java.lang.String getAsymProvider()
protected javax.crypto.SecretKey getDesKey()
protected java.security.KeyPair getKpair()
protected javax.crypto.Cipher getAsymCipher()
protected java.security.PublicKey getServerPubKey()
protected java.lang.String getSymAlgorithm()
protected int getSymInit()
protected java.lang.String getSymProvider()
protected java.lang.String getAsymAlgorithm()
protected java.lang.String getKeyStoreName()
protected javax.crypto.Cipher getSymDecodingCipher()
protected javax.crypto.Cipher getSymEncodingCipher()
protected Address getLocal_addr()
protected void setLocal_addr(Address local_addr)
local_addr
- The local_addr to set.protected Address getKeyServerAddr()
protected void setKeyServerAddr(Address keyServerAddr)
keyServerAddr
- The keyServerAddr to set.Copyright ? 1998-2006 Bela Ban. All Rights Reserved.