-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement supreme signing capabilities * Introduce Attestation Data Structure * Dependency Updates: * Kotlin 2.0.20 * kotlinx.serialization 1.7.2 stable (bye, bye unofficial snapshot dependency!) * kotlinx-datetime 0.6.1 --------- Co-authored-by: Bernd Prünster <bernd.pruenster@a-sit.at>
- Loading branch information
1 parent
9cf9b8a
commit 32bd91c
Showing
99 changed files
with
5,438 additions
and
424 deletions.
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
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 `signum/local.properties` | ||
* import the this project into 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,33 @@ | ||
# Supreme Multiplatform (JVM, Android, iOS) Demo 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,113 @@ | ||
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") | ||
} | ||
} | ||
|
||
|
||
compose.desktop { | ||
application { | ||
mainClass = "at.asitplus.cryptotest.MainKt" | ||
} | ||
} | ||
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> |
21 changes: 21 additions & 0 deletions
21
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,21 @@ | ||
package at.asitplus.cryptotest | ||
|
||
import android.app.Application | ||
import android.os.Bundle | ||
import androidx.activity.compose.setContent | ||
import androidx.fragment.app.FragmentActivity | ||
import at.asitplus.signum.supreme.os.PlatformSigningProvider | ||
import at.asitplus.signum.supreme.os.SigningProvider | ||
|
||
actual val Provider: SigningProvider = PlatformSigningProvider | ||
|
||
class AndroidApp : Application() | ||
|
||
class AppActivity : FragmentActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent { | ||
App() | ||
} | ||
} | ||
} |
Oops, something went wrong.