Rather than generating key data on the client in the open, and storing it in IDB, I would recommend the Credential Management API[0]. Hand off the responsibility to proper generation and storage to the user agent. Then do your signing of the JWT with them instead.
[0]: https://developer.mozilla.org/en-US/docs/Web/API/Credential_...