signature: extend trimming to more whitespace

There are all sorts of misconfiguration in the wild. We already rely
on the signature constructor to trim SP. Extend the logic to use
`isspace` to decide whether a character should be trimmed.
Merge pull request #1644 from carlosmn/sig-isspace

signature: extend trimming to more whitespace