Package org.jgroups.protocols
Class KeyExchange
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.KeyExchange
-
- Direct Known Subclasses:
DH_KEY_EXCHANGE
,SSL_KEY_EXCHANGE
public abstract class KeyExchange extends Protocol
Base class for protocols implementing key exchange: a secret key to be used for encryption is exchanged between 2 parties (usually the key server and a new cluster member) securely; ie. without the possibility of man-in-the-middle attacks, compromising the key and (optional) perfect forward secrecy.
This protocol has to be placed somewhere belowASYM_ENCRYPT
.- Since:
- 4.0.5
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected Address
local_addr
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, log, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description KeyExchange()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
down(Event evt)
An event is to be sent down the stack.abstract void
fetchSecretKeyFrom(Address target)
Needs to fetch the secret key from a given destination (usually the key server).protected <T extends Protocol>
TfindProtocolAbove(java.lang.Class<? extends Protocol> clazz)
protected Tuple<javax.crypto.SecretKey,byte[]>
getSecretKeyFromAbove()
Fetches the secret key from a protocol above usabstract Address
getServerLocation()
Returns the address of the server, e.g.protected void
handleView(View view)
java.util.List<java.lang.Integer>
requiredUpServices()
List of events that are required to be answered by some layer aboveprotected void
setSecretKeyAbove(Tuple<javax.crypto.SecretKey,byte[]> key)
Sets the secret key in a protocol above us-
Methods inherited from class org.jgroups.stack.Protocol
accept, afterCreationHook, destroy, down, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, level, parse, providedDownServices, providedUpServices, requiredDownServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, stop, up, up, up
-
-
-
-
Field Detail
-
local_addr
protected Address local_addr
-
-
Method Detail
-
requiredUpServices
public java.util.List<java.lang.Integer> requiredUpServices()
Description copied from class:Protocol
List of events that are required to be answered by some layer above- Overrides:
requiredUpServices
in classProtocol
-
fetchSecretKeyFrom
public abstract void fetchSecretKeyFrom(Address target) throws java.lang.Exception
Needs to fetch the secret key from a given destination (usually the key server). When received, the secret key (and version) needs to be installed in a protocol above usingsetSecretKeyAbove(Tuple)
.- Parameters:
target
- The member from which to fetch the secret key- Throws:
java.lang.Exception
-
getServerLocation
public abstract Address getServerLocation()
Returns the address of the server, e.g. server socket (if any)
-
down
public java.lang.Object down(Event evt)
Description copied from class:Protocol
An event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down()
.
-
handleView
protected void handleView(View view)
-
getSecretKeyFromAbove
protected Tuple<javax.crypto.SecretKey,byte[]> getSecretKeyFromAbove()
Fetches the secret key from a protocol above us- Returns:
- The secret key and its version
-
setSecretKeyAbove
protected void setSecretKeyAbove(Tuple<javax.crypto.SecretKey,byte[]> key)
Sets the secret key in a protocol above us- Parameters:
key
- The secret key and its version
-
-