Hey everyone, It should be possible to wrap `/usr/...
# kotlin-native
s
Hey everyone, It should be possible to wrap
/usr/bin/openssl
and
/usr/bin/base64
from Kotlin Native, no? I'm trying to wrap these to generate JWT tokens. Anyone has a good example I could look at?
e
why not do it in-process?
s
So not wrapping it like this? https://kotlinlang.org/docs/native-app-with-c-and-libcurl.html#create-a-definition-file Do you have any examples I could look at?
e
that would be in-process (e.g. using
libssl
not the
openssl
command)
although if all you need is HMAC-SHA256 and similar, Okio supports that itself on multiplatform so you don't even need additional native dependencies
c
There is also this lib that wraps all the platform implementations: diglol/crypto: Diglol Crypto for Kotlin Multiplatform. (github.com)
Comes with Hmac and base64 as well
s
Oh great. I wasn't aware of that library. I tried googling... I need a better way of exploring Kotlin MPP eco-system. Thanks @Christian Würthenr! I think that was exactly what I was looking for.
@ephemient I looked at Okio as well but not sure what you mean with "in-process". Thanks all for sharing ☺️ Think I have enough to solve my use-case.
Ah,
diglol
is missing linux target. Only mac and relying on Apple Framework. Smart solution though!
b
Try searching for the term "crypto" with your target filters on kamp.petuska.dev
s
I didn't know about that site 😮 This is great!
137 Views