public class EncryptInterceptor extends ChannelInterceptorBase implements EncryptInterceptorMBean
setEncryptionKey(byte[])
or the hex-encoded binary bytes by calling
setEncryptionKey(String).ChannelInterceptor.InterceptorEvent| Modifier and Type | Field and Description |
|---|---|
protected static StringManager |
sm |
optionFlag| Constructor and Description |
|---|
EncryptInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
String |
getEncryptionAlgorithm()
Gets the encryption algorithm being used to encrypt and decrypt channel
messages.
|
byte[] |
getEncryptionKey()
Gets the encryption key being used for encryption and decryption.
|
String |
getEncryptionKeyString() |
String |
getProviderName()
Gets the JCA provider name used for cryptographic activities.
|
void |
messageReceived(ChannelMessage msg)
the
messageReceived is invoked when a message is received. |
void |
sendMessage(Member[] destination,
ChannelMessage msg,
InterceptorPayload payload)
The
sendMessage method is called when a message is being sent to one more destinations. |
void |
setEncryptionAlgorithm(String algorithm)
Sets the encryption algorithm to be used for encrypting and decrypting
channel messages.
|
void |
setEncryptionKey(byte[] key)
Sets the encryption key for encryption and decryption.
|
void |
setEncryptionKey(String keyBytes)
Gets the encryption key being used for encryption and decryption.
|
void |
setEncryptionKeyString(String encryptionKeyString) |
void |
setProviderName(String provider)
Sets the JCA provider name used for cryptographic activities.
|
void |
start(int svc)
Starts up the channel.
|
void |
stop(int svc)
Shuts down the channel.
|
accept, fireInterceptorEvent, getChannel, getLocalMember, getMember, getMembers, getNext, getOptionFlag, getPrevious, hasMembers, heartbeat, memberAdded, memberDisappeared, okToProcess, setChannel, setNext, setOptionFlag, setPreviousclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOptionFlag, setOptionFlagprotected static final StringManager sm
public void start(int svc)
throws ChannelException
ChannelInterceptorBasestart in interface ChannelInterceptorstart in class ChannelInterceptorBasesvc - int value of ChannelException - if a startup error occurs or the service is already started.Channelpublic void stop(int svc)
throws ChannelException
ChannelInterceptorBasestop in interface ChannelInterceptorstop in class ChannelInterceptorBasesvc - int value of ChannelException - if a startup error occurs or the service is already started.Channelpublic void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload payload) throws ChannelException
ChannelInterceptorsendMessage method is called when a message is being sent to one more destinations.
The interceptor can modify any of the parameters and then pass on the message down the stack by
invoking getNext().sendMessage(destination,msg,payload)getNext().sendMessage(destination,msg,payload)sendMessage in interface ChannelInterceptorsendMessage in class ChannelInterceptorBasedestination - Member[] - the destination for this messagemsg - ChannelMessage - the message to be sentpayload - InterceptorPayload - the payload, carrying an error handler and future useful data, can be nullChannelException - if a serialization error happens.ErrorHandler,
InterceptorPayloadpublic void messageReceived(ChannelMessage msg)
ChannelInterceptormessageReceived is invoked when a message is received.
ChannelMessage.getAddress() is the sender, or the reply-to address
if it has been overwritten.messageReceived in interface ChannelInterceptormessageReceived in class ChannelInterceptorBasemsg - ChannelMessagepublic void setEncryptionAlgorithm(String algorithm)
algorithm/mode/padding.
Information on standard algorithm names may be found in the
Java
documentation.
Default is AES/CBC/PKCS5Padding.setEncryptionAlgorithm in interface EncryptInterceptorMBeanalgorithm - The algorithm to use.public String getEncryptionAlgorithm()
getEncryptionAlgorithm in interface EncryptInterceptorMBeanpublic void setEncryptionKey(byte[] key)
setEncryptionKey in interface EncryptInterceptorMBeankey - The encryption key.public void setEncryptionKey(String keyBytes)
0xab
will be shown as "ab". The length of the string in characters will
be twice the length of the key in bytes.keyBytes - The encryption key.public byte[] getEncryptionKey()
getEncryptionKey in interface EncryptInterceptorMBeanpublic String getEncryptionKeyString()
public void setEncryptionKeyString(String encryptionKeyString)
public void setProviderName(String provider)
setProviderName in interface EncryptInterceptorMBeanprovider - The name of the JCA provider.public String getProviderName()
getProviderName in interface EncryptInterceptorMBeanCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.