Perhaps this is general desktop development questi...
# compose-desktop
s
Perhaps this is general desktop development question but using Jetpack compose is my first time doing this and I have a question regarding storing sensitive data e.g tokens in a desktop context. I’m playing around with building a Mac app and i wonder how to approach saving sensitive data specifically on Mac that would be entered once but should be persisted for as long as it does not need to change. What is the recommended approach? Does anyone have/know a sample of something like this?
b
Have you looked at multiplatform-settings?
s
👍 2
m
Does multiplatform-settings support storing sensitive data? I did not find anything like that on a first glance.
s
I have not actively tried it but I skimmed through some of the code and looks like there is some usage of keychain which i think would fit the requirement of storing sensitive data 🤔
m
But that’s Apple only 😟
s
ah sorry i was looking for Apple specifically 😅
m
Note that the JVM implementation doesn't use keystores probably because it's not necessary. You can store passwords in the system keystore using the JCA APIs.
If you're storing actual keys or certs, it's better to store them directly of course, but a "password" can be any arbitrary stringified data.
Be aware: for these APIs to work your app must have identity, which boils down to how it's packaged and signed. That's how the OS knows to only give out the passwords to your app and not others.