Better handling of JWT key, see toBuffer() for details.