ASYM_ENCRYPT
or SYM_ENCRYPT
instead@Deprecated 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 |
---|---|
protected class |
ENCRYPT.Decrypter
Deprecated.
Decrypts all messages in a batch, replacing encrypted messages in-place with their decrypted versions
|
static class |
ENCRYPT.EncryptHeader
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
asymAlgorithm
Deprecated.
|
protected java.util.concurrent.atomic.AtomicInteger |
cipher_index
Deprecated.
|
protected int |
cipher_pool_size
Deprecated.
|
protected javax.crypto.Cipher[] |
decoding_ciphers
Deprecated.
|
protected java.util.concurrent.locks.Lock[] |
decoding_locks
Deprecated.
|
protected javax.crypto.Cipher[] |
encoding_ciphers
Deprecated.
|
protected java.util.concurrent.locks.Lock[] |
encoding_locks
Deprecated.
|
protected javax.crypto.SecretKey |
secretKey
Deprecated.
|
protected byte[] |
symVersion
Deprecated.
|
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
ENCRYPT()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
down(Event evt)
Deprecated.
An event is to be sent down the stack.
|
java.lang.String |
getAsymAlgorithm()
Deprecated.
|
javax.crypto.Cipher |
getAsymCipher()
Deprecated.
|
int |
getAsymInit()
Deprecated.
|
javax.crypto.SecretKey |
getDesKey()
Deprecated.
|
Address |
getKeyServerAddr()
Deprecated.
|
java.security.KeyPair |
getKpair()
Deprecated.
|
protected int |
getNextIndex()
Deprecated.
|
javax.crypto.SecretKey |
getSecretKey()
Deprecated.
|
java.lang.String |
getSymAlgorithm()
Deprecated.
|
javax.crypto.Cipher |
getSymDecodingCipher()
Deprecated.
|
javax.crypto.Cipher |
getSymEncodingCipher()
Deprecated.
|
int |
getSymInit()
Deprecated.
|
byte[] |
getSymVersion()
Deprecated.
|
protected java.lang.Object |
handleEncryptedMessage(Message msg,
Event evt,
ENCRYPT.EncryptHeader hdr)
Deprecated.
|
protected void |
handleUpEvent(Message msg,
ENCRYPT.EncryptHeader hdr)
Deprecated.
|
void |
init()
Deprecated.
Called after instance has been created (null constructor) and before protocol is started.
|
void |
initKeyPair()
Deprecated.
Generates the public/private key pair from the init params
|
void |
initSymKey()
Deprecated.
Used to initialise the symmetric key if none is supplied in a keystore.
|
protected void |
setKeyServerAddr(Address keyServerAddr)
Deprecated.
|
protected void |
setLocalAddress(Address local_addr)
Deprecated.
|
java.lang.Object |
up(Event evt)
Deprecated.
An event was received from the layer below.
|
void |
up(MessageBatch batch)
Deprecated.
Sends up a multiple messages in a
MessageBatch . |
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop
protected java.lang.String asymAlgorithm
protected int cipher_pool_size
protected javax.crypto.Cipher[] encoding_ciphers
protected javax.crypto.Cipher[] decoding_ciphers
protected java.util.concurrent.locks.Lock[] encoding_locks
protected java.util.concurrent.locks.Lock[] decoding_locks
protected final java.util.concurrent.atomic.AtomicInteger cipher_index
protected byte[] symVersion
protected javax.crypto.SecretKey secretKey
protected int getNextIndex()
public int getAsymInit()
public javax.crypto.SecretKey getDesKey()
public java.security.KeyPair getKpair()
public javax.crypto.Cipher getAsymCipher()
public java.lang.String getSymAlgorithm()
public int getSymInit()
public java.lang.String getAsymAlgorithm()
public byte[] getSymVersion()
public javax.crypto.SecretKey getSecretKey()
public javax.crypto.Cipher getSymDecodingCipher()
public javax.crypto.Cipher getSymEncodingCipher()
public Address getKeyServerAddr()
protected void setLocalAddress(Address local_addr)
protected void setKeyServerAddr(Address keyServerAddr)
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 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()
.public void up(MessageBatch batch)
Protocol
MessageBatch
. The sender of the batch is always the same, and so is the
destination (null == multicast messages). Messages in a batch can be OOB messages, regular messages, or mixed
messages, although the transport itself will create initial MessageBatches that contain only either OOB or
regular messages.
The default processing below sends messages up the stack individually, based on a matching criteria
(calling Protocol.accept(org.jgroups.Message)
), and - if true - calls Protocol.up(org.jgroups.Event)
for that message and removes the message. If the batch is not empty, it is passed up, or else it is dropped.
Subclasses should check if there are any messages destined for them (e.g. using
MessageBatch.getMatchingMessages(short,boolean)
), then possibly remove and process them and finally pass
the batch up to the next protocol. Protocols can also modify messages in place, e.g. ENCRYPT could decrypt all
encrypted messages in the batch, not remove them, and pass the batch up when done.protected java.lang.Object handleEncryptedMessage(Message msg, Event evt, ENCRYPT.EncryptHeader hdr) throws java.lang.Exception
java.lang.Exception
protected void handleUpEvent(Message msg, ENCRYPT.EncryptHeader hdr)
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()
.Copyright © 1998-2020 Red Hat. All Rights Reserved.