Skip to content

Commit

Permalink
fix: constructor and access to some methods were missing in ios
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed Moussa <[email protected]>
  • Loading branch information
goncalo-frade-iohk authored and hamada147 committed Oct 2, 2023
1 parent e6f6d46 commit 2cc7b1d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ actual class KMMEdKeyPair actual constructor(
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,10 @@ 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 2cc7b1d

Please sign in to comment.