Skip to content

Commit

Permalink
Merge branch 'main' into ATL-4898
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianIOHK committed Sep 19, 2023
2 parents ce07b42 + 154ec78 commit 45b4b86
Show file tree
Hide file tree
Showing 50 changed files with 219 additions and 174 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.3.2](https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm/compare/v2.3.1...v2.3.2) (2023-09-19)


### Bug Fixes

* bump version for prism-agent v1.16 compatibility ([#99](https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm/issues/99)) ([238a17c](https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm/commit/238a17ccbd60253d862bad043bf23fccd87772a0))

## [2.3.1](https://github.com/input-output-hk/atala-prism-wallet-sdk-kmm/compare/v2.3.0...v2.3.1) (2023-08-30)


Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Atala Prism Wallet SDK - Kotlin Multiplatform (Android/JVM)

[![Kotlin](https://img.shields.io/badge/kotlin-1.7.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-1.9.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
![android](https://camo.githubusercontent.com/b1d9ad56ab51c4ad1417e9a5ad2a8fe63bcc4755e584ec7defef83755c23f923/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d616e64726f69642d3645444238442e7376673f7374796c653d666c6174)
![jvm](https://camo.githubusercontent.com/700f5dcd442fd835875568c038ae5cd53518c80ae5a0cf12c7c5cf4743b5225b/687474703a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6a766d2d4442343133442e7376673f7374796c653d666c6174)

Expand All @@ -20,32 +20,32 @@ Atala PRISM is a self-sovereign identity (SSI) platform and service suite for ve
The complete platform is separated in multiple repositories:

* [atala-prism-wallet-sdk-swift](https://github.com/input-output-hk/atala-prism-wallet-sdk-swift) - Repo that implements Atala PRISM for Apple platforms in Swift.
* [atala-prism-wallet-sdk-ts](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts) - Repo that implements Atala PRISM for Browser and NodeJS platforms in Typescript.
* [atala-prism-wallet-sdk-ts](https://github.com/input-output-hk/atala-prism-wallet-sdk-ts) - Repo that implements Atala PRISM for Browser and Node.js platforms in Typescript.
* [atala-prism-building-blocks](https://github.com/input-output-hk/atala-prism-building-blocks) - Repo that contains the platform Building Blocks.

### Modules / APIs

Atala PRISM Kotlin multiplatform SDK provides the following building blocks to create, manage and resolve decentralized identifiers, issue, manage and verify verifiable credentials, establish and manage trusted, peer-to-peer connections and interactions between DIDs, and store, manage, and recover verifiable data linked to DIDs.

* __Apollo__: Building block that provides a suite of criptographic operations.
* __Apollo__: Building block that provides a suite of cryptographic operations.
* __Castor__: Building block that provides a suite of DID operations in a user-controlled manner.
* __Pollux__: Building block that provides a suite of credential operations in a privacy-preserving manner.
* __Mercury__: Building block that provides a set of secure, standards-based communications protocols in a transport-agnostic and interoperable manner.
* __Pluto__: Building block that provides an interface for storage operations in a portable, storage-agnostic manner.
* __PrismAgent__: PrismAgent using all the building blocks provides a agent that can provide a set of high level DID functionalities.
* __PrismAgent__: PrismAgent using all the building blocks provides an agent that can provide a set of high level DID functionalities.

## Getting started

### Setup

To get started with the Atala PRISM kotlin multiplaform SDK, you can set up the SDK and start a new project or integrate it into an existing project. Before you start, make sure you have the following installed on your development machine:
To get started with the Atala PRISM kotlin multiplatform SDK, you can set up the SDK and start a new project or integrate it into an existing project. Before you start, make sure you have the following installed on your development machine:

- Android: API level 21 and above.
- Kotlin 1.7.20 or later.
- Kotlin 1.9.10 or later.
- JVM: 11 or later.

### Integrating the SDK in an existing project

To integrate the SDK into an exiting project, you have to import the SDK into your project:
To integrate the SDK into an existing project, you have to import the SDK into your project:

`implementation("io.iohk.atala.prism:walletsdk:$sdk_version")`
42 changes: 21 additions & 21 deletions atala-prism-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ val didpeerVersion = project.property("didpeer_version")
plugins {
id("com.squareup.sqldelight")
kotlin("multiplatform")
kotlin("plugin.serialization") version "1.7.20"
kotlin("plugin.serialization")
id("com.android.library")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlinx.kover") version "0.7.0"
id("org.jetbrains.kotlinx.kover") version "0.7.3"
}

koverReport {
Expand All @@ -39,7 +39,7 @@ koverReport {
}

kotlin {
android {
androidTarget {
publishAllLibraryVariants()
}

Expand Down Expand Up @@ -100,14 +100,14 @@ kotlin {
kotlin.srcDir("${project(":protosLib").buildDir}/generated/source/proto/main/kotlin")
resources.srcDir("${project(":protosLib").projectDir}/src/main")
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")

implementation("io.ktor:ktor-client-core:2.1.3")
implementation("io.ktor:ktor-client-content-negotiation:2.1.3")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.1.3")
implementation("io.ktor:ktor-client-logging:2.1.3")
implementation("io.ktor:ktor-client-core:2.3.4")
implementation("io.ktor:ktor-client-content-negotiation:2.3.4")
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.4")
implementation("io.ktor:ktor-client-logging:2.3.4")

implementation("io.iohk.atala.prism.didcomm:didpeer:$didpeerVersion")

Expand All @@ -122,13 +122,13 @@ kotlin {

implementation("pro.streem.pbandk:pbandk-runtime:0.14.2")

implementation("org.didcommx:didcomm:0.3.0")
implementation("org.didcommx:didcomm:0.3.2")

implementation("com.google.protobuf:protoc:3.12.0") {
exclude("com.google.protobuf")
}

implementation("com.squareup.sqldelight:coroutines-extensions:1.5.4")
implementation("com.squareup.sqldelight:coroutines-extensions:1.5.5")

api("org.lighthousegames:logging:1.1.2")

Expand All @@ -138,15 +138,15 @@ kotlin {
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
implementation("io.ktor:ktor-client-mock:2.1.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
implementation("io.ktor:ktor-client-mock:2.3.4")
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-okhttp:2.1.3")
implementation("io.ktor:ktor-client-okhttp:2.3.4")
implementation("org.bouncycastle:bcprov-jdk15on:1.68")
implementation("com.squareup.sqldelight:sqlite-driver:1.5.4")
implementation("com.squareup.sqldelight:sqlite-driver:1.5.5")
}
}
val jvmTest by getting {
Expand All @@ -156,13 +156,13 @@ kotlin {
}
val androidMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4")
implementation("io.ktor:ktor-client-okhttp:2.1.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
implementation("io.ktor:ktor-client-okhttp:2.3.4")
implementation("org.bouncycastle:bcprov-jdk15on:1.68")
implementation("com.squareup.sqldelight:android-driver:1.5.4")
implementation("com.squareup.sqldelight:android-driver:1.5.5")
}
}
val androidTest by getting {
val androidUnitTest by getting {
dependencies {
implementation("junit:junit:4.13.2")
}
Expand Down Expand Up @@ -262,7 +262,7 @@ tasks.withType<DokkaTask>().configureEach {
val antlrGenerationTask by tasks.register<com.strumenta.antlrkotlin.gradleplugin.AntlrKotlinTask>("generateKotlinCommonGrammarSource") {
// the classpath used to run antlr code generation
antlrClasspath = configurations.detachedConfiguration(
project.dependencies.create("com.github.piacenti:antlr-kotlin-runtime:0.0.14"),
project.dependencies.create("com.github.piacenti:antlr-kotlin-runtime:0.0.14")
)
maxHeapSize = "64m"
packageName = "io.iohk.atala.prism.walletsdk.castor.antlrgrammar"
Expand Down
2 changes: 1 addition & 1 deletion atala-prism-sdk/docs/Apollo.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Public-key encryption uses a public encryption key to encrypt data so that only

### Accumulators

Cryptographic accumulators allow for the accumulation of multiple values into one. Merkle trees are the most common type of accumulator used in the cryptocurrency domain. Accumulators make it possible to check (and prove) whether a given value has been accumulated.
Cryptographic accumulators allow for the accumulation of multiple values into one. Merkle's trees are the most common type of accumulator used in the cryptocurrency domain. Accumulators make it possible to check (and prove) whether a given value has been accumulated.

### MAC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@ import io.iohk.atala.prism.walletsdk.domain.models.PlutoError

actual class DbConnection actual constructor() {
actual var driver: SqlDriver? = null
actual suspend fun connectDb(
context: Any?,
): PrismPlutoDb {
actual suspend fun connectDb(context: Any?): PrismPlutoDb {
val androidContext: Context = (context as? Context) ?: throw PlutoError.DatabaseContextError()
val driver = AndroidSqliteDriver(PrismPlutoDb.Schema, androidContext, "prism.db")
this.driver = driver
return PrismPlutoDb(
driver,
)
return PrismPlutoDb(driver)
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class ApolloImpl : Apollo {
return Seed(
value = KeyDerivation.binarySeed(
seed = mnemonicCode,
passphrase = passphrase,
),
passphrase = passphrase
)
)
}

Expand All @@ -75,9 +75,9 @@ class ApolloImpl : Apollo {
Seed(
value = KeyDerivation.binarySeed(
seed = mnemonicCode,
passphrase = passphrase ?: "",
),
),
passphrase = passphrase ?: ""
)
)
)
}

Expand Down Expand Up @@ -271,7 +271,11 @@ class ApolloImpl : Apollo {
* @param signature The signature to verify.
* @return A boolean value indicating whether the signature is valid or not.
*/
override fun verifySignature(publicKey: PublicKey, challenge: ByteArray, signature: Signature): Boolean {
override fun verifySignature(
publicKey: PublicKey,
challenge: ByteArray,
signature: Signature
): Boolean {
if (publicKey.canVerify()) {
return when (publicKey.getCurve()) {
Curve.SECP256K1.value -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CastorImpl(apollo: Apollo, private val logger: PrismLogger = PrismLoggerIm
this.apollo = apollo
this.resolvers = arrayOf(
PeerDIDResolver(),
LongFormPrismDIDResolver(this.apollo),
LongFormPrismDIDResolver(this.apollo)
)
}

Expand Down Expand Up @@ -63,7 +63,7 @@ class CastorImpl(apollo: Apollo, private val logger: PrismLogger = PrismLoggerIm
return CastorShared.createPrismDID(
apollo = apollo,
masterPublicKey = masterPublicKey,
services = services,
services = services
)
}

Expand All @@ -83,7 +83,7 @@ class CastorImpl(apollo: Apollo, private val logger: PrismLogger = PrismLoggerIm
): DID {
return CastorShared.createPeerDID(
keyPairs = keyPairs,
services = services,
services = services
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object DIDUrlParser {
did,
listener.path ?: emptyArray(),
listener.query,
listener.fragment,
listener.fragment
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ constructor(val did: DID) {

init {
val methodId = PrismDIDMethodId(
did.methodId,
did.methodId
)

if (methodId.sections.size != 2) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PrismDIDPublicKey {
CAPABILITY_DELEGATION_KEY("capabilityDelegationKey"),
CAPABILITY_INVOCATION_KEY("capabilityInvocationKey"),
KEY_AGREEMENT_KEY("keyAgreementKey"),
UNKNOWN_KEY("unknownKey"),
UNKNOWN_KEY("unknownKey")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LongFormPrismDIDResolver(
override suspend fun resolve(didString: String): DIDDocument {
return CastorShared.resolveLongFormPrismDID(
apollo = apollo,
didString = didString,
didString = didString
)
}
}
Loading

0 comments on commit 45b4b86

Please sign in to comment.