An implementation of estimating the two-to-two $K$-matrix from finite-volume energies based on the L\"uscher formalism and involving a Hermitian matrix known as the "box matrix" is described. The method includes higher partial waves and multiple decay channels. Two fitting procedures for estimating the $K$-matrix parameters, which properly incorporate all statistical covariances, are discussed. Formulas and software for handling total spins up to $S=2$ and orbital angular momenta up to $L=6$ are obtained for total momenta in several directions. First tests involving $\rho$-meson decay to two pions include the $L=3$ and $L=5$ partial waves, and the contributions from these higher waves are found to be negligible in the elastic energy range.
Bibliografisk note32 pages, 1 figure