Skip to content

Commit

Permalink
fix: constructor and access to some methods were missing in ios (#93)
Browse files Browse the repository at this point in the history
Co-authored-by: Ahmed Moussa <[email protected]>
Signed-off-by: Goncalo Frade <[email protected]>
  • Loading branch information
goncalo-frade-iohk and hamada147 committed May 20, 2024
1 parent 1e80892 commit 9bc0392
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ actual class KMMEdKeyPair actual constructor(
actual val privateKey: KMMEdPrivateKey,
actual val publicKey: KMMEdPublicKey
) {

actual companion object : Ed25519KeyPairGeneration {
override fun generateKeyPair(): KMMEdKeyPair {
public actual companion object : Ed25519KeyPairGeneration {
public override fun generateKeyPair(): KMMEdKeyPair {
val privateKey = KMMEdPrivateKey()
return KMMEdKeyPair(privateKey, privateKey.publicKey())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ actual class KMMX25519KeyPair actual constructor(
actual val privateKey: KMMX25519PrivateKey,
actual val publicKey: KMMX25519PublicKey
) {
actual companion object : X25519KeyPairGeneration {
override fun generateKeyPair(): KMMX25519KeyPair {
public actual companion object : X25519KeyPairGeneration {
public override fun generateKeyPair(): KMMX25519KeyPair {
val privateKey = KMMX25519PrivateKey()
return KMMX25519KeyPair(privateKey, privateKey.publicKey())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ package io.iohk.atala.prism.apollo.utils

import swift.cryptoKit.X25519

actual class KMMX25519PrivateKey {
public val raw: ByteArray

actual class KMMX25519PrivateKey(val raw: ByteArray) {
@Throws(RuntimeException::class)
constructor() {
this.raw = X25519.createPrivateKey().success()?.toByteArray() ?: throw RuntimeException("Null result")
}
public constructor() : this(X25519.createPrivateKey().success()?.toByteArray() ?: throw RuntimeException("Null result"))

@Throws(RuntimeException::class)
public fun publicKey(): KMMX25519PublicKey {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
package io.iohk.atala.prism.apollo.utils

actual class KMMX25519PublicKey {
public val raw: ByteArray

constructor(raw: ByteArray) {
this.raw = raw
}
}
actual class KMMX25519PublicKey(val raw: ByteArray = ByteArray(0))

0 comments on commit 9bc0392

Please sign in to comment.