atomicdata-dev / atomic-server

An open source headless CMS / real-time database. Powerful table editor, full-text search, and SDKs for JS / React / Svelte.
https://atomicserver.eu
MIT License
1.07k stars 49 forks source link

Store key using `SubtleCrypto` API in browser #1013

Open joepio opened 1 week ago

joepio commented 1 week ago
Polleps commented 1 week ago

15% 😭. But we could future proof by checking support and conditionally using it while sticking to local storage for browsers that don't. Also we need to think about how we want to go about this, I believe WebCrypto can not return the private key, only sign data with it meaning @tomic/lib needs to use it directly. Right now storing the key is handled by browser because that is not really the concern of lib. WebCrypto might not be available in all contexts that lib should be able to run in. It is also not always appropriate for the key to be stored in general, for example on a server that has a store instance for each connected user.