Package org.activecomponents.udp
Class SymCipherManagement
- java.lang.Object
- 
- org.activecomponents.udp.SymCipherManagement
 
- 
 public class SymCipherManagement extends java.lang.ObjectManagement for keying and maintaining the symmetric encryption.
- 
- 
Field SummaryFields Modifier and Type Field Description protected byteactivesymcipherCurrently active symcipher.protected intcipherclassidID of class used as cipher for symmetric encryption.protected java.lang.reflect.Constructor<?>cipherconConstructor for creating new ISymCipher objects.protected static java.lang.String[]CIPHERSAvailable cipher suites, order is important, only append please.protected KeyExchangeGeneratorkeyexgenGenerator for key exchanges.protected IKeyExchangekxThe key exchange.protected java.util.concurrent.atomic.AtomicLongmessageidcounterCounters for message IDs.protected java.util.concurrent.atomic.AtomicLongpacketidcounterCounters for packet IDs, must be greater than Long.MIN_VALUE to allow replay identification to work.protected longremainingbytesBytes remaining before rekeying.
 - 
Constructor SummaryConstructors Constructor Description SymCipherManagement(int cipherclassid, KeyExchangeGenerator keyexgen)Creates the management object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateKx()Creates a key exchange object.voidcreateSymCipherSuite(byte cipherid, byte[] symkey)Creates a symmetric cipher suite.voiddestroyKx()Destroys the key exchange object.voiddestroySymCipherSuite(byte cipherid)Destroys a symmetric cipher.bytegetActiveSymCipherId()Gets the currently active symmetric cipher ID.SymCipherSuitegetActiveSymCipherSuite()Gets the currently active symmetric cipher suite.intgetCipherClassId()Returns the ID of the selected cipher class.IKeyExchangegetKx()Returns current key exchange object.longgetRemainingBytes()Returns bytes remaining before rekeying.SymCipherSuitegetSymCipherSuite(byte cipherid)Gets a symmetric cipher suite.voidrefreshRemainingBytes()Refreshes the remaining bytes after rekeying.voidsetActiveSymCipherId(byte cipherid)Sets the currently active symmetric cipher ID.voidsubtractRemainingBytes(long bytes)Subtracts a number of bytes from the remaining bytes.
 
- 
- 
- 
Field Detail- 
CIPHERSprotected static final java.lang.String[] CIPHERS Available cipher suites, order is important, only append please.
 - 
cipherclassidprotected int cipherclassid ID of class used as cipher for symmetric encryption.
 - 
cipherconprotected java.lang.reflect.Constructor<?> ciphercon Constructor for creating new ISymCipher objects.
 - 
keyexgenprotected KeyExchangeGenerator keyexgen Generator for key exchanges.
 - 
packetidcounterprotected java.util.concurrent.atomic.AtomicLong packetidcounter Counters for packet IDs, must be greater than Long.MIN_VALUE to allow replay identification to work.
 - 
messageidcounterprotected java.util.concurrent.atomic.AtomicLong messageidcounter Counters for message IDs.
 - 
remainingbytesprotected long remainingbytes Bytes remaining before rekeying.
 - 
activesymcipherprotected byte activesymcipher Currently active symcipher.
 - 
kxprotected IKeyExchange kx The key exchange.
 
- 
 - 
Constructor Detail- 
SymCipherManagementpublic SymCipherManagement(int cipherclassid, KeyExchangeGenerator keyexgen)Creates the management object.- Parameters:
- symcipherclass- The symmetric cipher class used for encryption.
- keyexgen- Generator for key exchange objects.
 
 
- 
 - 
Method Detail- 
getCipherClassIdpublic int getCipherClassId() Returns the ID of the selected cipher class.- Returns:
- The ID.
 
 - 
getKxpublic IKeyExchange getKx() Returns current key exchange object.- Returns:
- Current key exchange object.
 
 - 
createKxpublic void createKx() Creates a key exchange object.
 - 
destroyKxpublic void destroyKx() Destroys the key exchange object.
 - 
createSymCipherSuitepublic void createSymCipherSuite(byte cipherid, byte[] symkey)Creates a symmetric cipher suite.- Parameters:
- cipherid- ID of the key used by the cipher.
- symkey- The key.
 
 - 
getSymCipherSuitepublic SymCipherSuite getSymCipherSuite(byte cipherid) Gets a symmetric cipher suite.- Parameters:
- cipherid- ID of the key used by the cipher.
 
 - 
getActiveSymCipherSuitepublic SymCipherSuite getActiveSymCipherSuite() Gets the currently active symmetric cipher suite.
 - 
getActiveSymCipherIdpublic byte getActiveSymCipherId() Gets the currently active symmetric cipher ID.
 - 
setActiveSymCipherIdpublic void setActiveSymCipherId(byte cipherid) Sets the currently active symmetric cipher ID.- Parameters:
- cipherid- The ID.
 
 - 
destroySymCipherSuitepublic void destroySymCipherSuite(byte cipherid) Destroys a symmetric cipher.- Parameters:
- cipherid- ID of the key used by the cipher.
 
 - 
getRemainingBytespublic long getRemainingBytes() Returns bytes remaining before rekeying.- Returns:
- Bytes remaining before rekeying.
 
 - 
subtractRemainingBytespublic void subtractRemainingBytes(long bytes) Subtracts a number of bytes from the remaining bytes.- Parameters:
- bytes- Bytes to subtract.
 
 - 
refreshRemainingBytespublic void refreshRemainingBytes() Refreshes the remaining bytes after rekeying.
 
- 
 
-