code: func (e *EncryptedRaftLogger) RotateEncryptionKey(newKey []byte) {
  	e.encoderMu.Lock()
  	defer e.encoderMu.Unlock()
  
  	if e.wal != nil { // if the wal exists, the snapshotter exists
  		// We don't want to have to close the WAL, because we can't open a new one.
  		// We need to know the previous snapshot, because when you open a WAL you
  		// have to read out all the entries from a particular snapshot, or you can't
  		// write.  So just rotate the encoders out from under it.  We already
  		// have a lock on writing to snapshots and WALs.
  		wrapped, ok := e.wal.(*wrappedWAL)
  		if !ok {
  			panic(fmt.Errorf("EncryptedRaftLogger's WAL is not a wrappedWAL"))
  		}
  
  		wrapped.encrypter, wrapped.decrypter = encryption.Defaults(newKey, e.FIPS)
  
  		e.snapshotter = NewSnapFactory(wrapped.encrypter, wrapped.decrypter).New(e.snapDir())
  	}
  	e.EncryptionKey = newKey
  }
docs: // RotateEncryptionKey swaps out the encoders and decoders used by the wal and snapshotter