-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provider: Signing #94
Merged
Merged
Changes from 56 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
6f5c8c4
Signing
iaik-jheher 40b96b5
android fixes + signer cleanup
iaik-jheher fce2734
attestation
iaik-jheher 25a5b68
look at all of these lines of code that we aren't writing
iaik-jheher be68019
cleanup xcode artefacts
iaik-jheher 0c66aa4
ios attestation adjustments
iaik-jheher 264e2b3
ephemeral keys
iaik-jheher 15fb42b
ios ephemeral keys
iaik-jheher 47ec231
change defaults for ephemeral keys to be super permissive
iaik-jheher 0dd5845
ios digest cleanup
iaik-jheher e17a2d6
JKS provider
iaik-jheher a0641bc
JKS provider
iaik-jheher cf5a58d
expose ephemeral key internal object
iaik-jheher 8810095
annotate our own usages
iaik-jheher 706959d
ephemerals arrrgh
iaik-jheher fd13988
Revert "ephemerals arrrgh"
iaik-jheher d88b319
ephemeral internals but nicer
iaik-jheher 64bb2b9
hazmat cleanup
iaik-jheher 1c5ed2b
experimentals opt-in
iaik-jheher ce91f4f
missing import
iaik-jheher 56f30a3
bump sumpreme version
JesusMcCloud 7ff5e4b
update kotlin+kotest
JesusMcCloud c0f9577
platform signer cleanup
iaik-jheher d0a64a3
KT-71036 workaround
iaik-jheher 961ff67
activity lifecycle callbacks on android
iaik-jheher 10bfc0a
Revert "update kotlin+kotest"
iaik-jheher 522c613
dummy out platform-agnostic provider construction until KT-71036 is f…
iaik-jheher d75e70b
ios timeout
iaik-jheher de918b1
don't overwrite existing keys
iaik-jheher d529b2a
version updates, changelog, ang fixes
JesusMcCloud b18ea9f
fix jvm compile error
JesusMcCloud e40c349
partial documentation commit
iaik-jheher c9c8ae2
fix testcase after rename
iaik-jheher ee0e0d5
revert partial change that never happened
iaik-jheher 3734d3a
cleanup build files
JesusMcCloud 3bcd70e
update AGP
JesusMcCloud 8468cd3
the documentation commit
iaik-jheher fd45323
update AGP
JesusMcCloud c6437b9
WIP
iaik-jheher 9fa0569
build fixes
iaik-jheher 3495542
always pre-hash on ios
iaik-jheher 5b612d1
fix demoapp build
JesusMcCloud 7bef269
the second coming of Signer, iOS edition
iaik-jheher 9b6827f
now also on android
iaik-jheher 6de1296
requested adjustments android edition
iaik-jheher 4086154
requested changes ios edition
iaik-jheher 0d98161
fix ios cancellation detection
iaik-jheher 059a4f3
fix ios cancellation detection
iaik-jheher d64de45
pin android to single thread
iaik-jheher b98104c
readme
iaik-jheher fc72ad0
delete the readme compile tests since @JesusMcCloud deleted the depen…
iaik-jheher ae1f93b
test case fixes for kotlin 2.0.20
iaik-jheher ada7600
cleanup demoapp readme
JesusMcCloud 01c2286
cleanup build files
JesusMcCloud 5c6b68a
fix comment in build file
JesusMcCloud f86e857
fix developmen.md for demo app
JesusMcCloud eef462b
workaround android keystore bug
iaik-jheher 68ff176
current-set biometry on ios
iaik-jheher fb96c9e
signatureresult transforming
iaik-jheher e67557a
star wars
iaik-jheher da90b11
fix jvm clash
iaik-jheher a3f9959
add link to readme
iaik-jheher becb46f
throws annotation as requested
iaik-jheher 7c8293a
Revert "throws annotation as requested" (because it breaks iOS)
iaik-jheher a7072e1
requested documentation
iaik-jheher 5767057
sign() always returns RawByteEncodable signatures
iaik-jheher 694c2ac
fix andorid
iaik-jheher beeb94f
demoapp jvm support
iaik-jheher 79275cf
it's-a-read-me, mario
iaik-jheher c6f0815
Oklahoma
JesusMcCloud 0db13dc
attestation repudiation commit
iaik-jheher 432693d
remove kmp-crypto remnants
JesusMcCloud 910ccc6
fix jks testcase
JesusMcCloud File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**REQUIRES a MacOS Host to build all modules** | ||
|
||
* recursively clone this repo | ||
* set `sdk.dir=/absulute/path/to/Android/sdk` inside `kmp-crypto/local.properties` | ||
* import the this project into Android studio |
JesusMcCloud marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# KMP Crypto Demo Multiplatform (iOS, Android JVM) App | ||
|
||
|
||
![img.png](img.png) | ||
|
||
This app showcases the _Supreme_ KMP Crypto provider on Android and on iOS. Demoing the JVM target would require additional configuration due to limitations of Kotlin. | ||
It was decided to avoid this clutter for the demo app, since the Supreme test suite already showcases the JVM provider usage. | ||
|
||
It is possible to generate key pairs, sign data, and verify the signature. | ||
|
||
Generation of attestation statements is also supported, although on iOS, only P-256 keys can be attested due to platform constreaints. | ||
The default JVM provider does not natively support the creation of attestation statements. | ||
|
||
## Before running! | ||
- check your system with [KDoctor](https://github.com/Kotlin/kdoctor) | ||
- install JDK 17 on your machine | ||
- add `local.properties` file to the project root and set a path to Android SDK there | ||
|
||
### Android | ||
To run the application on android device/emulator: | ||
- open project in Android Studio and run imported android run configuration | ||
|
||
To build the application bundle: | ||
- run `./gradlew :composeApp:assembleDebug` | ||
- find `.apk` file in `composeApp/build/outputs/apk/debug/composeApp-debug.apk` | ||
|
||
### iOS | ||
To run the application on iPhone device/simulator: | ||
- Open `iosApp/iosApp.xcproject` in Xcode and run standard configuration | ||
- Or use [Kotlin Multiplatform Mobile plugin](https://plugins.jetbrains.com/plugin/14936-kotlin-multiplatform-mobile) for Android Studio | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
plugins { | ||
alias(libs.plugins.multiplatform).apply(false) | ||
alias(libs.plugins.compose).apply(false) | ||
alias(libs.plugins.android.application).apply(false) | ||
alias(libs.plugins.buildConfig).apply(false) | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots") | ||
mavenCentral() | ||
google() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import com.android.build.api.dsl.Packaging | ||
|
||
plugins { | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.compose) | ||
alias(libs.plugins.compose.runtime) | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.buildConfig) | ||
} | ||
|
||
kotlin { | ||
jvm() | ||
jvmToolchain(17) | ||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
} | ||
} | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "ComposeApp" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
all { | ||
languageSettings { | ||
optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") | ||
} | ||
} | ||
commonMain.dependencies { | ||
implementation("at.asitplus.signum:supreme:+") { | ||
isChanging = true | ||
} | ||
implementation(compose.runtime) | ||
implementation(compose.material3) | ||
implementation(compose.materialIconsExtended) | ||
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) | ||
implementation(compose.components.resources) | ||
implementation(libs.voyager.navigator) | ||
implementation(libs.composeImageLoader) | ||
implementation(libs.napier) | ||
implementation(libs.kotlinx.coroutines.core) | ||
} | ||
|
||
commonTest.dependencies { | ||
implementation(kotlin("test")) | ||
} | ||
|
||
androidMain.dependencies { | ||
implementation(libs.androidx.appcompat) | ||
implementation(libs.androidx.activityCompose) | ||
implementation(libs.compose.uitooling) | ||
implementation(libs.kotlinx.coroutines.android) | ||
implementation(libs.androidx.biometric) | ||
} | ||
|
||
|
||
jvmMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
} | ||
|
||
} | ||
} | ||
|
||
android { | ||
namespace = "at.asitplus.cryptotest" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 30 | ||
|
||
applicationId = "at.asitplus.cryptotest.androidApp" | ||
versionCode = 1 | ||
versionName = "1.0.0" | ||
} | ||
sourceSets["main"].apply { | ||
manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
res.srcDirs("src/androidMain/resources") | ||
resources.srcDirs("src/commonMain/resources") | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
packaging { | ||
resources.excludes.add("META-INF/versions/9/OSGI-INF/MANIFEST.MF") | ||
} | ||
} | ||
|
||
buildConfig { | ||
// BuildConfig configuration here. | ||
// https://github.com/gmazzo/gradle-buildconfig-plugin#usage-in-kts | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application | ||
android:name=".AndroidApp" | ||
android:icon="@android:drawable/ic_menu_compass" | ||
android:label="CryptoTest App" | ||
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar"> | ||
<activity | ||
android:name=".AppActivity" | ||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" | ||
android:launchMode="singleInstance" | ||
android:windowSoftInputMode="adjustPan" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
17 changes: 17 additions & 0 deletions
17
demoapp/composeApp/src/androidMain/kotlin/at/asitplus/cryptotest/App.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package at.asitplus.cryptotest | ||
|
||
import android.app.Application | ||
import android.os.Bundle | ||
import androidx.activity.compose.setContent | ||
import androidx.fragment.app.FragmentActivity | ||
|
||
class AndroidApp : Application() | ||
|
||
class AppActivity : FragmentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent { | ||
App() | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
demoapp/composeApp/src/androidMain/kotlin/at/asitplus/cryptotest/theme/Theme.android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package at.asitplus.cryptotest.theme | ||
|
||
import android.app.Activity | ||
import android.graphics.Color | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.LaunchedEffect | ||
import androidx.compose.ui.platform.LocalView | ||
import androidx.core.view.WindowCompat | ||
|
||
@Composable | ||
internal actual fun SystemAppearance(isDark: Boolean) { | ||
val view = LocalView.current | ||
val systemBarColor = Color.TRANSPARENT | ||
LaunchedEffect(isDark) { | ||
val window = (view.context as Activity).window | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
window.statusBarColor = systemBarColor | ||
window.navigationBarColor = systemBarColor | ||
WindowCompat.getInsetsController(window, window.decorView).apply { | ||
isAppearanceLightStatusBars = isDark | ||
isAppearanceLightNavigationBars = isDark | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JKS signer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JKS signer is not a
PlatformSigningProvider
right nowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a note