Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: constructor and access to some methods were missing in ios #93

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
Loading