diff --git a/apollo/src/commonMain/kotlin/org/hyperledger/identus/apollo/utils/KMMEdPrivateKey.kt b/apollo/src/commonMain/kotlin/org/hyperledger/identus/apollo/utils/KMMEdPrivateKey.kt index 25ce940ed..10b8632b2 100644 --- a/apollo/src/commonMain/kotlin/org/hyperledger/identus/apollo/utils/KMMEdPrivateKey.kt +++ b/apollo/src/commonMain/kotlin/org/hyperledger/identus/apollo/utils/KMMEdPrivateKey.kt @@ -1,5 +1,6 @@ package org.hyperledger.identus.apollo.utils + /** * Definition of the KMMEdPrivateKey functionality */ diff --git a/apollo/src/jvmTest/kotlin/org.hyperledger.identus.apollo/ed25519/KMMEdKeyPairTest.kt b/apollo/src/jvmTest/kotlin/org.hyperledger.identus.apollo/ed25519/KMMEdKeyPairTest.kt deleted file mode 100644 index afc167b43..000000000 --- a/apollo/src/jvmTest/kotlin/org.hyperledger.identus.apollo/ed25519/KMMEdKeyPairTest.kt +++ /dev/null @@ -1,51 +0,0 @@ -package org.hyperledger.identus.apollo.ed25519 - -import org.hyperledger.identus.apollo.base64.base64DecodedBytes -import org.hyperledger.identus.apollo.base64.base64UrlDecodedBytes -import org.hyperledger.identus.apollo.base64.base64UrlEncoded -import org.hyperledger.identus.apollo.utils.KMMEdKeyPair -import org.hyperledger.identus.apollo.utils.KMMEdPrivateKey -import org.hyperledger.identus.apollo.utils.KMMEdPublicKey -import kotlin.test.Test -import kotlin.test.assertNotNull -import kotlin.test.assertTrue - -class KMMEdKeyPairTest { - private val rawMessage = "Hello".encodeToByteArray() - private val rawSK = "M7+EvGp9vjLyx5SQ1xiKhRUN+YQ0kjx6d21WgX8P1hE".base64DecodedBytes - private val rawSKEncoded = rawSK.base64UrlEncoded - private val rawPk = "6kXLIS4a3UAzHm/5XTcvjCTGoAQ+yqPTT0YsM76EeuQ".base64DecodedBytes - private val rawPKEncoded = rawPk.base64UrlEncoded - private val rawSig = "rQHC0fmOclPBFiPVJCK_WJB0NgTAxSqpggPwRotNdncKrhgM2eECtr3j7UBTBmDdPTmpXGwQvyhTRTG8cymeBA".base64UrlDecodedBytes - - @Test - fun ed_signature_verify() { - val message = "testing".encodeToByteArray() - val edsk = KMMEdPublicKey("z+a8g8i/3yajE/QDIxIF7sP1m/aLKTOfygIuSJanRAg".base64DecodedBytes) - val sig = "zZzeTBYjrpowc+skEMVQSVTzntzXvZGcbBbNY0gHKF6z+e40Q5G3o35lX4Mf0J8iRde/LAn77JdzIh6gQv7hAA".base64DecodedBytes - val verify = edsk.verify(message, sig) - assertTrue(verify) - } - - @Test - fun testGenerateKeyPair() { - val keyPair = KMMEdKeyPair.generateKeyPair() - assertNotNull(keyPair) - assertNotNull(keyPair.privateKey) - assertNotNull(keyPair.publicKey) - } - - @Test - fun testConstructorEncoded() { - val key = KMMEdPrivateKey(rawSKEncoded.base64UrlDecodedBytes) - assertTrue(key.raw contentEquals rawSK) - } - - @Test - fun testSignMessageKnownValue() { - val privateKey = KMMEdPrivateKey(rawSK) - val sig = privateKey.sign(rawMessage) - assertNotNull(sig) - assertTrue(sig contentEquals rawSig) - } -}