public class GenericEncryption extends ConnectionEncryption
Constructor and Description |
---|
GenericEncryption(DOConnection conn) |
Modifier and Type | Method and Description |
---|---|
void |
initParameters(HeaderSet request,
HeaderSet response)
Set up the encryption mechanism and put the parameters into the given
HeaderSet so that they can be communicated to the other side.
|
void |
processIncomingChunk(java.nio.ByteBuffer buf)
Decrypts the incoming chunk of bytes and puts the result back into the
given ByteBuffer for reading.
|
java.nio.ByteBuffer |
processOutgoingChunk(java.nio.ByteBuffer buf)
Processes the outgoing chunk of bytes and returns the processed version.
|
void |
setDefaultCryptoAlg(java.lang.String newAlg)
Set the default encryption algorithm, subject to capability negotiation
with the other side of the connection.
|
void |
setDefaultMacAlg(java.lang.String newMacAlg)
Set the default MAC algorithm, subject to capability negotiation with the
other side of the connection.
|
void |
setDefaultMode(java.lang.String newMode)
Set the default mode, subject to capability negotiation with the
other side of the connection.
|
void |
setDefaultPadding(java.lang.String newPadding)
Set the default padding, subject to capability negotiation with the
other side of the connection.
|
void |
setParameters(HeaderSet parameters)
Set up the parameters for the encryption/decryption process.
|
java.lang.String |
toString() |
constructInstance, getRandom
public GenericEncryption(DOConnection conn)
public void setDefaultMacAlg(java.lang.String newMacAlg)
public void setDefaultMode(java.lang.String newMode)
public void setDefaultPadding(java.lang.String newPadding)
public void setDefaultCryptoAlg(java.lang.String newAlg)
public void initParameters(HeaderSet request, HeaderSet response) throws java.lang.Exception
initParameters
in class ConnectionEncryption
java.lang.Exception
public void setParameters(HeaderSet parameters) throws java.lang.Exception
java.lang.Exception
public void processIncomingChunk(java.nio.ByteBuffer buf) throws java.security.GeneralSecurityException
ConnectionEncryption
processIncomingChunk
in class ConnectionEncryption
java.security.GeneralSecurityException
public java.nio.ByteBuffer processOutgoingChunk(java.nio.ByteBuffer buf) throws java.security.GeneralSecurityException
processOutgoingChunk
in class ConnectionEncryption
java.security.GeneralSecurityException
ConnectionEncryption.processOutgoingChunk(ByteBuffer)
public java.lang.String toString()
toString
in class java.lang.Object