Package org.jgroups.protocols
Class KeyExchange
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.KeyExchange
- All Implemented Interfaces:
Lifecycle
- Direct Known Subclasses:
DH_KEY_EXCHANGE,SSL_KEY_EXCHANGE
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 below ASYM_ENCRYPT.
- Since:
- 4.0.5
-
Field Summary
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAn event is to be sent down the stack.abstract voidfetchSecretKeyFrom(Address target) Needs to fetch the secret key from a given destination (usually the key server).protected <T extends Protocol>
TfindProtocolAbove(Class<? extends Protocol> clazz) Fetches the secret key from a protocol above usabstract AddressReturns the address of the server, e.g.protected voidhandleView(View view) List of events that are required to be answered by some layer aboveprotected voidsetSecretKeyAbove(Tuple<SecretKey, byte[]> key) Sets the secret key in a protocol above usMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, resetStatistics, resetStats, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, stop, toString, up, up, up
-
Constructor Details
-
KeyExchange
public KeyExchange()
-
-
Method Details
-
requiredUpServices
Description copied from class:ProtocolList of events that are required to be answered by some layer above- Overrides:
requiredUpServicesin classProtocol
-
fetchSecretKeyFrom
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:
Exception
-
getServerLocation
Returns the address of the server, e.g. server socket (if any) -
down
Description copied from class:ProtocolAn 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
-
getSecretKeyFromAbove
Fetches the secret key from a protocol above us- Returns:
- The secret key and its version
-
setSecretKeyAbove
Sets the secret key in a protocol above us- Parameters:
key- The secret key and its version
-
findProtocolAbove
-