public class NetworkEncryptionUpgradePacket extends java.lang.Object implements IPacket, IAcknowledgement
Base64Packet
s or EncryptedPacket
s.
Major ID: 255 Minor ID: 253
Constructor and Description |
---|
NetworkEncryptionUpgradePacket(java.lang.Boolean acknowledgement,
boolean upgrade,
boolean base64ed,
com.captainalm.lib.stdcrypt.encryption.ICipherFactory cipherFactory)
Constructs a new NetworkEncryptionUpgradePacket with the specified acknowledgement value, upgrade value, base 64 value and
ICipherFactory . |
Modifier and Type | Method and Description |
---|---|
boolean |
areSecretsSent()
Gets if secrets are sent as part of cipher settings.
|
com.captainalm.lib.stdcrypt.encryption.ICipherFactory |
getCipherFactory()
Gets the
ICipherFactory being used or null. |
PacketProtocolInformation |
getProtocol()
Gets the protocol information.
|
static PacketProtocolInformation |
getTheProtocol()
Gets the protocol information statically.
|
boolean |
isAcknowledgement()
Gets if the class instance is an Acknowledgement.
|
boolean |
isBase64ed()
Gets if base 64 is used.
|
boolean |
isUpgrade()
Gets if the packet is treated as a stream upgrade or
a change in packet use for
EncryptedPacket and Base64Packet . |
boolean |
isValid()
Gets if the packet is valid.
|
void |
loadPayload(byte[] packetData)
Loads the packet payload from save data.
|
byte[] |
savePayload()
Saves the packet payload to a byte array.
|
void |
setBase64ed(boolean base64ed)
Sets if base64 is used.
|
void |
setCipherFactory(com.captainalm.lib.stdcrypt.encryption.ICipherFactory cipherFactory)
Sets the
ICipherFactory being used. |
void |
setIfSecretsSent(boolean sendSecrets)
Sets if secrets should be sent as part of cipher settings.
|
void |
setUpgrade(boolean upgrade)
Sets if the packet is treated as a stream upgrade or
a change in packet use for
EncryptedPacket and Base64Packet . |
public NetworkEncryptionUpgradePacket(java.lang.Boolean acknowledgement, boolean upgrade, boolean base64ed, com.captainalm.lib.stdcrypt.encryption.ICipherFactory cipherFactory)
ICipherFactory
.acknowledgement
- The acknowledgement value to use (Can be null).upgrade
- Is the packet treated as a stream upgrade, See: isUpgrade()
.base64ed
- Is the packet signalling base 64 to be used.cipherFactory
- The cipherFactory to signal for use.public boolean isValid()
public PacketProtocolInformation getProtocol()
getProtocol
in interface IPacket
public static PacketProtocolInformation getTheProtocol()
public byte[] savePayload() throws PacketException
savePayload
in interface IPacket
PacketException
- An Exception has occurred.public void loadPayload(byte[] packetData) throws PacketException
loadPayload
in interface IPacket
packetData
- The packet payload data.java.lang.NullPointerException
- The new store data is null.PacketException
- An Exception has occurred.public boolean isUpgrade()
EncryptedPacket
and Base64Packet
.public void setUpgrade(boolean upgrade)
EncryptedPacket
and Base64Packet
.upgrade
- If the packet is a stream upgrade.public boolean isBase64ed()
public void setBase64ed(boolean base64ed)
base64ed
- If base 64 is to be used.public com.captainalm.lib.stdcrypt.encryption.ICipherFactory getCipherFactory()
ICipherFactory
being used or null.public void setCipherFactory(com.captainalm.lib.stdcrypt.encryption.ICipherFactory cipherFactory)
ICipherFactory
being used.cipherFactory
- The Cipher Factory or null.public boolean isAcknowledgement()
isAcknowledgement
in interface IAcknowledgement
public boolean areSecretsSent()
public void setIfSecretsSent(boolean sendSecrets)
sendSecrets
- If secrets are part of the cipher settings.