-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/ATL-5687' of github.com:input-output-hk/atala-p…
…rism-apollo into feature/ATL-5687 * 'feature/ATL-5687' of github.com:input-output-hk/atala-prism-apollo: fix: deployment script (#101) build: increase gradle version 1.0.2 (#100) feat(BAE): updating jsMain Ed25519 keys for use in TS (#92) fix: constructor and access to some methods were missing in ios (#93) fix: bugs found while integrating apollo with KMP SDK (#98) fix: KMP Gradle bug (#99) build: increase gradle version 1.0.1 (#97) feature: add publicKey to PrivateKeys (#96) feat: compress and uncompress secp256k1 functionality for (macos,ios,js,android,jvm) (#95) feat: add mnemonic validation (#94) # Conflicts: # base-asymmetric-encryption/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/KMMECSecp256k1PublicKey.kt
- Loading branch information
Showing
36 changed files
with
455 additions
and
110 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
root = true | ||
|
||
[*.{kt,kts}] | ||
ktlint_code_style = ktlint_official | ||
ktlint_standard_no_semi = disabled | ||
ktlint_standard_trailing-comma-on-call-site = disabled | ||
ktlint_standard_trailing-comma-on-declaration-site = disabled | ||
ktlint_standard_function-signature = disabled |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
# kics-scan ignore | ||
name: Deployment | ||
|
||
defaults: | ||
|
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
27 changes: 16 additions & 11 deletions
27
...metric-encryption/src/androidMain/kotlin/io/iohk/atala/prism/apollo/utils/KMMEdKeyPair.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 |
---|---|---|
@@ -1,27 +1,32 @@ | ||
package io.iohk.atala.prism.apollo.utils | ||
|
||
import org.bouncycastle.jce.provider.BouncyCastleProvider | ||
import java.security.KeyPair | ||
import java.security.KeyPairGenerator | ||
import org.bouncycastle.crypto.generators.Ed25519KeyPairGenerator | ||
import org.bouncycastle.crypto.params.Ed25519KeyGenerationParameters | ||
import org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters | ||
import org.bouncycastle.crypto.params.Ed25519PublicKeyParameters | ||
import java.security.SecureRandom | ||
|
||
actual class KMMEdKeyPair actual constructor(actual val privateKey: KMMEdPrivateKey, actual val publicKey: KMMEdPublicKey) { | ||
actual class KMMEdKeyPair actual constructor( | ||
actual val privateKey: KMMEdPrivateKey, | ||
actual val publicKey: KMMEdPublicKey | ||
) { | ||
actual companion object : Ed25519KeyPairGeneration { | ||
override fun generateKeyPair(): KMMEdKeyPair { | ||
val provider = BouncyCastleProvider() | ||
val generator = KeyPairGenerator.getInstance("Ed25519", provider) | ||
val javaKeyPair: KeyPair = generator.generateKeyPair() | ||
val generator = Ed25519KeyPairGenerator() | ||
generator.init(Ed25519KeyGenerationParameters(SecureRandom())) | ||
val pair = generator.generateKeyPair() | ||
return KMMEdKeyPair( | ||
KMMEdPrivateKey(javaKeyPair.private.encoded), | ||
KMMEdPublicKey(javaKeyPair.public.encoded) | ||
privateKey = KMMEdPrivateKey((pair.private as Ed25519PrivateKeyParameters).encoded), | ||
publicKey = KMMEdPublicKey((pair.public as Ed25519PublicKeyParameters).encoded), | ||
) | ||
} | ||
} | ||
|
||
actual fun sign(message: ByteArray): ByteArray { | ||
throw NotImplementedError("Not implemented") | ||
return privateKey.sign(message) | ||
} | ||
|
||
actual fun verify(message: ByteArray, sig: ByteArray): Boolean { | ||
throw NotImplementedError("Not implemented") | ||
return publicKey.verify(message, sig) | ||
} | ||
} |
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
20 changes: 11 additions & 9 deletions
20
...ic-encryption/src/androidMain/kotlin/io/iohk/atala/prism/apollo/utils/KMMX25519KeyPair.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
11 changes: 10 additions & 1 deletion
11
...encryption/src/androidMain/kotlin/io/iohk/atala/prism/apollo/utils/KMMX25519PrivateKey.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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
package io.iohk.atala.prism.apollo.utils | ||
|
||
actual class KMMX25519PrivateKey(val raw: ByteArray) | ||
import org.bouncycastle.crypto.params.X25519PrivateKeyParameters | ||
|
||
actual class KMMX25519PrivateKey(val raw: ByteArray) { | ||
|
||
fun publicKey(): KMMX25519PublicKey { | ||
val private = X25519PrivateKeyParameters(raw, 0) | ||
val public = private.generatePublicKey() | ||
return KMMX25519PublicKey(public.encoded) | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
...mmetric-encryption/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/KMMEdKeyPair.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
3 changes: 3 additions & 0 deletions
3
...ric-encryption/src/commonMain/kotlin/io/iohk/atala/prism/apollo/utils/KMMX25519KeyPair.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
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
Oops, something went wrong.