'Called back by a subclass once a I{MSG_NEWKEYS} message has been
received.  This indicates key exchange has completed and new encryption
and compression parameters should be adopted.  Any messages which were
queued during key exchange will also be flushed.'

def _newKeys(self):

    log.msg('NEW    KEYS')
    self.currentEncryptions = self.nextEncryptions
    if (self.outgoingCompressionType == 'zlib'):
        self.outgoingCompression = zlib.compressobj(6)
    if (self.incomingCompressionType == 'zlib'):
        self.incomingCompression = zlib.decompressobj()
    self._keyExchangeState = self._KEY_EXCHANGE_NONE
    messages = self._blockedByKeyExchange
    self._blockedByKeyExchange = None
    for (messageType, payload) in messages:
        self.sendPacket(messageType, payload)
