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
  • Loading branch information
goncalo-frade-iohk committed Sep 25, 2023
1 parent e6f6d46 commit b5d0917
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 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,7 @@ package io.iohk.atala.prism.apollo.utils

import swift.cryptoKit.X25519

actual class KMMX25519PrivateKey {
public val raw: ByteArray

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

@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 b5d0917

Please sign in to comment.