Upgrade to Pro — share decks privately, control downloads, hide ads and more …

K/NでCryptoKit使いたかった

RyuNen344
November 29, 2022

 K/NでCryptoKit使いたかった

RyuNen344

November 29, 2022
Tweet

More Decks by RyuNen344

Other Decks in Technology

Transcript

  1. ࿩͢͜ͱɾ࿩͞ͳ͍͜ͱ • ࿩͢͜ͱ • CryptoKitͱ͸ • ͳͥCryptoKitΛ࢖͍͍͔ͨ • Kotlin NativeͷSwift/Obj-C

    Interop • ࿩͞ͳ͍͜ͱ • KMMͱ͸(͕࣌ؒ଍Γͳ͘ͳΔ) • androidଆʹدΓఴͬͨ಺༰(΄΅androidؔ܎ͳ͍࿩͔͠͠ͳ͍) • ඇରশ҉߸पΓ(K/NͰSecurity Framework࢖͑Δ)
  2. Ͳ͏͍͏ϥούʔϥΠϒϥϦ͕΄͍͔͠ • K/NϥΠϒϥϦͱͯ͠ެ։͞Ε͍ͯΔ • -> KMMʹ௥Ճ͢Δ͚ͩͰCryptoKit࢖͑ΔΑ͏ʹͳͬͯ΄͍͠ • ϥούʔϥΠϒϥϦ͸dynamic libraryͱͯ͠CryptoKitΛͱΓ͜ΜͰ΄͍͠ •

    -> όΠφϦຊମʹCryptoKitͷϏϧυੜ੒෺ΛؚΜͰ΄͘͠ͳ͍ • (౰ͨΓલ͕ͩ)CryptoKit͔ΒͷΤϥʔΛͪΌΜͱϋϯυϦϯάͰ͖ΔIFʹ ͳͬͯͯ΄͍͠
  3. ϥούʔϥΠϒϥϦΛ࡞Δ • Swift Interopʹ͸error఻ൖपΓʹ᠘͕͋Δ • Swift/Objective-C error-throwing methods aren't imported

    to Kotlin as exception- throwing • https://kotlinlang.org/docs/native-objc-interop.html#errors-and-exceptions • Kotlin -> Obj-CɺObj-C -> Kotlinͷ྆ํʹ੍໿͕͋Δ • ࠓճͷϢʔεέʔεͩͱSwift -> Obj-C ->KotlinͷܗʹͳΔͨΊͦΕͧΕͷݴޠײͷนΛߟྀͯ͠ ࣮૷͢Δඞཁ͕͋Δ • iOSͷ։ൃݴޠͷσϑΝΫτ͕Obj-C͔ΒSwiftʹ੾ΓସΘͬͨλΠϛϯάͷࢿྉ͕໾ʹཱͪͦ͏
  4. ·ͱΊ • ࠓճ༻ҙͰ͖ͨ෦෼͸͜͜·Ͱ • ࢲࣗ਎͸ࠓճඞཁ෼ͷΈͷఆ͔ٛ͠ߦΘͣɺCryptoKitશମͷϥοϓʹ͸ͨͲΓண͔ͳ ͔ͬͨ(୭͔Ұॹʹ΍Γ·ͤΜ͔ɾɾɾ) • Swift InteropपΓʹ͸Τϥʔ఻ൖͷ᠘͕͋Δ •

    Swift/Kotlin௚ޓ׵ରԠͷissue͸͋Δ͕͕͔͔࣌ؒΓͦ͏ͳͷͰϥούʔϥΠϒϥϦΛ ࡞ΔҎ֎ʹݱঢ়͸खஈ͕ͳͦ͞͏ • https://youtrack.jetbrains.com/issue/KT-49521/Support-direct-interoperability-with- Swift