cossacklabs / themis

Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.
https://www.cossacklabs.com/themis
Apache License 2.0
1.85k stars 143 forks source link

Support for Kotlin Multiplatform #1045

Open ashughes opened 6 months ago

ashughes commented 6 months ago

Is your feature request related to a problem? Please describe. In a Kotlin Multiplatform project, Themis must be integrated for each platform (Android, JVM desktop, native/iOS/macOS, WebAssembly) individually.

Describe the solution you'd like to see If Themis adds first class support for Kotlin Multiplatform, then the Themis Kotlin API could be used in common Kotlin code while the implementation for each platform is handled automatically. This would allow encryption and decryption logic to be shared between platforms.

Describe alternatives you've considered The alternative is to rewrite the Themis integration for each platform in a Kotlin Multiplatform project. This requires each project integrating Themis to either:

  1. Create a common Themis Kotlin API in order to share the encryption and decryption logic, then implement the API per platform using the platform specific implementation. This is essentially what this feature request is requesting to be done once for all instead of each Kotlin Multiplatform project having to do it separately.
  2. Not share the encryption and decryption logic and to re-implement it on each platform using the platform's native API.

Additional context Google has been adding support for Kotlin Multiplatform to several of their core AndroidX libraries and JetBrains has been adding Kotlin Multiplatform support to Android's Compose UI toolkit as well. The popularity of Kotlin Multiplatform is growing and this would be a great addition for Themis given it already supports the target platforms of Kotlin Multiplatform.