Hey! I have a multiplatform app with a `jvmMain` ...
# multiplatform
j
Hey! I have a multiplatform app with a
jvmMain
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?
PS: Most of the code is already in
commonMain;
maybe I should move it to a
macosMain
target?
m
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
Ok ok thanks We have all our UI in Compose already
m
I don't believe Compose supports macosMain. The desktop version is for JVM, and I think iOS is the only native target supported.
j
Ahaaa
The I have to use the macOS keychain from JVM or have some secure storage in JVM that other apps cannot access in desktop