target for MacOS/Windows/Linux desktop.
I want to use MacOS keychain for storing private keys securely.
How can I access the MacOS keychain from the
jvmMain
target?
Does the
jvmMain
target inherit from the
macosMain
target when building for macOS?
jQrgen
07/18/2024, 1:35 PM
PS: Most of the code is already in
commonMain;
maybe I should move it to a
macosMain
target?
m
Michael Krussel
07/18/2024, 2:40 PM
I don't know if this class helps with using the OS's KeyStore, I've never tried. https://docs.oracle.com/javase/8/docs/api/java/security/KeyStore.html
If not if you want to access the platform specific features on the JVM, you need to use JNI or a third party library.
Depending on the type of app you are making, switching to a native target could be a good solution. If this is a graphical app, then you have to figure out what you are using for a native UI.
j
jQrgen
07/18/2024, 2:41 PM
Ok ok thanks
We have all our UI in Compose already
m
Michael Krussel
07/18/2024, 3:10 PM
I don't believe Compose supports macosMain. The desktop version is for JVM, and I think iOS is the only native target supported.
j
jQrgen
07/18/2024, 3:11 PM
Ahaaa
jQrgen
07/18/2024, 3:29 PM
The I have to use the macOS keychain from JVM or have some secure storage in JVM that other apps cannot access in desktop