extend encode to accept a header extension object to allow jku, kid, xtu, and x5t to be set