support for leading/trailing whitespace in canonical key