|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.stack.Protocol org.jgroups.protocols.ENCRYPT
public class ENCRYPT
ENCRYPT layer. Encrypt and decrypt communication in JGroups This class can be used in two ways:
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.
Nested Class Summary | |
---|---|
static class |
ENCRYPT.EncryptHeader
|
Field Summary | |
---|---|
protected java.util.concurrent.locks.Lock |
decrypt_lock
To synchronize access to symDecodingCipher |
Fields inherited from class org.jgroups.stack.Protocol |
---|
down_prot, ergonomics, id, log, name, stack, stats, up_prot |
Constructor Summary | |
---|---|
ENCRYPT()
|
Method Summary | |
---|---|
static java.lang.String |
byteArrayToHexString(byte[] b)
|
java.lang.Object |
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()
|
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. |
java.lang.Object |
passItDown(Event evt)
|
java.lang.Object |
passItUp(Event evt)
|
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)
|
void |
setObserver(org.jgroups.protocols.ENCRYPT.Observer o)
|
java.lang.Object |
up(Event evt)
An event was received from the layer below. |
Methods inherited from class org.jgroups.stack.Protocol |
---|
destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.util.concurrent.locks.Lock decrypt_lock
Constructor Detail |
---|
public ENCRYPT()
Method Detail |
---|
public void setObserver(org.jgroups.protocols.ENCRYPT.Observer o)
public void init() throws java.lang.Exception
Protocol
init
in class Protocol
java.lang.Exception
- Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exceptionpublic void initSymKey() throws java.lang.Exception
java.lang.Exception
public static java.lang.String byteArrayToHexString(byte[] b)
public void initKeyPair() throws java.lang.Exception
java.lang.Exception
public void reset()
public java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.
up
in class Protocol
public java.lang.Object passItUp(Event evt)
public java.lang.Object down(Event evt)
Protocol
down_prot.down()
. 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 up_prot.up()
.
down
in class Protocol
public java.lang.Object passItDown(Event evt)
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |