diff --git a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgent.kt b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgent.kt index ad9d67fe8..77c42b9c0 100644 --- a/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgent.kt +++ b/edge-agent-sdk/src/commonMain/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgent.kt @@ -140,7 +140,7 @@ private fun Url.Companion.parse(str: String): Url? { * EdgeAgent class is responsible for handling the connection to other agents in the network using a provided Mediator * Service Endpoint and seed data. */ -class EdgeAgent { +open class EdgeAgent { var state: State = State.STOPPED private set(value) { field = value @@ -158,7 +158,7 @@ class EdgeAgent { private val edgeAgentScope: CoroutineScope = CoroutineScope(Dispatchers.Default) private val api: Api - private var connectionManager: ConnectionManager + internal var connectionManager: ConnectionManager private var logger: PrismLogger private val agentOptions: AgentOptions @@ -406,7 +406,7 @@ class EdgeAgent { * @return A new [DID]. */ @JvmOverloads - suspend fun createNewPeerDID( + open suspend fun createNewPeerDID( services: Array = emptyArray(), updateMediator: Boolean ): DID { diff --git a/edge-agent-sdk/src/commonTest/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentTests.kt b/edge-agent-sdk/src/commonTest/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentTests.kt index c6810135c..ec44e5833 100644 --- a/edge-agent-sdk/src/commonTest/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentTests.kt +++ b/edge-agent-sdk/src/commonTest/kotlin/org/hyperledger/identus/walletsdk/edgeagent/EdgeAgentTests.kt @@ -3,18 +3,27 @@ package org.hyperledger.identus.walletsdk.edgeagent import anoncreds_wrapper.LinkSecret +import com.nimbusds.jose.EncryptionMethod +import com.nimbusds.jose.JWEAlgorithm +import com.nimbusds.jose.JWEObject import io.ktor.http.HttpStatusCode import java.security.interfaces.ECPublicKey import java.util.* import kotlinx.coroutines.flow.flow import kotlinx.coroutines.test.runTest +import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException import kotlinx.serialization.json.Json import org.hyperledger.identus.apollo.base64.base64UrlDecoded +import org.hyperledger.identus.apollo.base64.base64UrlDecodedBytes import org.hyperledger.identus.apollo.base64.base64UrlEncoded import org.hyperledger.identus.apollo.derivation.MnemonicHelper import org.hyperledger.identus.walletsdk.apollo.ApolloImpl +import org.hyperledger.identus.walletsdk.apollo.utils.Ed25519KeyPair +import org.hyperledger.identus.walletsdk.apollo.utils.Ed25519PrivateKey import org.hyperledger.identus.walletsdk.apollo.utils.Secp256k1KeyPair +import org.hyperledger.identus.walletsdk.apollo.utils.X25519KeyPair +import org.hyperledger.identus.walletsdk.apollo.utils.X25519PrivateKey import org.hyperledger.identus.walletsdk.castor.CastorImpl import org.hyperledger.identus.walletsdk.domain.buildingblocks.Apollo import org.hyperledger.identus.walletsdk.domain.buildingblocks.Castor @@ -22,6 +31,7 @@ import org.hyperledger.identus.walletsdk.domain.buildingblocks.Mercury import org.hyperledger.identus.walletsdk.domain.buildingblocks.Pluto import org.hyperledger.identus.walletsdk.domain.buildingblocks.Pollux import org.hyperledger.identus.walletsdk.domain.models.Api +import org.hyperledger.identus.walletsdk.domain.models.ApolloError import org.hyperledger.identus.walletsdk.domain.models.AttachmentData.AttachmentBase64 import org.hyperledger.identus.walletsdk.domain.models.AttachmentDescriptor import org.hyperledger.identus.walletsdk.domain.models.ClaimType @@ -29,20 +39,26 @@ import org.hyperledger.identus.walletsdk.domain.models.CredentialType import org.hyperledger.identus.walletsdk.domain.models.Curve import org.hyperledger.identus.walletsdk.domain.models.DID import org.hyperledger.identus.walletsdk.domain.models.DIDDocument +import org.hyperledger.identus.walletsdk.domain.models.DIDPair import org.hyperledger.identus.walletsdk.domain.models.DIDResolver import org.hyperledger.identus.walletsdk.domain.models.DIDUrl import org.hyperledger.identus.walletsdk.domain.models.HttpResponse import org.hyperledger.identus.walletsdk.domain.models.KeyCurve import org.hyperledger.identus.walletsdk.domain.models.Mediator import org.hyperledger.identus.walletsdk.domain.models.Message +import org.hyperledger.identus.walletsdk.domain.models.PolluxError import org.hyperledger.identus.walletsdk.domain.models.PresentationClaims import org.hyperledger.identus.walletsdk.domain.models.ProvableCredential import org.hyperledger.identus.walletsdk.domain.models.Seed import org.hyperledger.identus.walletsdk.domain.models.Signature +import org.hyperledger.identus.walletsdk.domain.models.keyManagement.CurveKey +import org.hyperledger.identus.walletsdk.domain.models.keyManagement.DerivationPathKey +import org.hyperledger.identus.walletsdk.domain.models.keyManagement.KeyTypes +import org.hyperledger.identus.walletsdk.domain.models.keyManagement.SeedKey +import org.hyperledger.identus.walletsdk.domain.models.keyManagement.TypeKey import org.hyperledger.identus.walletsdk.edgeagent.helpers.AgentOptions import org.hyperledger.identus.walletsdk.edgeagent.mediation.MediationHandler import org.hyperledger.identus.walletsdk.edgeagent.protocols.ProtocolType -import org.hyperledger.identus.walletsdk.edgeagent.protocols.issueCredential.CredentialPreview import org.hyperledger.identus.walletsdk.edgeagent.protocols.issueCredential.IssueCredential import org.hyperledger.identus.walletsdk.edgeagent.protocols.issueCredential.OfferCredential import org.hyperledger.identus.walletsdk.edgeagent.protocols.outOfBand.OutOfBandInvitation @@ -52,52 +68,88 @@ import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation import org.hyperledger.identus.walletsdk.edgeagent.protocols.proofOfPresentation.RequestPresentation import org.hyperledger.identus.walletsdk.logger.PrismLoggerMock import org.hyperledger.identus.walletsdk.mercury.ApiMock +import org.hyperledger.identus.walletsdk.pluto.CredentialRecovery +import org.hyperledger.identus.walletsdk.pluto.PlutoBackupTask +import org.hyperledger.identus.walletsdk.pluto.PlutoRestoreTask +import org.hyperledger.identus.walletsdk.pluto.RestorationID import org.hyperledger.identus.walletsdk.pluto.StorablePrivateKey +import org.hyperledger.identus.walletsdk.pluto.backup.models.BackupV0_0_1 import org.hyperledger.identus.walletsdk.pollux.PolluxImpl import org.hyperledger.identus.walletsdk.pollux.models.AnonCredential import org.hyperledger.identus.walletsdk.pollux.models.CredentialRequestMeta import org.hyperledger.identus.walletsdk.pollux.models.JWTCredential +import org.junit.Assert.assertNotEquals +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.runners.JUnit4 +import org.mockito.Mock import org.mockito.Mockito.verify import org.mockito.Mockito.`when` +import org.mockito.MockitoAnnotations import org.mockito.kotlin.any import org.mockito.kotlin.argumentCaptor import org.mockito.kotlin.mock -import kotlin.test.BeforeTest -import kotlin.test.Test +import org.mockito.kotlin.spy import kotlin.test.assertEquals import kotlin.test.assertFailsWith import kotlin.test.assertFalse import kotlin.test.assertTrue +@RunWith(JUnit4::class) @OptIn(kotlinx.coroutines.ExperimentalCoroutinesApi::class) class EdgeAgentTests { - lateinit var apolloMock: ApolloMock - lateinit var castorMock: CastorMock - lateinit var plutoMock: PlutoMock - lateinit var mercuryMock: MercuryMock - lateinit var polluxMock: PolluxMock - lateinit var mediationHandlerMock: MediationHandlerMock - lateinit var connectionManager: ConnectionManager + @Mock + lateinit var apolloMock: Apollo + + @Mock + lateinit var plutoMock: Pluto + + @Mock + lateinit var mercuryMock: Mercury + + @Mock + lateinit var polluxMock: Pollux + + @Mock + lateinit var castorMock: Castor + + @Mock + lateinit var connectionManagerMock: ConnectionManager + + @Mock + lateinit var mediationHandlerMock: MediationHandler + + lateinit var apolloMockOld: ApolloMock + lateinit var castorMockOld: CastorMock + lateinit var plutoMockOld: PlutoMock + lateinit var mercuryMockOld: MercuryMock + lateinit var polluxMockOld: PolluxMock + lateinit var mediationHandlerMockOld: MediationHandlerMock + lateinit var connectionManagerOld: ConnectionManager lateinit var json: Json + lateinit var seed: Seed - @BeforeTest + @Before fun setup() { - apolloMock = ApolloMock() - castorMock = CastorMock() - plutoMock = PlutoMock() - mercuryMock = MercuryMock() - polluxMock = PolluxMock() - mediationHandlerMock = MediationHandlerMock() + MockitoAnnotations.openMocks(this) + seed = Seed(MnemonicHelper.createRandomSeed()) + apolloMockOld = ApolloMock() + castorMockOld = CastorMock() + plutoMockOld = PlutoMock() + mercuryMockOld = MercuryMock() + polluxMockOld = PolluxMock() + mediationHandlerMockOld = MediationHandlerMock() // Pairing will be removed in the future - connectionManager = + connectionManagerOld = ConnectionManagerImpl( - mercuryMock, - castorMock, - plutoMock, - mediationHandlerMock, + mercuryMockOld, + castorMockOld, + plutoMockOld, + mediationHandlerMockOld, mutableListOf(), - polluxMock + polluxMockOld ) json = Json { ignoreUnknownKeys = true @@ -106,53 +158,227 @@ class EdgeAgentTests { } } + @Test + fun `EdgeAgent start should create peer did and register mediator if no mediator available`() = runTest { + val connectionManager = ConnectionManagerImpl( + mercuryMockOld, + castorMockOld, + plutoMock, + mediationHandlerMock, + mutableListOf(), + polluxMock + ) + + val agent = spy( + EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManager, + seed = null, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + ) + + val mediator = Mediator( + mediatorDID = DID("did:peer:asdf"), + hostDID = DID("did:peer:asdf"), + routingDID = DID("did:peer:asdf") + ) + `when`(mediationHandlerMock.bootRegisteredMediator()).thenReturn(null) + `when`(mediationHandlerMock.achieveMediation(any())).thenReturn(flow { emit(mediator) }) + `when`(mediationHandlerMock.mediator).thenReturn(mediator) + `when`(mediationHandlerMock.mediatorDID).thenReturn(mediator.mediatorDID) + + `when`(agent.createNewPeerDID(updateMediator = false)).thenReturn(DID("did:peer:asdf")) + agent.start() + + assertEquals(EdgeAgent.State.RUNNING, agent.state) + } + + @Test + fun `EdgeAgent start should throw MediationRequestFailedError if mediatiorhandler mediator is null`() = runTest { + val connectionManager = ConnectionManagerImpl( + mercuryMockOld, + castorMockOld, + plutoMock, + mediationHandlerMock, + mutableListOf(), + polluxMock + ) + + val agent = spy( + EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManager, + seed = null, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + ) + + val mediator = Mediator( + mediatorDID = DID("did:peer:asdf"), + hostDID = DID("did:peer:asdf"), + routingDID = DID("did:peer:asdf") + ) + `when`(mediationHandlerMock.bootRegisteredMediator()).thenReturn(null) + `when`(mediationHandlerMock.achieveMediation(any())).thenReturn(flow { emit(mediator) }) + `when`(mediationHandlerMock.mediator).thenReturn(null) + + `when`(agent.createNewPeerDID(updateMediator = false)).thenReturn(DID("did:peer:asdf")) + + assertFailsWith(EdgeAgentError.MediationRequestFailedError::class) { + agent.start() + assertEquals(EdgeAgent.State.STOPPED, agent.state) + } + } + + @Test + fun `EdgeAgent stop should change the state to stop`() = runTest { + val agent = spy( + EdgeAgent( + apollo = apolloMock, + castor = castorMock, + pluto = plutoMock, + mercury = mercuryMockOld, + pollux = polluxMock, + connectionManager = connectionManagerMock, + seed = seed, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + ) + agent.stop() + assertEquals(EdgeAgent.State.STOPPED, agent.state) + } + + @Test + fun `EdgeAgent setupMediatorHandler should stop the agent and replace the current mediatior handler`() = runTest { + val agent = spy( + EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerMock, + seed = null, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + ) + val mediatorHandlerMock2 = mock() + agent.setupMediatorHandler(mediatorHandlerMock2) + assertEquals(EdgeAgent.State.STOPPED, agent.state) + assertEquals(agent.connectionManager.mediationHandler, mediatorHandlerMock2) + } + + @Test + fun `EdgeAgent setupMediatorDID create a new mediator handler and call setup mediator handler`() = runTest { + val agent = spy( + EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerMock, + seed = null, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + ) + + val mediatorHandler = agent.connectionManager.mediationHandler + agent.setupMediatorDID(DID("did:peer:asdf")) + assertEquals(EdgeAgent.State.STOPPED, agent.state) + assertNotEquals(agent.connectionManager.mediationHandler, mediatorHandler) + } + + @Test + fun `EdgeAgent send message should call connection manager send message`() = runTest { + val agent = spy( + EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerMock, + seed = null, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + ) + + val message = Json.decodeFromString( + """{"id":"e430e4af-455e-4a15-9f2f-5bd8e5f350b8","piuri":"https://didcomm.org/issue-credential/3.0/offer-credential","from":{"method":"peer","methodId":"2.Ez6LSm5hETc4CS4X8RxYYKjoS2B3CM8TyzbgRrE7kGrdymHdq.Vz6MkoP2VXs4N7iNsKTzEKtZbnfu6yDH1x2ajGtCmNmc6qdMW.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"},"to":{"method":"peer","methodId":"2.Ez6LSd8irQSWjjMfvg53kcaDY6Q2doPEvQwscjSzidgWoFUVK.Vz6Mksu4QVe8oKwJEDPgxRg2bFa3QWrZR1EZGC9xq8xk9twYX.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"},"fromPrior":"null","body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":\"http:\\/\\/192.168.68.113:8000\\/cloud-agent\\/schema-registry\\/schemas\\/5667190d-640c-36af-a9f1-f4ed2587e766\\/schema\",\"type\":\"https:\\/\\/didcomm.org\\/issue-credential\\/3.0\\/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"age\",\"value\":\"18\"},{\"media_type\":null,\"name\":\"name\",\"value\":\"Cristian\"}]}},\"replacement_id\":null,\"comment\":null}","created_time":"1721242264","expires_time_plus":"1721328667","attachments":[{"id":"ee903fe0-2c49-4356-9b41-cfccc979c0a1","data":{"base64":"eyJzY2hlbWFfaWQiOiJodHRwOi8vMTkyLjE2OC42OC4xMTM6ODAwMC9jbG91ZC1hZ2VudC9zY2hlbWEtcmVnaXN0cnkvc2NoZW1hcy81NjY3MTkwZC02NDBjLTM2YWYtYTlmMS1mNGVkMjU4N2U3NjYvc2NoZW1hIiwiY3JlZF9kZWZfaWQiOiJodHRwOi8vMTkyLjE2OC42OC4xMTM6ODAwMC9jbG91ZC1hZ2VudC9jcmVkZW50aWFsLWRlZmluaXRpb24tcmVnaXN0cnkvZGVmaW5pdGlvbnMvM2RhNmExZDgtMmIyMy0zMTM4LWIwMmEtYWIwYmI0OGY4MGY5L2RlZmluaXRpb24iLCJrZXlfY29ycmVjdG5lc3NfcHJvb2YiOnsiYyI6IjM0MjE0MzM4OTA5MDk4MTU5ODIyNT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ExNDYyOTMzNTg3NjgwMTU0ODQ4ODgxMTY5MzY5NTc3OTk1NTI1ODQ2NDA1NjcyNDUyMzIyMTcyNjQ4MTc4OTEwMTg2ODkwNzYwNzM2MjMwNzA0MDA3NzU1OTA0OTIyNTUwODQ0MjkxNzgwOTk1NDAyNzUyNTU0NTAwNjg1NTY5NzYzMDc4ODY5NDU0NDI3NzY5NzU0Mzc5ODg5NzAzODQzNDM4ODcyMjMyOTc0MjIzODc5MzY5MTYzOTI1NjY3NjY5MzQyOTUwOTk5MjMwOTY1NDQ1MTkwOTM5Mzk5NzM1NjE1MTk2OTY2MzUyMTMwMzQ5MTE0NDE5OTIwMTk3NDIyMjA0ODQ2MTc2OTI3NTMwMDQ3NDkxNjI1NzAwODQ5NDc1MzQzNzk3MjU0MDYwNjc3MTA4MzkxOTU3MzU0MDAzOTAyNzMzMzEzMDI1ODE5Njk3MTIzMTc2NTg3MTU5NzQ5ODkxODg5MzU3Mjk0OTUyNDMwMDY2MTE5MjgzNzA1NTAwMTcxNTc3ODMzMzk3OTE1Mzc5OTA2NTA1MDExMjczODM2NTM3OTA2NjkyMjg2MTk5NDgzMjA3NDc1MzM2MjE1Njc4MTA1NDY5MDc3MTMyNDAwNDM4NTgyOTAyMjMwMzI5MDc4NjA4NTI4NDgzNDEwODI1NDkzNDcwMjI5MjA3MzA1NTk0ODUwMTg4ODUwMjEyNTQ0NzI0NDgyOTExOTQ3NTQ4NzIzMzMxMzYyNTI3MjA0Mzg3MzE1Mjk1MDU4Njk5MDk3NDc3MjQzMTczOTE0Njk5MDAzOTkzNTQiXV19LCJub25jZSI6IjM2MDY2NjE3NzQwNTA3NzY5NTI5NTMxNyJ9"},"format":"anoncreds/credential-offer@v1.0"}],"thid":"3a1c143b-7ab7-470d-99cf-bc5f31771388","ack":[]}""" + ) + agent.sendMessage(message) + verify(connectionManagerMock).sendMessage(message) + } + @Test fun testCreateNewPrismDID_shouldCreateNewDID_whenCalled() = runTest { - val seed = Seed(MnemonicHelper.createRandomSeed()) val validDID = DID("did", "test", "123") - castorMock.createPrismDIDReturn = validDID + castorMockOld.createPrismDIDReturn = validDID val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = seed, api = null, logger = PrismLoggerMock(), agentOptions = AgentOptions() ) - plutoMock.getPrismLastKeyPathIndexReturn = flow { emit(0) } + plutoMockOld.getPrismLastKeyPathIndexReturn = flow { emit(0) } val newDID = agent.createNewPrismDID() assertEquals(newDID, validDID) - assertEquals(newDID, plutoMock.storedPrismDID.first()) - assertTrue { plutoMock.wasGetPrismLastKeyPathIndexCalled } - assertTrue { plutoMock.wasStorePrismDIDAndPrivateKeysCalled } + assertEquals(newDID, plutoMockOld.storedPrismDID.first()) + assertTrue { plutoMockOld.wasGetPrismLastKeyPathIndexCalled } + assertTrue { plutoMockOld.wasStorePrismDIDAndPrivateKeysCalled } } @Test fun testCreateNewPeerDID_shouldCreateNewDID_whenCalled() = runTest { - val validDID = DID("did", "test", "123") - castorMock.createPeerDIDReturn = validDID - val agent = EdgeAgent( - apolloMock, - castorMock, - plutoMock, - mercuryMock, - polluxMock, - connectionManager, - null, - null, - logger = PrismLoggerMock(), - agentOptions = AgentOptions() + val agent = spy( + EdgeAgent( + apolloMock, + castorMock, + plutoMock, + mercuryMockOld, + polluxMock, + connectionManagerMock, + seed, + null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) ) + val did = DID("did:peer:asdf") + `when`(castorMock.createPeerDID(any(), any())).thenReturn(did) + `when`(castorMock.resolveDID(any())).thenReturn(DIDDocument(did, emptyArray())) val newDID = agent.createNewPeerDID(services = emptyArray(), updateMediator = false) - assertEquals(newDID, validDID) - assertEquals(newDID, plutoMock.storedPeerDID.first()) - assertTrue { plutoMock.wasStorePeerDIDAndPrivateKeysCalled } + assertEquals(did, newDID) } @Test @@ -162,10 +388,10 @@ class EdgeAgentTests { val agent = EdgeAgent( apollo, castor, - plutoMock, - mercuryMock, - polluxMock, - connectionManager, + plutoMockOld, + mercuryMockOld, + polluxMockOld, + connectionManagerOld, null, null, logger = PrismLoggerMock(), @@ -196,12 +422,12 @@ class EdgeAgentTests { fun testPrismAgentOnboardingInvitation_shouldAcceptOnboardingInvitation_whenStatusIs200() = runTest { val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), logger = PrismLoggerMock() @@ -223,12 +449,12 @@ class EdgeAgentTests { runTest { val api = ApiMock(HttpStatusCode.BadRequest, "{\"success\":\"true\"}") val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = api, logger = PrismLoggerMock() @@ -250,12 +476,12 @@ class EdgeAgentTests { fun testPrismAgentOnboardingInvitation_shouldRejectOnboardingInvitation_whenBodyIsWrong() = runTest { val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), logger = PrismLoggerMock() @@ -276,45 +502,38 @@ class EdgeAgentTests { fun testPrismAgentSignWith_whenNoPrivateKeyAvailable_thenThrowCannotFindDIDPrivateKey() = runTest { val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = null, logger = PrismLoggerMock() ) - plutoMock.getDIDPrivateKeysReturn = flow { emit(listOf(null)) } + plutoMockOld.getDIDPrivateKeysReturn = flow { emit(listOf(null)) } val did = DID("did", "peer", "asdf1234asdf1234") val messageString = "This is a message" - assertFalse { plutoMock.wasGetDIDPrivateKeysByDIDCalled } + assertFalse { plutoMockOld.wasGetDIDPrivateKeysByDIDCalled } assertFailsWith(EdgeAgentError.CannotFindDIDPrivateKey::class, null) { agent.signWith(did, messageString.toByteArray()) } } @Test - fun testPrismAgentSignWith_whenPrivateKeyAvailable_thenSignatureReturned() = runTest { + fun testPrismAgentSignWith_whenSecp256k1PrivateKey_thenSignatureReturned() = runTest { val apolloMock = mock() val plutoMock = mock() - val mnemonics = MnemonicHelper.createRandomMnemonics().toTypedArray() - val seed = Seed( - value = MnemonicHelper.createSeed( - mnemonics = mnemonics.asList(), - passphrase = "" - ) - ) val agent = EdgeAgent( apollo = apolloMock, castor = castorMock, pluto = plutoMock, - mercury = mercuryMock, + mercury = mercuryMockOld, pollux = polluxMock, - connectionManager = connectionManager, + connectionManager = connectionManagerMock, seed = seed, api = null, logger = PrismLoggerMock(), @@ -322,7 +541,7 @@ class EdgeAgentTests { ) val privateKey = Secp256k1KeyPair.generateKeyPair( - seed = Seed(MnemonicHelper.createRandomSeed()), + seed = seed, curve = KeyCurve(Curve.SECP256K1) ).privateKey val storablePrivateKeys = listOf( @@ -345,14 +564,87 @@ class EdgeAgentTests { } @Test - fun testParseInvitation_whenOutOfBand_thenReturnsOutOfBandInvitationObject() = runTest { + fun testPrismAgentSignWith_whenEd25519PrivateKey_thenSignatureReturned() = runTest { val agent = EdgeAgent( apollo = apolloMock, castor = castorMock, pluto = plutoMock, - mercury = mercuryMock, + mercury = mercuryMockOld, + pollux = polluxMock, + connectionManager = connectionManagerMock, + seed = seed, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + + val privateKey: Ed25519PrivateKey = Ed25519KeyPair.generateKeyPair().privateKey as Ed25519PrivateKey + + val storablePrivateKeys = listOf( + StorablePrivateKey( + id = UUID.randomUUID().toString(), + restorationIdentifier = "ed25519+priv", + data = privateKey.raw.base64UrlEncoded, + keyPathIndex = 0 + ) + ) + `when`(plutoMock.getDIDPrivateKeysByDID(any())).thenReturn(flow { emit(storablePrivateKeys) }) + `when`(apolloMock.restorePrivateKey(storablePrivateKeys.first())).thenReturn(privateKey) + + val did = DID("did", "peer", "asdf1234asdf1234") + val message = "This is a message".toByteArray() + + val expectedSignature = Signature(privateKey.sign(message)) + + val signature = agent.signWith(did, message) + assertEquals(expectedSignature, signature) + } + + @Test + fun testPrismAgentSignWith_whenPrivateKeyCurveNotSupported_thenThrowInvalidSpecificKeyCurve() = runTest { + val agent = EdgeAgent( + apollo = apolloMock, + castor = castorMock, + pluto = plutoMock, + mercury = mercuryMockOld, pollux = polluxMock, - connectionManager = connectionManager, + connectionManager = connectionManagerMock, + seed = seed, + api = null, + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + + val privateKey = X25519KeyPair.generateKeyPair().privateKey + + val storablePrivateKeys = listOf( + StorablePrivateKey( + id = UUID.randomUUID().toString(), + restorationIdentifier = "x25519+priv", + data = privateKey.raw.base64UrlEncoded, + keyPathIndex = 0 + ) + ) + `when`(plutoMock.getDIDPrivateKeysByDID(any())).thenReturn(flow { emit(storablePrivateKeys) }) + `when`(apolloMock.restorePrivateKey(storablePrivateKeys.first())).thenReturn(privateKey) + + val did = DID("did", "peer", "asdf1234asdf1234") + val message = "This is a message".toByteArray() + + assertFailsWith(ApolloError.InvalidSpecificKeyCurve::class) { + agent.signWith(did, message) + } + } + + @Test + fun testParseInvitation_whenOutOfBand_thenReturnsOutOfBandInvitationObject() = runTest { + val agent = EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = null, logger = PrismLoggerMock(), @@ -394,12 +686,12 @@ class EdgeAgentTests { fun testParseInvitation_whenOutOfBandWrongBody_thenThrowsUnknownInvitationTypeError() = runTest { val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = null, logger = PrismLoggerMock() @@ -422,14 +714,14 @@ class EdgeAgentTests { @Test fun testStartPrismAgent_whenCalled_thenStatusIsRunning() = runTest { val getLinkSecretReturn = flow { emit("linkSecret") } - plutoMock.getLinkSecretReturn = getLinkSecretReturn + plutoMockOld.getLinkSecretReturn = getLinkSecretReturn val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = null, logger = PrismLoggerMock(), @@ -443,12 +735,12 @@ class EdgeAgentTests { @Test fun testStopPrismAgent_whenCalled_thenStatusIsStopped() = runTest { val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = null, logger = PrismLoggerMock(), @@ -463,12 +755,12 @@ class EdgeAgentTests { val oob = "https://my.domain.com/path?_oob=eyJpZCI6ImQzNjM3NzlhLWYyMmItNGFiNC1hYjY0LTkxZjkxNjgzNzYwNyIsInR5cGUiOiJodHRwczovL2RpZGNvbW0ub3JnL291dC1vZi1iYW5kLzIuMC9pbnZpdGF0aW9uIiwiZnJvbSI6ImRpZDpwZWVyOjIuRXo2TFNjcGZReGJ2VEhLaGpvbzVvMzlmc254VEp1RTRobVp3ckROUE5BVzI0dmFORi5WejZNa3UzSkpVTDNkaHpYQXB0RWpuUDFpNkF0TDlTNGlwRTNYOHM3MWV4MW9WVGNHLlNleUowSWpvaVpHMGlMQ0p6SWpvaWFIUjBjSE02THk5ck9ITXRaR1YyTG1GMFlXeGhjSEpwYzIwdWFXOHZjSEpwYzIwdFlXZGxiblF2Wkdsa1kyOXRiU0lzSW5JaU9sdGRMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDAiLCJib2R5Ijp7ImdvYWxfY29kZSI6ImlvLmF0YWxhcHJpc20uY29ubmVjdCIsImdvYWwiOiJFc3RhYmxpc2ggYSB0cnVzdCBjb25uZWN0aW9uIGJldHdlZW4gdHdvIHBlZXJzIHVzaW5nIHRoZSBwcm90b2NvbCAnaHR0cHM6Ly9hdGFsYXByaXNtLmlvL21lcmN1cnkvY29ubmVjdGlvbnMvMS4wL3JlcXVlc3QnIiwiYWNjZXB0IjpbXX19" val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManager, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, + pollux = polluxMockOld, + connectionManager = connectionManagerOld, seed = null, api = null, logger = PrismLoggerMock(), @@ -479,67 +771,149 @@ class EdgeAgentTests { assert((x as OutOfBandInvitation).type == ProtocolType.Didcomminvitation) } - @AndroidIgnore - @Test - fun testAnoncreds_whenOfferReceived_thenProcessed() = runTest { - val fromDID = DID("did:prism:asdf42sf") - val toDID = DID("did:prism:asdf42sf") - - val apiMock: Api = ApiMock( - HttpStatusCode(200, "Ok"), - getCredentialDefinitionResponse - ) - val pollux = PolluxImpl(apolloMock, castorMock, apiMock) - plutoMock.getLinkSecretReturn = flow { emit(LinkSecret().getValue()) } + // Commented out as it should be moved to instrumentation tests to be albe to test the anoncreds-rs library +// @AndroidIgnore +// @Test +// fun testPrepareRequestCredentialWithIssuer_whenAnoncredOfferCredential_thenProcessed() = runTest { +// val apiMock: Api = ApiMock( +// HttpStatusCode(200, "Ok"), +// getCredentialDefinitionResponse +// ) +// val pollux = PolluxImpl(apolloMockOld, castorMockOld, apiMock) +// plutoMockOld.getLinkSecretReturn = flow { emit(LinkSecret().getValue()) } +// +// val agent = EdgeAgent( +// apollo = apolloMockOld, +// castor = castorMockOld, +// pluto = plutoMockOld, +// mercury = mercuryMock, +// pollux = pollux, +// connectionManager = connectionManagerOld, +// seed = null, +// api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), +// logger = PrismLoggerMock(), +// agentOptions = AgentOptions() +// ) +// +// val message = Json.decodeFromString( +// """{"id":"e430e4af-455e-4a15-9f2f-5bd8e5f350b8","piuri":"https://didcomm.org/issue-credential/3.0/offer-credential","from":{"method":"peer","methodId":"2.Ez6LSm5hETc4CS4X8RxYYKjoS2B3CM8TyzbgRrE7kGrdymHdq.Vz6MkoP2VXs4N7iNsKTzEKtZbnfu6yDH1x2ajGtCmNmc6qdMW.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"},"to":{"method":"peer","methodId":"2.Ez6LSd8irQSWjjMfvg53kcaDY6Q2doPEvQwscjSzidgWoFUVK.Vz6Mksu4QVe8oKwJEDPgxRg2bFa3QWrZR1EZGC9xq8xk9twYX.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"},"fromPrior":"null","body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":\"http:\\/\\/192.168.68.113:8000\\/cloud-agent\\/schema-registry\\/schemas\\/5667190d-640c-36af-a9f1-f4ed2587e766\\/schema\",\"type\":\"https:\\/\\/didcomm.org\\/issue-credential\\/3.0\\/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"age\",\"value\":\"18\"},{\"media_type\":null,\"name\":\"name\",\"value\":\"Cristian\"}]}},\"replacement_id\":null,\"comment\":null}","created_time":"1721242264","expires_time_plus":"1721328667","attachments":[{"id":"ee903fe0-2c49-4356-9b41-cfccc979c0a1","data":{"base64":"eyJzY2hlbWFfaWQiOiJodHRwOi8vMTkyLjE2OC42OC4xMTM6ODAwMC9jbG91ZC1hZ2VudC9zY2hlbWEtcmVnaXN0cnkvc2NoZW1hcy81NjY3MTkwZC02NDBjLTM2YWYtYTlmMS1mNGVkMjU4N2U3NjYvc2NoZW1hIiwiY3JlZF9kZWZfaWQiOiJodHRwOi8vMTkyLjE2OC42OC4xMTM6ODAw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jZSI6IjM2MDY2NjE3NzQwNTA3NzY5NTI5NTMxNyJ9"},"format":"anoncreds/credential-offer@v1.0"}],"thid":"3a1c143b-7ab7-470d-99cf-bc5f31771388","ack":[]}""" +// ) +// val offerCredential = OfferCredential.fromMessage(message) +// val subjectDid = +// DID("did:prism:6f23ddace519b68dfc0fa06e992db40f2f3c584af382ce446fa2fd0e042e5dea:CoUBCoIBEjsKB21hc3RlcjAQAUouCglzZWNwMjU2azESIQMcKwEitGbQKtGa-jFXi3m1u7OP2JMukYXQnZk3fQIXvxJDCg9hdXRoZW50aWNhdGlvbjAQBEouCglzZWNwMjU2azESIQMcKwEitGbQKtGa-jFXi3m1u7OP2JMukYXQnZk3fQIXvw") +// +// val requestCredential = +// agent.prepareRequestCredentialWithIssuer(did = subjectDid, offer = offerCredential) +// +// assertEquals(offerCredential.from, requestCredential.to) +// assertEquals(offerCredential.to, requestCredential.from) +// assertTrue(requestCredential.attachments.size == 1) +// assertEquals(requestCredential.attachments[0].format, CredentialType.ANONCREDS_REQUEST.type) +// assertEquals(offerCredential.thid, requestCredential.thid) +// } + @Test + fun testPrepareRequestCredentialWithIssuer_whenJwtOfferCredential_thenProcessed() = runTest { + val seed = + Seed("Rb8j6NVmA120auCQT6tP35rZ6-hgHvhcZCYmKmU1Avc4b5Tc7XoPeDdSWZYjLXuHn4w0f--Ulm1WkU1tLzwUEA".base64UrlDecodedBytes) val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, + apollo = apolloMockOld, + castor = castorMockOld, pluto = plutoMock, - mercury = mercuryMock, - pollux = pollux, - connectionManager = connectionManager, - seed = null, + mercury = mercuryMockOld, + pollux = polluxMock, + connectionManager = connectionManagerOld, + seed = seed, api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), logger = PrismLoggerMock(), agentOptions = AgentOptions() ) - val attachmentDescriptor = - AttachmentDescriptor( - mediaType = "application/json", - format = CredentialType.ANONCREDS_OFFER.type, - data = AttachmentBase64( - "eyJzY2hlbWF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k4OTE4NjA2NTc4MjM0ODc5OTg1NjcxIl1dfSwibm9uY2UiOiIxMTE2NzA0MDg4NDcyOTA3NTIzNjkwNDkwIn0=" - ) - ) + `when`(plutoMock.getPrismDIDKeyPathIndex(any())).thenReturn(flow { emit(2) }) - val offerCredential = OfferCredential( - body = OfferCredential.Body( - credentialPreview = CredentialPreview( - attributes = arrayOf( - CredentialPreview.Attribute( - name = "Name", - value = "Value", - mediaType = "application/json" - ) - ) - ) - ), - attachments = arrayOf(attachmentDescriptor), - thid = "1", - from = fromDID, - to = toDID + `when`(polluxMock.extractCredentialFormatFromMessage(any())).thenReturn(CredentialType.JWT) + + val jwtString = + """eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MGE0YjU1MjE2OWUzMTU4NzgxNzQxZmJiZWZmZTgxMjEyNzg0ZDMyZDkwY2Y4ZjI2MjI5MjNmMTFmNmVjZDk2NjpDb1VCQ29JQkVqc0tCMjFoYzNSbGNqQVFBVW91Q2dselpXTndNalUyYXpFU0lRTGd6aHN1T3FoQXlJbXktYzhvOVptSUo0aVlfR2M4dHZOSVQzbDF3NThmMkJKRENnOWhkWFJvWlc1MGFXTmhkR2x2YmpBUUJFb3VDZ2x6WldOd01qVTJhekVTSVFMZ3poc3VPcWhBeUlteS1jOG85Wm1JSjRpWV9HYzh0dk5JVDNsMXc1OGYyQSIsImF1ZCI6ImRvbWFpbiIsInZwIjp7IkBjb250ZXh0IjpbImh0dHBzOlwvXC93d3cudzMub3JnXC8yMDE4XC9jcmVkZW50aWFsc1wvdjEiXSwidHlwZSI6WyJWZXJpZmlhYmxlUHJlc2VudGF0aW9uIl19LCJub25jZSI6ImVhNzBmMzIwLTgwYjYtNGE5My1iMjkzLTJmNjE2NWRmNmRlYyJ9.iAQ3iwiz9-0fCO28TPGUG0y8y1xN9mgTYPTud8sL_p8Qrz8MwtS2NCvl_CR-vCnh1jzi5AJIo99AbFkGYkZ6XQ""" + `when`(polluxMock.processCredentialRequestJWT(any(), any(), any())).thenReturn(jwtString) + + val message = Json.decodeFromString( + """{"id":"a77e5336-f4bb-4ccb-ae6f-2929ed53bbc3","piuri":"https://didcomm.org/issue-credential/3.0/offer-credential","from":{"method":"peer","methodId":"2.Ez6LSm5hETc4CS4X8RxYYKjoS2B3CM8TyzbgRrE7kGrdymHdq.Vz6MkoP2VXs4N7iNsKTzEKtZbnfu6yDH1x2ajGtCmNmc6qdMW.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"},"to":{"method":"peer","methodId":"2.Ez6LSd8irQSWjjMfvg53kcaDY6Q2doPEvQwscjSzidgWoFUVK.Vz6Mksu4QVe8oKwJEDPgxRg2bFa3QWrZR1EZGC9xq8xk9twYX.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"},"fromPrior":"null","body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":null,\"type\":\"https:\\/\\/didcomm.org\\/issue-credential\\/3.0\\/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"familyName\",\"value\":\"demo\"},{\"media_type\":null,\"name\":\"drivingClass\",\"value\":\"1\"},{\"media_type\":null,\"name\":\"dateOfIssuance\",\"value\":\"01\\/01\\/2024\"},{\"media_type\":null,\"name\":\"emailAddress\",\"value\":\"demo@email.com\"},{\"media_type\":null,\"name\":\"drivingLicenseID\",\"value\":\"A1221332\"}]}},\"replacement_id\":null,\"comment\":null}","created_time":"1721242627","expires_time_plus":"1721329026","attachments":[{"id":"d2c693e7-c217-46e5-92ba-6a0880a89416","data":{"data":"{\"options\":{\"domain\":\"domain\",\"challenge\":\"ea70f320-80b6-4a93-b293-2f6165df6dec\"},\"presentation_definition\":{\"purpose\":null,\"format\":{\"jwt\":{\"proof_type\":[],\"alg\":[\"ES256K\"]},\"ldp\":null},\"name\":null,\"input_descriptors\":[],\"id\":\"aa81d240-9d95-4f2c-bc94-09101c2081c0\"}}"},"format":"prism/jwt"}],"thid":"8b58db48-d243-45b8-a0f1-9862323b7e77","ack":[]}""" ) + val offerCredential = OfferCredential.fromMessage(message) + val subjectDID = DID("did:prism:asdf42sf") + val requestCredential = - agent.prepareRequestCredentialWithIssuer(did = toDID, offer = offerCredential) + agent.prepareRequestCredentialWithIssuer(did = subjectDID, offer = offerCredential) + assertEquals(offerCredential.from, requestCredential.to) assertEquals(offerCredential.to, requestCredential.from) assertTrue(requestCredential.attachments.size == 1) - assertEquals(requestCredential.attachments[0].format, CredentialType.ANONCREDS_REQUEST.type) + assertEquals(requestCredential.attachments[0].format, CredentialType.JWT.type) + assertTrue(requestCredential.attachments[0].data is AttachmentBase64) assertEquals(offerCredential.thid, requestCredential.thid) } + @Test + fun testPrepareRequestCredentialWithIssuer_whenDIDNotPrism_thenThrowException() = runTest { + val seed = + Seed("Rb8j6NVmA120auCQT6tP35rZ6-hgHvhcZCYmKmU1Avc4b5Tc7XoPeDdSWZYjLXuHn4w0f--Ulm1WkU1tLzwUEA".base64UrlDecodedBytes) + val agent = EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMock, + mercury = mercuryMockOld, + pollux = polluxMock, + connectionManager = connectionManagerOld, + seed = seed, + api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + + val message = Json.decodeFromString( + """{"id":"a77e5336-f4bb-4ccb-ae6f-2929ed53bbc3","piuri":"https://didcomm.org/issue-credential/3.0/offer-credential","from":{"method":"peer","methodId":"2.Ez6LSm5hETc4CS4X8RxYYKjoS2B3CM8TyzbgRrE7kGrdymHdq.Vz6MkoP2VXs4N7iNsKTzEKtZbnfu6yDH1x2ajGtCmNmc6qdMW.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"},"to":{"method":"peer","methodId":"2.Ez6LSd8irQSWjjMfvg53kcaDY6Q2doPEvQwscjSzidgWoFUVK.Vz6Mksu4QVe8oKwJEDPgxRg2bFa3QWrZR1EZGC9xq8xk9twYX.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"},"fromPrior":"null","body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":null,\"type\":\"https:\\/\\/didcomm.org\\/issue-credential\\/3.0\\/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"familyName\",\"value\":\"demo\"},{\"media_type\":null,\"name\":\"drivingClass\",\"value\":\"1\"},{\"media_type\":null,\"name\":\"dateOfIssuance\",\"value\":\"01\\/01\\/2024\"},{\"media_type\":null,\"name\":\"emailAddress\",\"value\":\"demo@email.com\"},{\"media_type\":null,\"name\":\"drivingLicenseID\",\"value\":\"A1221332\"}]}},\"replacement_id\":null,\"comment\":null}","created_time":"1721242627","expires_time_plus":"1721329026","attachments":[{"id":"d2c693e7-c217-46e5-92ba-6a0880a89416","data":{"data":"{\"options\":{\"domain\":\"domain\",\"challenge\":\"ea70f320-80b6-4a93-b293-2f6165df6dec\"},\"presentation_definition\":{\"purpose\":null,\"format\":{\"jwt\":{\"proof_type\":[],\"alg\":[\"ES256K\"]},\"ldp\":null},\"name\":null,\"input_descriptors\":[],\"id\":\"aa81d240-9d95-4f2c-bc94-09101c2081c0\"}}"},"format":"prism/jwt"}],"thid":"8b58db48-d243-45b8-a0f1-9862323b7e77","ack":[]}""" + ) + val offerCredential = OfferCredential.fromMessage(message) + val subjectDID = DID("did:peer:asdf42sf") + + assertFailsWith(PolluxError.InvalidPrismDID::class) { + agent.prepareRequestCredentialWithIssuer(did = subjectDID, offer = offerCredential) + } + } + + @Test + fun testPrepareRequestCredentialWithIssuer_whenCredentialTypeNotSupported_thenThrowException() = runTest { + val seed = + Seed("Rb8j6NVmA120auCQT6tP35rZ6-hgHvhcZCYmKmU1Avc4b5Tc7XoPeDdSWZYjLXuHn4w0f--Ulm1WkU1tLzwUEA".base64UrlDecodedBytes) + val agent = EdgeAgent( + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMock, + mercury = mercuryMockOld, + pollux = polluxMock, + connectionManager = connectionManagerOld, + seed = seed, + api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), + logger = PrismLoggerMock(), + agentOptions = AgentOptions() + ) + + `when`(plutoMock.getPrismDIDKeyPathIndex(any())).thenReturn(flow { emit(2) }) + + `when`(polluxMock.extractCredentialFormatFromMessage(any())).thenReturn(CredentialType.PRESENTATION_EXCHANGE_SUBMISSION) + + val message = Json.decodeFromString( + """{"id":"a77e5336-f4bb-4ccb-ae6f-2929ed53bbc3","piuri":"https://didcomm.org/issue-credential/3.0/offer-credential","from":{"method":"peer","methodId":"2.Ez6LSm5hETc4CS4X8RxYYKjoS2B3CM8TyzbgRrE7kGrdymHdq.Vz6MkoP2VXs4N7iNsKTzEKtZbnfu6yDH1x2ajGtCmNmc6qdMW.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"},"to":{"method":"peer","methodId":"2.Ez6LSd8irQSWjjMfvg53kcaDY6Q2doPEvQwscjSzidgWoFUVK.Vz6Mksu4QVe8oKwJEDPgxRg2bFa3QWrZR1EZGC9xq8xk9twYX.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"},"fromPrior":"null","body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":null,\"type\":\"https:\\/\\/didcomm.org\\/issue-credential\\/3.0\\/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"familyName\",\"value\":\"demo\"},{\"media_type\":null,\"name\":\"drivingClass\",\"value\":\"1\"},{\"media_type\":null,\"name\":\"dateOfIssuance\",\"value\":\"01\\/01\\/2024\"},{\"media_type\":null,\"name\":\"emailAddress\",\"value\":\"demo@email.com\"},{\"media_type\":null,\"name\":\"drivingLicenseID\",\"value\":\"A1221332\"}]}},\"replacement_id\":null,\"comment\":null}","created_time":"1721242627","expires_time_plus":"1721329026","attachments":[{"id":"d2c693e7-c217-46e5-92ba-6a0880a89416","data":{"data":"{\"options\":{\"domain\":\"domain\",\"challenge\":\"ea70f320-80b6-4a93-b293-2f6165df6dec\"},\"presentation_definition\":{\"purpose\":null,\"format\":{\"jwt\":{\"proof_type\":[],\"alg\":[\"ES256K\"]},\"ldp\":null},\"name\":null,\"input_descriptors\":[],\"id\":\"aa81d240-9d95-4f2c-bc94-09101c2081c0\"}}"},"format":"prism/jwt"}],"thid":"8b58db48-d243-45b8-a0f1-9862323b7e77","ack":[]}""" + ) + val offerCredential = OfferCredential.fromMessage(message) + val subjectDID = DID("did:prism:asdf42sf") + + assertFailsWith(EdgeAgentError.InvalidCredentialError::class) { + agent.prepareRequestCredentialWithIssuer(did = subjectDID, offer = offerCredential) + } + } + @AndroidIgnore @Test fun testAnoncreds_whenCredentialIssued_thenProcessed() = runTest { @@ -550,21 +924,21 @@ class EdgeAgentTests { HttpStatusCode(200, "Ok"), getCredentialDefinitionResponse ) - val pollux = PolluxImpl(apolloMock, castorMock, apiMock) - plutoMock.getLinkSecretReturn = flow { emit(LinkSecret().getValue()) } + val pollux = PolluxImpl(apolloMockOld, castorMockOld, apiMock) + plutoMockOld.getLinkSecretReturn = flow { emit(LinkSecret().getValue()) } val meta = CredentialRequestMeta( linkSecretName = "1", json = "{\"link_secret_blinding_data\":{\"v_prime\":\"1234\",\"vr_prime\":\"1234\"},\"nonce\":\"411729288962137159046778\",\"link_secret_name\":\"link:secret:id\"}" ) - plutoMock.getCredentialMetadataReturn = flow { emit(meta) } + plutoMockOld.getCredentialMetadataReturn = flow { emit(meta) } val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, + apollo = apolloMockOld, + castor = castorMockOld, + pluto = plutoMockOld, + mercury = mercuryMockOld, pollux = pollux, - connectionManager = connectionManager, + connectionManager = connectionManagerOld, seed = null, api = ApiMock(HttpStatusCode.OK, "{\"success\":\"true\"}"), logger = PrismLoggerMock(), @@ -621,7 +995,6 @@ class EdgeAgentTests { val mercuryMock = mock() val polluxMock = mock() val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) val mediatorHandlerMock = mock() `when`(connectionManagerMock.mediationHandler).thenReturn(mediatorHandlerMock) @@ -678,7 +1051,7 @@ class EdgeAgentTests { `when`(castorMock.createPeerDID(any(), any())).thenReturn(DID(newPeerDid)) val definitionJson = - "{\"presentation_definition\":{\"id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"input_descriptors\":[{\"id\":\"wa_driver_license\",\"name\":\"Washington State Business License\",\"purpose\":\"We can only allow licensed Washington State business representatives into the WA Business Conference\",\"constraints\":{\"fields\":[{\"path\":[\"\$.credentialSubject.dateOfBirth\",\"\$.credentialSubject.dob\",\"\$.vc.credentialSubject.dateOfBirth\",\"\$.vc.credentialSubject.dob\"]}]}}],\"format\":{\"jwt\":{\"alg\":[\"ES256K\"]}}},\"options\":{\"domain\":\"domain\",\"challenge\":\"challenge\"}}" + "{\"presentation_definition\":{\"id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"input_descriptors\":[{\"id\":\"wa_driver_license\",\"name\":\"Washington State Business License\",\"purpose\":\"We can only allow licensed Washington State business representatives into the WA Business Conference\",\"constraints\":{\"fields\":[{\"path\":[\"$.credentialSubject.dateOfBirth\",\"$.credentialSubject.dob\",\"$.vc.credentialSubject.dateOfBirth\",\"$.vc.credentialSubject.dob\"]}]}}],\"format\":{\"jwt\":{\"alg\":[\"ES256K\"]}}},\"options\":{\"domain\":\"domain\",\"challenge\":\"challenge\"}}" val presentationDefinitionRequest: PresentationDefinitionRequest = Json.decodeFromString(definitionJson) // Mock createPresentationDefinitionRequest @@ -722,7 +1095,6 @@ class EdgeAgentTests { val mercuryMock = mock() val polluxMock = mock() val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) val mediatorHandlerMock = mock() `when`(connectionManagerMock.mediationHandler).thenReturn(mediatorHandlerMock) @@ -780,7 +1152,6 @@ class EdgeAgentTests { val mercuryMock = mock() val polluxMock = mock() val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) val mediatorHandlerMock = mock() `when`(connectionManagerMock.mediationHandler).thenReturn(mediatorHandlerMock) @@ -817,6 +1188,32 @@ class EdgeAgentTests { } } + @Test + fun testHandlePresentation_whenWrongPresentationSubmission_thenThrowMissingOrNullFieldError() = + runTest { + val apiMock = mock() + `when`(apiMock.request(any(), any(), any(), any(), any())) + .thenReturn(HttpResponse(200, "Ok")) + + val agent = EdgeAgent( + apollo = apolloMock, + castor = castorMock, + pluto = plutoMock, + mercury = mercuryMockOld, + pollux = polluxMock, + connectionManager = connectionManagerMock, + seed = seed, + api = apiMock, + logger = PrismLoggerMock() + ) + val msg = Json.decodeFromString( + "{\"id\":\"00000000-685c-4004-0000-000036ac64ee\",\"piuri\":\"https://didcomm.atalaprism.io/present-proof/3.0/presentation\",\"from\":{\"method\":\"peer\",\"methodId\":\"asdfasdf\"},\"to\":{\"method\":\"peer\",\"methodId\":\"fdsafdsa\"},\"fromPrior\":null,\"body\":\"{}\",\"createdTime\":\"2024-03-08T19:27:38.196506Z\",\"expiresTimePlus\":\"2024-03-09T19:27:38.196559Z\",\"attachments\":[{\"id\":\"00000000-9c2e-4249-0000-0000c1176949\",\"mediaType\":\"application/json\",\"data\":{\"type\":\"org.hyperledger.identus.walletsdk.domain.models.AttachmentBase64\",\"base64\":\"eyJ2ZXJpZmlhYmxlUHJlc2VudGF0aW9uIjpbImV5SmhiR2NpT2lKRlV6STFOa3NpZlEuZXlKcGMzTWlPaUprYVdRNmNISnBjMjA2TWpVM01UbGhPVFppTVRVeE1qQTNNVFk1T0RGaE9EUXpNR0ZrTUdOaU9UWTRaR1ExTXpRd056TTFPVE5qT0dOa00yWXhaREkzWVRZNE1EUmxZelV3WlRwRGNHOURRM0JqUTBWc2IwdENWM1JzWlZNd2VFVkJTa05VZDI5S1l6SldhbU5FU1RGT2JYTjRSV2xCUlc5VFEyNDFkSGxFWVRaWk5uSXRTVzFUY1hCS09Ga3hiV28zU2tNelgyOVZla1V3VG5sNVJXbERRbTluYzJkT1lXVlNaR05EVWtkUWJHVTRNbFoyT1hSS1prNTNiRFp5WnpaV1kyaFNNMDl4YUdsV1lsUmhPRk5YZDI5SFdWaFdNR0ZETUhoRlFWSkRWSGR2U21NeVZtcGpSRWt4VG0xemVFVnBSRTFyUW1RMlJuUnBiMHByTTFoUFJuVXRYMk41TlZodFVpMDBkRlZSTWs1TVIybFhPR0ZKVTI5dGExSnZaelpUWkdVNVVIZHVSekJSTUZOQ1ZHMUdVMVJFWWxOTFFuWkpWalpEVkV4WWNtcEpTblIwWlVkSmJVRlRXRUZ2U0dKWFJucGtSMVo1VFVKQlFsRnJPRXREV0U1c1dUTkJlVTVVV25KTlVrbG5UemN4TUcxME1WZGZhWGhFZVZGTk0zaEpjemRVY0dwTVEwNVBSRkY0WjFab2VEVnphR1pMVGxneGIyRkpTRmRRY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NMEY1VGxSYWNrMVNTV2RsVTJjdE1rOVBNVXBrYm5CNlZVOUNhWFI2U1dsaldHUm1lbVZCWTFSbVYwRk9MVmxEWlhWRFlubEpZVWxLVVRSSFZFa3pNSFJoVm1sM1kyaFVNMlV3Ymt4WVFsTTBNMEkwYWpscWJITnNTMjh5V214a1dIcHFSV3gzUzBJeU1XaGpNMUpzWTJwQlVVRlZTbEJEWjJ4NldsZE9kMDFxVlRKaGVrVlRTVWhyYjFCMGFtcDBVMWhhTm1NeFJHZFpjbU41U1c1R00xZzRNMmRJUlRNeFowUm1iVUZ1Y21kdE9HbEhhVU5WVDBKcmVVNDVURmRzV1hOSVNWVTVNM1JLZVRGM1ZYVk9kMlZKWDFrMVlrcFRjVTV0V2xoV09EUjNJbjBzSW5SNWNHVWlPbHNpVm1WeWFXWnBZV0pzWlVOeVpXUmxiblJwWVd3aVhTd2lRR052Ym5SbGVIUWlPbHNpYUhSMGNITTZYQzljTDNkM2R5NTNNeTV2Y21kY0x6SXdNVGhjTDJOeVpXUmxiblJwWVd4elhDOTJNU0pkZlgwLngwU0YxN1kwVkNEbXQ3SGNlT2RUeGZIbG9mc1ptWTE4Um42VlFiMC1yLWtfQm0zaFRpMS1rMnZrZGpCMjVoZHh5VEN2eGFtLUFrQVAtQWczQWhuNU5nIl19\"},\"format\":\"dif/presentation-exchange/definitions@v1.0\"}],\"thid\":\"00000000-ef9d-4722-0000-00003b1bc908\",\"ack\":[]}" + ) + assertFailsWith(EdgeAgentError.MissingOrNullFieldError::class) { + agent.handlePresentation(msg) + } + } + @Test fun testHandlePresentationDefinitionRequest_whenAllCorrect_thenSendPresentationSubmissionCorrectly() = runTest { @@ -830,10 +1227,9 @@ class EdgeAgentTests { val mercuryMock = mock() val polluxMock = mock() val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) val privateKey = Secp256k1KeyPair.generateKeyPair( - seed = Seed(MnemonicHelper.createRandomSeed()), + seed = seed, curve = KeyCurve(Curve.SECP256K1) ).privateKey val storablePrivateKeys = listOf( @@ -849,7 +1245,7 @@ class EdgeAgentTests { `when`(apolloMock.restorePrivateKey(storablePrivateKeys.first())).thenReturn(privateKey) val presentationSubmissionString = - "{\"presentation_submission\":{\"id\":\"00000000-c224-45d7-0000-0000732f4932\",\"definition_id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"descriptor_map\":[{\"id\":\"wa_driver_license\",\"format\":\"jwt\",\"path\":\"\$.verifiablePresentation[0]\"}]},\"verifiablePresentation\":[\"eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MjU3MTlhOTZiMTUxMjA3MTY5ODFhODQzMGFkMGNiOTY4ZGQ1MzQwNzM1OTNjOGNkM2YxZDI3YTY4MDRlYzUwZTpDcG9DQ3BjQ0Vsb0tCV3RsZVMweEVBSkNUd29KYzJWamNESTFObXN4RWlBRW9TQ241dHlEYTZZNnItSW1TcXBKOFkxbWo3SkMzX29VekUwTnl5RWlDQm9nc2dOYWVSZGNDUkdQbGU4MlZ2OXRKZk53bDZyZzZWY2hSM09xaGlWYlRhOFNXd29HWVhWMGFDMHhFQVJDVHdvSmMyVmpjREkxTm1zeEVpRE1rQmQ2RnRpb0prM1hPRnUtX2N5NVhtUi00dFVRMk5MR2lXOGFJU29ta1JvZzZTZGU5UHduRzBRMFNCVG1GU1REYlNLQnZJVjZDVExYcmpJSnR0ZUdJbUFTWEFvSGJXRnpkR1Z5TUJBQlFrOEtDWE5sWTNBeU5UWnJNUklnTzcxMG10MVdfaXhEeVFNM3hJczdUcGpMQ05PRFF4Z1ZoeDVzaGZLTlgxb2FJSFdQcnc3SVVLbGZpYlF0eDZKazRUU2pnY1dOT2ZjT3RVOUQ5UHVaN1Q5dCIsInN1YiI6ImRpZDpwcmlzbTpiZWVhNTIzNGFmNDY4MDQ3MTRkOGVhOGVjNzdiNjZjYzdmM2U4MTVjNjhhYmI0NzVmMjU0Y2Y5YzMwNjI2NzYzOkNzY0JDc1FCRW1RS0Q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SF17Y0VCDmt7HceOdTxfHlofsZmY18Rn6VQb0-r-k_Bm3hTi1-k2vkdjB25hdxyTCvxam-AkAP-Ag3Ahn5Ng\"]}" + "{\"presentation_submission\":{\"id\":\"00000000-c224-45d7-0000-0000732f4932\",\"definition_id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"descriptor_map\":[{\"id\":\"wa_driver_license\",\"format\":\"jwt\",\"path\":\"$.verifiablePresentation[0]\"}]},\"verifiablePresentation\":[\"eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MjU3MTlhOTZiMTUxMjA3MTY5ODFhODQzMGFkMGNiOTY4ZGQ1MzQwNzM1OTNjOGNkM2YxZDI3YTY4MDRlYzUwZTpDcG9DQ3BjQ0Vsb0tCV3RsZVMweEVBSkNUd29KYzJWamNESTFObXN4RWlBRW9TQ241dHlEYTZZNnItSW1TcXBKOFkxbWo3SkMzX29VekUwTnl5RWlDQm9nc2dOYWVSZGNDUkdQbGU4MlZ2OXRKZk53bDZyZzZWY2hSM09xaGlWYlRhOFNXd29HWVhWMGFDMHhFQVJDVHdvSmMyVmpjREkxTm1zeEVpRE1rQmQ2RnRpb0prM1hPRnUtX2N5NVhtUi00dFVRMk5MR2lXOGFJU29ta1JvZzZTZGU5UHduRzBRMFNCVG1GU1REYlNLQnZJVjZDVExYcmpJSnR0ZUdJbUFTWEFvSGJXRnpkR1Z5TUJBQlFrOEtDWE5sWTNBeU5UWnJNUklnTzcxMG10MVdfaXhEeVFNM3hJczdUcGpMQ05PRFF4Z1ZoeDVzaGZLTlgxb2FJSFdQcnc3SVVLbGZpYlF0eDZKazRUU2pnY1dOT2ZjT3RVOUQ5UHVaN1Q5dCIsInN1YiI6ImRpZDpwcmlzbTpiZWVhNTIzNGFmNDY4MDQ3MTRkOGVhOGVjNzdiNjZjYzdmM2U4MTVjNjhhYmI0NzVmMjU0Y2Y5YzMwNjI2NzYzOkNzY0JDc1FCRW1RS0QyRjFkR2hsYm5ScFky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xfHlofsZmY18Rn6VQb0-r-k_Bm3hTi1-k2vkdjB25hdxyTCvxam-AkAP-Ag3Ahn5Ng\"]}" val presentationSubmission = Json.decodeFromString( presentationSubmissionString ) @@ -900,14 +1296,8 @@ class EdgeAgentTests { `when`(apiMock.request(any(), any(), any(), any(), any())) .thenReturn(HttpResponse(200, "Ok")) - val apolloMock = mock() - val castorMock = mock() - val plutoMock = mock() - val mercuryMock = mock() - val polluxMock = mock() val provableCredentialMock = mock() val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) val json = Json { ignoreUnknownKeys = true @@ -920,7 +1310,7 @@ class EdgeAgentTests { apollo = apolloMock, castor = castorMock, pluto = plutoMock, - mercury = mercuryMock, + mercury = mercuryMockOld, pollux = polluxMock, connectionManager = connectionManagerMock, seed = seed, @@ -957,93 +1347,91 @@ class EdgeAgentTests { } @Test - fun testHandlePresentationSubmission_whenAttachmentNotSupported_thenThrowsAttachmentTypeNotSupported() = - runTest { - val apiMock = mock() - `when`(apiMock.request(any(), any(), any(), any(), any())) - .thenReturn(HttpResponse(200, "Ok")) + fun testHandlePresentationSubmission_whenAttachmentNotSupported_thenThrowsAttachmentTypeNotSupported() = runTest { + val apiMock = mock() + `when`(apiMock.request(any(), any(), any(), any(), any())) + .thenReturn(HttpResponse(200, "Ok")) - val apolloMock = mock() - val castorMock = mock() - val plutoMock = mock() - val mercuryMock = mock() - val polluxMock = mock() - val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) + val apolloMock = mock() + val castorMock = mock() + val plutoMock = mock() + val mercuryMock = mock() + val polluxMock = mock() + val connectionManagerMock = mock() - val privateKey = - Secp256k1KeyPair.generateKeyPair( - seed = Seed(MnemonicHelper.createRandomSeed()), - curve = KeyCurve(Curve.SECP256K1) - ).privateKey - val storablePrivateKeys = listOf( - StorablePrivateKey( - id = UUID.randomUUID().toString(), - restorationIdentifier = "secp256k1+priv", - data = privateKey.raw.base64UrlEncoded, - keyPathIndex = 0 - ) + val privateKey = + Secp256k1KeyPair.generateKeyPair( + seed = seed, + curve = KeyCurve(Curve.SECP256K1) + ).privateKey + val storablePrivateKeys = listOf( + StorablePrivateKey( + id = UUID.randomUUID().toString(), + restorationIdentifier = "secp256k1+priv", + data = privateKey.raw.base64UrlEncoded, + keyPathIndex = 0 ) - // Mock getDIDPrivateKeysByDID response - `when`(plutoMock.getDIDPrivateKeysByDID(any())).thenReturn(flow { emit(storablePrivateKeys) }) - `when`(apolloMock.restorePrivateKey(storablePrivateKeys.first())).thenReturn(privateKey) + ) + // Mock getDIDPrivateKeysByDID response + `when`(plutoMock.getDIDPrivateKeysByDID(any())).thenReturn(flow { emit(storablePrivateKeys) }) + `when`(apolloMock.restorePrivateKey(storablePrivateKeys.first())).thenReturn(privateKey) - val presentationSubmission = Json.decodeFromString( - "{\"presentation_submission\":{\"id\":\"00000000-c224-45d7-0000-0000732f4932\",\"definition_id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"descriptor_map\":[{\"id\":\"wa_driver_license\",\"format\":\"jwt\",\"path\":\"\$.verifiablePresentation[0]\"}]},\"verifiablePresentation\":[\"eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MjU3MTlhOTZiMTUxMjA3MTY5ODFhODQzMGFkMGNiOTY4ZGQ1MzQwNzM1OTNjOGNkM2YxZDI3YTY4MDRlYzUwZTpDcG9DQ3BjQ0Vsb0tCV3RsZVMweEVBSkNUd29KYzJWamNESTFObXN4RWlBRW9TQ241dHlEYTZZNnItSW1TcXBKOFkxbWo3SkMzX29VekUwTnl5RWlDQm9nc2dOYWVSZGNDUkdQbGU4MlZ2OXRKZk53bDZyZzZWY2hSM09xaGlWYlRhOFNXd29HWVhWMGFDMHhFQVJDVHdvSmMyVmpjREkxTm1zeEVpRE1rQmQ2RnRpb0prM1hPRnUtX2N5NVhtUi00dFVRMk5MR2lXOGFJU29ta1JvZzZTZGU5UHduRzBRMFNCVG1GU1REYlNLQnZJVjZDV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M2UwbkxYQlM0M0I0ajlqbHNsS28yWmxkWHpqRWx3S0IyMWhjM1JsY2pBUUFVSlBDZ2x6WldOd01qVTJhekVTSUhrb1B0amp0U1haNmMxRGdZcmN5SW5GM1g4M2dIRTMxZ0RmbUFucmdtOGlHaUNVT0JreU45TFdsWXNISVU5M3RKeTF3VXVOd2VJX1k1YkpTcU5tWlhWODR3In0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiQGNvbnRleHQiOlsiaHR0cHM6XC9cL3d3dy53My5vcmdcLzIwMThcL2NyZWRlbnRpYWxzXC92MSJdfX0.x0SF17Y0VCDmt7HceOdTxfHlofsZmY18Rn6VQb0-r-k_Bm3hTi1-k2vkdjB25hdxyTCvxam-AkAP-Ag3Ahn5Ng\"]}" - ) - // Mock createPresentationSubmission response - `when`(polluxMock.createPresentationSubmission(any(), any(), any())).thenReturn( - presentationSubmission - ) + val presentationSubmission = Json.decodeFromString( + "{\"presentation_submission\":{\"id\":\"00000000-c224-45d7-0000-0000732f4932\",\"definition_id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"descriptor_map\":[{\"id\":\"wa_driver_license\",\"format\":\"jwt\",\"path\":\"$.verifiablePresentation[0]\"}]},\"verifiablePresentation\":[\"eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MjU3MTlhOTZiMTUxMjA3MTY5ODFhODQzMGFkMGNiOTY4ZGQ1MzQwNzM1OTNjOGNkM2YxZDI3YTY4MDRlYzUwZTpDcG9DQ3BjQ0Vsb0tCV3RsZVMweEVBSkNUd29KYzJWamNESTFObXN4RWlBRW9TQ241dHlEYTZZNnItSW1TcXBKOFkxbWo3SkMzX29VekUwTnl5RWlDQm9nc2dOYWVSZGNDUkdQbGU4MlZ2OXRKZk53bDZyZzZWY2hSM09xaGlWYlRhOFNXd29HWVhWMGFDMHhFQVJDVHdvSmMyVmpjREkxTm1zeEVpRE1rQmQ2RnRpb0prM1hPRnUtX2N5N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pkbnB6VU9CaXR6SWljWGRmemVBY1RmV0FOLVlDZXVDYnlJYUlKUTRHVEkzMHRhVml3Y2hUM2UwbkxYQlM0M0I0ajlqbHNsS28yWmxkWHpqRWx3S0IyMWhjM1JsY2pBUUFVSlBDZ2x6WldOd01qVTJhekVTSUhrb1B0amp0U1haNmMxRGdZcmN5SW5GM1g4M2dIRTMxZ0RmbUFucmdtOGlHaUNVT0JreU45TFdsWXNISVU5M3RKeTF3VXVOd2VJX1k1YkpTcU5tWlhWODR3In0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiXSwiQGNvbnRleHQiOlsiaHR0cHM6XC9cL3d3dy53My5vcmdcLzIwMThcL2NyZWRlbnRpYWxzXC92MSJdfX0.x0SF17Y0VCDmt7HceOdTxfHlofsZmY18Rn6VQb0-r-k_Bm3hTi1-k2vkdjB25hdxyTCvxam-AkAP-Ag3Ahn5Ng\"]}" + ) + // Mock createPresentationSubmission response + `when`(polluxMock.createPresentationSubmission(any(), any(), any())).thenReturn( + presentationSubmission + ) - val vmAuthentication = DIDDocument.VerificationMethod( - id = DIDUrl(DID("2", "1", "0")), - controller = DID("2", "2", "0"), - type = Curve.ED25519.value, - publicKeyJwk = mapOf("crv" to Curve.ED25519.value, "x" to "") - ) + val vmAuthentication = DIDDocument.VerificationMethod( + id = DIDUrl(DID("2", "1", "0")), + controller = DID("2", "2", "0"), + type = Curve.ED25519.value, + publicKeyJwk = mapOf("crv" to Curve.ED25519.value, "x" to "") + ) - val vmKeyAgreement = DIDDocument.VerificationMethod( - id = DIDUrl(DID("3", "1", "0")), - controller = DID("3", "2", "0"), - type = Curve.X25519.value, - publicKeyJwk = mapOf("crv" to Curve.X25519.value, "x" to "") - ) + val vmKeyAgreement = DIDDocument.VerificationMethod( + id = DIDUrl(DID("3", "1", "0")), + controller = DID("3", "2", "0"), + type = Curve.X25519.value, + publicKeyJwk = mapOf("crv" to Curve.X25519.value, "x" to "") + ) - val resolverMock = mock() - val didDoc = DIDDocument( - id = DID("did:prism:asdfasdf"), - coreProperties = arrayOf( - DIDDocument.Authentication( - urls = emptyArray(), - verificationMethods = arrayOf(vmAuthentication, vmKeyAgreement) - ) + val resolverMock = mock() + val didDoc = DIDDocument( + id = DID("did:prism:asdfasdf"), + coreProperties = arrayOf( + DIDDocument.Authentication( + urls = emptyArray(), + verificationMethods = arrayOf(vmAuthentication, vmKeyAgreement) ) ) - // Mock resolve did response - `when`(castorMock.resolveDID(any())).thenReturn(didDoc) - `when`(resolverMock.resolve(any())).thenReturn(didDoc) + ) + // Mock resolve did response + `when`(castorMock.resolveDID(any())).thenReturn(didDoc) + `when`(resolverMock.resolve(any())).thenReturn(didDoc) - val agent = EdgeAgent( - apollo = apolloMock, - castor = castorMock, - pluto = plutoMock, - mercury = mercuryMock, - pollux = polluxMock, - connectionManager = connectionManagerMock, - seed = seed, - api = apiMock, - logger = PrismLoggerMock() - ) + val agent = EdgeAgent( + apollo = apolloMock, + castor = castorMock, + pluto = plutoMock, + mercury = mercuryMock, + pollux = polluxMock, + connectionManager = connectionManagerMock, + seed = seed, + api = apiMock, + logger = PrismLoggerMock() + ) - val msgString = - "{\"id\":\"00000000-621a-4ae9-0000-00002ffb05bf\",\"piuri\":\"https://didcomm.atalaprism.io/present-proof/3.0/presentation\",\"from\":{\"method\":\"peer\",\"methodId\":\"fdsafdsa\"},\"to\":{\"method\":\"peer\",\"methodId\":\"asdfasdf\"},\"fromPrior\":null,\"body\":\"{}\",\"createdTime\":\"2024-03-18T17:11:58.053680Z\",\"expiresTimePlus\":\"2024-03-19T17:11:58.058523Z\",\"attachments\":[{\"id\":\"00000000-ef5f-40c0-0000-0000d2674b80\",\"mediaType\":\"application/json\",\"data\":{\"type\":\"org.hyperledger.identus.walletsdk.domain.models.AttachmentJsonData\",\"data\":\"eyJwcmVzZW50YXRpb25fc3VibWlzc2lvbiI6eyJpZCI6IjAwMDAwMDAwLWMyMjQtNDVkNy0wMDAwLTAwMDA3MzJmNDkzMiIsImRlZ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JiMUIwYW1wMFUxaGFObU14UkdkWmNtTjVTVzVHTTFnNE0yZElSVE14WjBSbWJVRnVjbWR0T0dsSGFVTlZUMEpyZVU0NVRGZHNXWE5JU1ZVNU0zUktlVEYzVlhWT2QyVkpYMWsxWWtwVGNVNXRXbGhXT0RSM0luMHNJblI1Y0dVaU9sc2lWbVZ5YVdacFlXSnNaVU55WldSbGJuUnBZV3dpWFN3aVFHTnZiblJsZUhRaU9sc2lhSFIwY0hNNlhDOWNMM2QzZHk1M015NXZjbWRjTHpJd01UaGNMMk55WldSbGJuUnBZV3h6WEM5Mk1TSmRmWDAueDBTRjE3WTBWQ0RtdDdIY2VPZFR4Zkhsb2ZzWm1ZMThSbjZWUWIwLXIta19CbTNoVGkxLWsydmtkakIyNWhkeHlUQ3Z4YW0tQWtBUC1BZzNBaG41TmciLCJjaGFsbGVuZ2UiOiIzMDQ1MDIyMTAwYjE0MTJjMGYzZmJiYzVjODc2ZGRlNjExNDFmYTY4N2Y3ZjJmYWJhODM0YWJjZTA5Yzg2YzcwNWEwYjkwMjAwNTAyMjA2YjY3MjUzZmE1ZjgwMzQ0YzQyZGQ4NGQyMzZiYmJiMTVkNTBhODliODE2ZmE1NWQ1YTZhNzQyY2NjODYwZTIzIn19\"},\"format\":\"prism/jwt\"}],\"thid\":\"00000000-ef9d-4722-0000-00003b1bc908\",\"ack\":[]}" - val msg = Json.decodeFromString(msgString) + val msgString = + "{\"id\":\"00000000-621a-4ae9-0000-00002ffb05bf\",\"piuri\":\"https://didcomm.atalaprism.io/present-proof/3.0/presentation\",\"from\":{\"method\":\"peer\",\"methodId\":\"fdsafdsa\"},\"to\":{\"method\":\"peer\",\"methodId\":\"asdfasdf\"},\"fromPrior\":null,\"body\":\"{}\",\"createdTime\":\"2024-03-18T17:11:58.053680Z\",\"expiresTimePlus\":\"2024-03-19T17:11:58.058523Z\",\"attachments\":[{\"id\":\"00000000-ef5f-40c0-0000-0000d2674b80\",\"mediaType\":\"application/json\",\"data\":{\"type\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bEtVVFJIVkVrek1IUmhWbWwzWTJoVU0yVXdia3hZUWxNME0wSTBhamxxYkhOc1MyOHlXbXhrV0hwcVJXeDNTMEl5TVdoak0xSnNZMnBCVVVGVlNsQkRaMng2V2xkT2QwMXFWVEpoZWtWVFNVaHJiMUIwYW1wMFUxaGFObU14UkdkWmNtTjVTVzVHTTFnNE0yZElSVE14WjBSbWJVRnVjbWR0T0dsSGFVTlZUMEpyZVU0NVRGZHNXWE5JU1ZVNU0zUktlVEYzVlhWT2QyVkpYMWsxWWtwVGNVNXRXbGhXT0RSM0luMHNJblI1Y0dVaU9sc2lWbVZ5YVdacFlXSnNaVU55WldSbGJuUnBZV3dpWFN3aVFHTnZiblJsZUhRaU9sc2lhSFIwY0hNNlhDOWNMM2QzZHk1M015NXZjbWRjTHpJd01UaGNMMk55WldSbGJuUnBZV3h6WEM5Mk1TSmRmWDAueDBTRjE3WTBWQ0RtdDdIY2VPZFR4Zkhsb2ZzWm1ZMThSbjZWUWIwLXIta19CbTNoVGkxLWsydmtkakIyNWhkeHlUQ3Z4YW0tQWtBUC1BZzNBaG41TmciLCJjaGFsbGVuZ2UiOiIzMDQ1MDIyMTAwYjE0MTJjMGYzZmJiYzVjODc2ZGRlNjExNDFmYTY4N2Y3ZjJmYWJhODM0YWJjZTA5Yzg2YzcwNWEwYjkwMjAwNTAyMjA2YjY3MjUzZmE1ZjgwMzQ0YzQyZGQ4NGQyMzZiYmJiMTVkNTBhODliODE2ZmE1NWQ1YTZhNzQyY2NjODYwZTIzIn19\"},\"format\":\"prism/jwt\"}],\"thid\":\"00000000-ef9d-4722-0000-00003b1bc908\",\"ack\":[]}" + val msg = Json.decodeFromString(msgString) - assertFailsWith { - agent.handlePresentation(msg) - } + assertFailsWith { + agent.handlePresentation(msg) } + } @Test fun testHandlePresentationSubmission_whenAllCorrect_thenReturnTrue() = runTest { @@ -1057,10 +1445,9 @@ class EdgeAgentTests { val mercuryMock = mock() val polluxMock = mock() val connectionManagerMock = mock() - val seed = Seed(MnemonicHelper.createRandomSeed()) val privateKey = Secp256k1KeyPair.generateKeyPair( - seed = Seed(MnemonicHelper.createRandomSeed()), + seed = seed, curve = KeyCurve(Curve.SECP256K1) ).privateKey val storablePrivateKeys = listOf( @@ -1086,7 +1473,7 @@ class EdgeAgentTests { ).thenReturn(flow { emit(requestMsg) }) val presentationSubmission = Json.decodeFromString( - "{\"presentation_submission\":{\"id\":\"015a6303-3a16-4813-a657-54a12ff5dab4\",\"definition_id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"descriptor_map\":[{\"id\":\"wa_driver_license\",\"format\":\"jwt\",\"path\":\"\$.verifiablePresentation[0]\"}]},\"verifiablePresentation\":[\"eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MjU3MTlhOTZiMTUxMjA3MTY5ODFhODQzMGFkMGNiOTY4ZGQ1MzQwNzM1OTNjOGNkM2YxZDI3YTY4MDRlYzUwZTpDcG9DQ3BjQ0Vsb0tCV3RsZVMweEVBSkNUd29KYzJWamNESTFObXN4RWlBRW9TQ241dHlEYTZZNnItSW1TcXBKOFkxbWo3SkMzX29VekUwTnl5RWlDQm9nc2dOYWVSZGNDUkdQbGU4MlZ2OXRKZk53bDZyZzZWY2hSM09xaGlWYlRhOFNXd29HWVhWMGFDMHhFQVJDVHdvSmMyVmpjREkxTm1zeEVpRE1rQmQ2RnRpb0prM1hPRnUtX2N5NVhtUi00dFVRMk5MR2lXOGFJU29ta1JvZzZTZGU5UHduRzBRMFNCVG1GU1REYlNLQnZJVjZDVExYcmpJSnR0ZUdJbUFTWEFvSGJXRnpkR1Z5TUJBQlFrOEtDWE5sWTNBeU5UWnJNUklnTzcxMG10MVdfaXhEeVFNM3hJczdUcGpMQ05PRFF4Z1ZoeDVzaGZLTlgxb2FJSFdQcnc3SVVLbGZpYlF0eDZKazRUU2pnY1dOT2ZjT3RVOUQ5UHVaN1Q5dCIsInN1YiI6ImRpZDpwcmlzbTpiZWVhNTIzNGFmND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WRlbnRpYWwiXSwiQGNvbnRleHQiOlsiaHR0cHM6XC9cL3d3dy53My5vcmdcLzIwMThcL2NyZWRlbnRpYWxzXC92MSJdfX0.x0SF17Y0VCDmt7HceOdTxfHlofsZmY18Rn6VQb0-r-k_Bm3hTi1-k2vkdjB25hdxyTCvxam-AkAP-Ag3Ahn5Ng\"]}" + "{\"presentation_submission\":{\"id\":\"015a6303-3a16-4813-a657-54a12ff5dab4\",\"definition_id\":\"32f54163-7166-48f1-93d8-ff217bdb0653\",\"descriptor_map\":[{\"id\":\"wa_driver_license\",\"format\":\"jwt\",\"path\":\"$.verifiablePresentation[0]\"}]},\"verifiablePresentation\":[\"eyJhbGciOiJFUzI1NksifQ.eyJpc3MiOiJkaWQ6cHJpc206MjU3MTlhOTZiMTUxMjA3MTY5ODFhODQzMGFkMGNiOTY4ZGQ1MzQwNzM1OTNjOGNkM2YxZDI3YTY4MDRlYzUwZTpDcG9DQ3BjQ0Vsb0tCV3RsZVMweEVBSkNUd29KYzJWamNESTFObXN4RWlBRW9TQ241dHlEYTZZNnItSW1TcXBKOFkxbWo3SkMzX29VekUwTnl5RWlDQm9nc2dOYWVSZGNDUkdQbGU4MlZ2OXRKZk53bDZyZzZWY2hSM09xaGlWYlRhOFNXd29HWVhWMGFDMHhFQVJDVHdvSmMyVmpjREkxTm1zeEVpRE1rQmQ2RnRpb0prM1hPRnUtX2N5NVhtUi00dFVRMk5MR2lXOGFJU29ta1JvZzZTZGU5UHduRzBRMFNCVG1GU1REYlNLQnZJVjZDVExYcmpJSnR0ZUdJbUFTWEFvSGJXRnpkR1Z5TUJBQlFrOEtDWE5sWTNBeU5UWnJNUklnTzcxMG10MVdfaXhEeVFNM3hJczdUcGpMQ05PRFF4Z1ZoeDVzaGZLTlgxb2FJSFdQcnc3SVVLbGZpYlF0eDZKazRUU2pnY1dOT2ZjT3RVOUQ5UHVaN1Q5dCIsInN1YiI6ImRpZDpwcmlzbTpiZWVhNTIzNGFmNDY4MDQ3MTRkOG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wiQGNvbnRleHQiOlsiaHR0cHM6XC9cL3d3dy53My5vcmdcLzIwMThcL2NyZWRlbnRpYWxzXC92MSJdfX0.x0SF17Y0VCDmt7HceOdTxfHlofsZmY18Rn6VQb0-r-k_Bm3hTi1-k2vkdjB25hdxyTCvxam-AkAP-Ag3Ahn5Ng\"]}" ) // Mock createPresentationSubmission response `when`(polluxMock.createPresentationSubmission(any(), any(), any())).thenReturn( @@ -1162,6 +1549,414 @@ class EdgeAgentTests { assertTrue(agent.handlePresentation(msg)) } + @Test + fun `EdgeAgent backup wallet should generate a JWE with the proper algorithm and encryption method`() = runTest { + val agent = EdgeAgent( + apollo = apolloMock, + castor = castorMock, + pluto = plutoMock, + mercury = mercuryMock, + pollux = polluxMock, + connectionManager = connectionManagerMock, + seed = seed, + api = null, + logger = PrismLoggerMock() + ) + `when`( + apolloMock.createPrivateKey( + mapOf( + TypeKey().property to KeyTypes.Curve25519, + CurveKey().property to Curve.X25519.value, + SeedKey().property to seed.value.base64UrlEncoded, + DerivationPathKey().property to "m/0'/0'/0'" + ) + ) + ).thenReturn( + X25519PrivateKey( + byteArrayOf( + 32, + 28, + -51, + 70, + 102, + -26, + -24, + -94, + -14, + -51, + -68, + -39, + -61, + -51, + 21, + -60, + 94, + -51, + 115, + -79, + 72, + 77, + -39, + 45, + 126, + -26, + 27, + -10, + 35, + 25, + -48, + 90 + ) + ) + ) + + `when`(plutoMock.getAllDIDs()).thenReturn(flow { emit(Json.decodeFromString>(getDids)) }) + `when`(plutoMock.getAllCredentials()).thenReturn( + flow { + @Serializable + data class CredentialMock( + val restorationId: String, + val credentialData: String, + val revoked: Boolean + ) + + fun String.toRestorationId(): RestorationID = + RestorationID.entries.first { + it.value == this + } + + val credentials = Json.decodeFromString>(getCredentials).map { + val currentCredential = when (it.restorationId.toRestorationId()) { + RestorationID.JWT -> { + val jwtString = it.credentialData.base64UrlDecoded + JWTCredential.fromJwtString(jwtString).toStorableCredential() + } + + RestorationID.ANONCRED -> { + val data = it.credentialData.base64UrlDecodedBytes + PlutoRestoreTask.AnonCredentialBackUp.fromStorableData(data) + .toAnonCredential().toStorableCredential() + } + + RestorationID.W3C -> { + throw Exception("This should never happen in this test class") + } + } + CredentialRecovery( + restorationId = it.restorationId, + credentialData = currentCredential.credentialData, + revoked = it.revoked + ) + } + emit( + credentials + ) + } + ) + `when`(plutoMock.getAllDidPairs()).thenReturn( + flow { + emit( + Json.decodeFromString>( + getDidPairs + ) + ) + } + ) + `when`(plutoMock.getAllKeysForBackUp()).thenReturn( + flow { + emit( + Json.decodeFromString>( + getPrivateKeys + ) + ) + } + ) + `when`(plutoMock.getLinkSecret()).thenReturn( + flow { + emit( + Json.decodeFromString( + getLinkSecret + ) + ) + } + ) + `when`(plutoMock.getAllMessages()).thenReturn( + flow { + emit( + Json.decodeFromString>( + getMessages + ) + ) + } + ) + `when`(plutoMock.getAllMediators()).thenReturn( + flow { + emit( + Json.decodeFromString>( + getMediator + ) + ) + } + ) + + val jwe = agent.backupWallet(plutoBackupTask = PlutoBackupTask(plutoMock)) + val jweObject = JWEObject.parse(jwe) + assertEquals(JWEAlgorithm.ECDH_ES_A256KW, jweObject.header.algorithm) + assertEquals(EncryptionMethod.A256CBC_HS512, jweObject.header.encryptionMethod) + } + val getCredentialDefinitionResponse = "{\"schemaId\":\"http://host.docker.internal:8000/prism-agent/schema-registry/schemas/5e0d5a93-4bfd-3111-a956-5d5bc82f76cc\",\"type\":\"CL\",\"tag\":\"licence\",\"value\":{\"primary\":{\"n\":\"105195159277979097653318357586659371305119697478469834190626350283715795188687389523188659352120689851168860621983864738336838773213022505168653440146374011050277159372491059901432822905781969400722059341786498751125483895348734607382548396665339315322605154516776326303787844694026898270194867398625429469096229269732265502538641116512214652017416624138065704599041020588805936844771273861390913500753293895219370960892829297672575154196820931047049021760519166121287056337193413235473255257349024671869248216238831094979209384406168241010010012567685965827447177652200129684927663161550376084422586141212281146491949\",\"s\":\"85376740935726732134199731472843597191822272986425414914465211197069650618238336366149699822721009443794877925725075553195071288777117865451699414058058985000654277974066307286552934230286237253977472401290858765904161191229985245519871949378628131263513153683765553672655918133136828182050729012388157183851720391379381006921499997765191873729408614024320763554099291141052786589157823043612948619201525441997065264492145372001259366749278235381762443117203343617927241093647322654346302447381494008414208398219626199373278313446814209403507903682881070548386699522575055488393512785511441688197244526708647113340516\",\"r\":{\"dateofissuance\":\"16159515692057558658031632775257139859912833740243870833808276956469677196577164655991169139545328065546186056342530531355718904597216453319851305621683589202769847381737819412615902541110462703838858425423753481085962114120185123089078513531045426316918036549403698066078445947881055316312848598741184161901260446303171175343050250045452903485086185722998336149005743485268486377824763449026501058416292877646187105446333888525480394665310217044483841168928926515929150167890936706159800372381200383816724043496032886366767166850459338411710056171379538841845247931898550165532492578625954615979453881721709564750235\",\"drivingclass\":\"83649701835078373520097916558245060224505938113940626586910000950978790663411517512280043632278010831292224659523658613504637416710001103641231226266903556936380105758523760424939825687213460920436570466066231912959327201876189240504388424799892400351592593406285436824571943165913587899115814843543998396726679289422080229750418336051741708013580146373647528674381958028243228435161765957312248113519708734663989428761879029086059388435772829434952754093999424834120341657211221855300108096057633128467059590470639772605075954658131680801785637700237403873940041665483384938586320674338994185073499523485570537331062\",\"emailaddress\":\"96995643129591814391344614133120459563648002327749700279517548454036811217735867585059116635583558148259032071807493674533230465312311981127622542797279917256478867847832932893748528200469349058284133058865149153179959849308383505167342565738382180666525211256221655129861213392455759272915565057394420728271409215556596974900718332893753172173500744392522771654048192448229319313386967045678744665093451560743782910263014930200762027209565313884859542996067229707388839912195826334964819133016500346618083969320902775088800287566711941842968839787149808739739233388585677095545116231323172342995837636586249573194609\",\"drivinglicenseid\":\"102840929811153624977554462471309185033977661854754815794111114507549576719389525167082631547450413573293352276930065480432301200611396989595571202142654033217842162456070556560693402484110499573693863745648118310258284468114751958738878996458420605301017450868522680454545537837403398645500541915771765220093329728663621098538954397330411649083351383375839056527007892276284168437065687748085384178113959961057476582871100422859953560730152958588610850909069434658487744782540788968302663076149478487413357533660817020800754493642858564081116318655661240523146995256712471572605700346459123074377380656921337264554594\",\"familyname\":\"2428690037146701497427424649573806616639612325136606164619283916796880313617677563507218774958436668407050506838114136163250163675016510113975582318007560622124292458766639319715064358235569650961433812439763343736699708535945693241909905707497180931492818502593885932421170612418693515054756633264933222189766691632082890045477718331705366111669009551578289182848340651375008362238266590844461708981816856194045325523248527964502118319210042254240848590574645476930113881493472578612352948284862674703949781070309344526122291448990325949065193279599181502524961004046979227803224474342778516917124487012958845744311\",\"master_secret\":\"96236339155824229583363924057798366491998077727991424922911165403434522806469328114407334094535810942859512352089785125683335350062474092708044674085769524387654467267128528564551803293661877480971961092735622606052503557881856409855812611523475975566606131897917979412576797874632169829901968854843162299366867885636535326810998541141840561418097240137120398317445832694001031827068485975315937269024666370665530455146256019590700349556357390218401217383173228376078058967743472704019765210324846681867991543267171763037513180046865961560351035005185946817643006206395175857900512245900162751815626427008481585714891\"},\"rctxt\":\"54359809198312125478916383106913469635175253891208897419510030559787479974126666313900084654632259260010008369569778456071591398552341004538623276997178295939490854663263886825856426285604332554317424030793691008221895556474599466123873279022389276698551452690414982831059651505731449763128921782866843113361548859434294057249048041670761184683271568216202174527891374770703485794299697663353847310928998125365841476766767508733046891626759537001358973715760759776149482147060701775948253839125589216812475133616408444838011643485797584321993661048373877626880635937563283836661934456534313802815974883441215836680800\",\"z\":\"99592262675748359673042256590146366586480829950402370244401571195191609039150608482506917768910598228167758026656953725016982562881531475875469671976107506976812319765644401707559997823702387678953647104105378063905395973550729717937712350758544336716556268064226491839700352305793370980462034813589488455836259737325502578253339820590260554457468082536249525493340350556649403477875367398139579018197084796440810685458274393317299082017275568964540311198115802021902455672385575542594821996060452628805634468222196284384514736044680778624637228114693554834388824212714580770066729185685978935409859595244639193538156\"}},\"issuerId\":\"did:prism:604ba1764ab89993f9a74625cc4f3e04737919639293eb382cc7adc53767f550\"}" + + val getLinkSecret = + "\"40960368705011900020984253500979753785333739067716460047393316855560515114468\"" + val getDids = """ + [{"method":"peer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jpbXSwiYSI6W119fQ"},{"method":"prism","methodId":"6f23ddace519b68dfc0fa06e992db40f2f3c584af382ce446fa2fd0e042e5dea:CoUBCoIBEjsKB21hc3RlcjAQAUouCglzZWNwMjU2azESIQMcKwEitGbQKtGa-jFXi3m1u7OP2JMukYXQnZk3fQIXvxJDCg9hdXRoZW50aWNhdGlvbjAQBEouCglzZWNwMjU2azESIQMcKwEitGbQKtGa-jFXi3m1u7OP2JMukYXQnZk3fQIXvw"},{"method":"prism","methodId":"0a4b552169e3158781741fbbeffe81212784d32d90cf8f2622923f11f6ecd966:CoUBCoIBEjsKB21hc3RlcjAQAUouCglzZWNwMjU2azESIQLgzhsuOqhAyImy-c8o9ZmIJ4iY_Gc8tvNIT3l1w58f2BJDCg9hdXRoZW50aWNhdGlvbjAQBEouCglzZWNwMjU2azESIQLgzhsuOqhAyImy-c8o9ZmIJ4iY_Gc8tvNIT3l1w58f2A"}] + """ + val getDidPairs = """ + [{"holder":{"method":"peer", "methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, "receiver":{"method":"peer", "methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, "name":""}] + """ + val getPrivateKeys = """ + [ + { + "key":"{\"kty\":\"OKP\",\"d\":\"j1BaK2P1iHMt9hwb6GzZCcpjkKrYmBPX5LPI4aFLTT0\",\"crv\":\"Ed25519\",\"x\":\"2V3e1LsSkcjwvlX2Y9Fp2jbg_j5lan-nZJRxYy_sUjk\"}", + "did":"did:peer:2.Ez6LSok96TA4orHQXSMHZj3mqyUuVLMfLfGGqj27i1giErbXL.Vz6Mku5mY1GuJ9AN2vvDwjMv5QUC2zqKVRPCcbmJVYTFTCFmr#key-2", + "index":0, + "recovery_id":"ed25519+priv" + }, + { + "key":"{\"kty\":\"OKP\",\"d\":\"6BQsylDTirk7C6bacJuaH28tx6jXmNZv7LojNN2Tgnw\",\"crv\":\"X25519\",\"x\":\"s1A5vv8L6_8NhtPr7L_CaE72WVkt6UNnoj2mtqS11H8\"}", + "did":"did:peer:2.Ez6LSok96TA4orHQXSMHZj3mqyUuVLMfLfGGqj27i1giErbXL.Vz6Mku5mY1GuJ9AN2vvDwjMv5QUC2zqKVRPCcbmJVYTFTCFmr#key-1", + "index":0, + "recovery_id":"x25519+priv" + }, + { + "key":"{\"kty\":\"OKP\",\"d\":\"wE2pfN2Y0iwqa2py22NKZJvvq7nZZ_Ff9yYyvBTUhig\",\"crv\":\"Ed25519\",\"x\":\"fDrwZceyjKWYnvstPyk_b353dgOQ8_YOs1TK12h0trE\"}",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J2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ#key-1", + "index":0, + "recovery_id":"x25519+priv" + }, + { + "key":"{\"kty\":\"EC\",\"d\":\"drF7QtIgnKGMpQTm2BxomRFeKkgHWV4r2lfYCVUYPns\",\"crv\":\"secp256k1\",\"x\":\"HCsBIrRm0CrRmvoxV4t5tbuzj9iTLpGF0J2ZN30CF78\",\"y\":\"MuTzhhijGiKuc_Ajm7iasGJwSETvhjK7SEukKBLMMOM\"}", + "did":"did:prism:6f23ddace519b68dfc0fa06e992db40f2f3c584af382ce446fa2fd0e042e5dea:CoUBCoIBEjsKB21hc3RlcjAQAUouCglzZWNwMjU2azESIQMcKwEitGbQKtGa-jFXi3m1u7OP2JMukYXQnZk3fQIXvxJDCg9hdXRoZW50aWNhdGlvbjAQBEouCglzZWNwMjU2azESIQMcKwEitGbQKtGa-jFXi3m1u7OP2JMukYXQnZk3fQIXvw", + "index":1, + "recovery_id":"secp256k1+priv" + }, + { + "key":"{\"kty\":\"EC\",\"d\":\"QPFq8rgWb8jDBBVOpR9_tnzy0mW1RwMLBL5x1DUle-k\",\"crv\":\"secp256k1\",\"x\":\"4M4bLjqoQMiJsvnPKPWZiCeImPxnPLbzSE95dcOfH9g\",\"y\":\"vld5MJHizoXDITRfAjkFiKs8PAbGbM21cNCfzFyanYQ\"}", + "did":"did:prism:0a4b552169e3158781741fbbeffe81212784d32d90cf8f2622923f11f6ecd966:CoUBCoIBEjsKB21hc3RlcjAQAUouCglzZWNwMjU2azESIQLgzhsuOqhAyImy-c8o9ZmIJ4iY_Gc8tvNIT3l1w58f2BJDCg9hdXRoZW50aWNhdGlvbjAQBEouCglzZWNwMjU2azESIQLgzhsuOqhAyImy-c8o9ZmIJ4iY_Gc8tvNIT3l1w58f2A", + "index":2, + "recovery_id":"secp256k1+priv" + } + ] + """ + val getCredentials = """ + [ + { + "restorationId":"jwt+credential", + "credentialData":"ZXlKaGJHY2lPaUpGVXpJMU5rc2lmUS5leUpwYzNNaU9pSmthV1E2Y0hKcGMyMDZNek0zWlRobVpURTBOR0ZoWTJWa00yTmhNMlJrTlRrME5qSTBNRFJtTkRVNU9UWmxNMkl5TWpGaFltTTBNVEJoTnpJMVpXRTJOalV6TkRnNU56SmlZanBEY210Q1EzSlpRa1ZxYjB0Q2JVWXhaRWRuZEUxU1FVVlRhVFJMUTFoT2JGa3pRWGxPVkZweVRWSkphRUYyZVdjeFlUTjFjSFZtYkZCTGN6aEtSMWhLVTNOeFYxcGpWRzlHUVhrM1JqTlNURkJqUWxrMFYyNXpSV3B6UzBJeWJIcGpNMVpzVEZSRlVVRnJiM1ZEWjJ4NldsZE9kMDFxVlRKaGVrVlRTVkZQWVZCVWJ6TTVUbmgyVW1oWFVXNWlWV2hvVFhNNWJURkllRUp0Y1Y5aFpXTkhNMHRUVEdaaU5XZ3pVa2szUTJka2RGbFlUakJhV0VsM1JVRkdTMHhuYjBwak1sWnFZMFJKTVU1dGMzaEZhVVZFWjNwb09FbERZMVpoTlZsTlpqWXpSRkZhTTE5MWRUTk9Nek5zU1hWR1NHSm9YMDlLVWxWSWJXZDJZeUlzSW5OMVlpSTZJbVJwWkRwd2NtbHpiVG93WVRSaU5UVXlNVFk1WlRNeE5UZzNPREUzTkRGbVltSmxabVpsT0RFeU1USTNPRFJrTXpKa09UQmpaamhtTWpZeU1qa3lNMll4TVdZMlpXTmtPVFkyT2tOdlZVSkRiMG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AzMjAxMDM3NjU1MDgzNDQ1ODkzNTYwNjM1NjE0MzgwMTQ5MDU0NDExMTg4MjMwNjg1MDA1NDA1ODgwNTE3NjkzNjE2NDk0MTk5NDA2NDQ1MjE2OTIwMDA2Nzk1NzQ5MDQ4NjQwOTMyNTE1NjQ4MTkyNDU0MDk3MTQxNDE3NjY0Nzc0NDMxMzg5MDA1NDUwMTM4NDcyNjQ1NzU3NzMzMjY0MzI4MTQ1MzcyMjcwODgyODIxMjA5Nzg4NjAyMzQ4NDc1OTMzNTU3NzU4MzkzMzMzNTU5ODEyOTQ4MjcyMjcxODEwMzk0OTE0MzQ2NTg5NTU4NjkxMTE0NzgzOTM5Njk1MDgzMjU5MjMwNzU3MTU5MjEwODU3MDY4ODIyNTgzNTY1OTE3ODc4MjQxNjU0MTU4NjY4NjUyMzc2NzAyNzExMTQyMDcwNzA0MDc2MzQ3MzU0NjAyMTI4MTE5MjgyNzQ3NjUxOTg3OTg2MjAwMDgzNzk2OTUwODk1MzExNTA5NDMxNzkwNTcxNzUwMTUxOTkzMjgwMzkyODgyMjE2MTIyMDA5NTc3MzEwMDI4NzYyMDY0MTAwNTg3MTQ0NTMwNiIsImMiOiI5Mzc5MzI3MTk1Mjc5MTYzNzQyMjg2MTE0MzgwMjMzNjcwMzg5NzI5MTcyNjA1MDUwMjQ0MDU5OTI3MDQwNjM1MjA4OTgzNjAyOTkxOSJ9fQ", + "revoked": false + } + ] + """ + val getMessages = """ + [ + { + "id":"49d81234-8d78-4c12-8894-ae3a624deaa1", + "piuri":"https://atalaprism.io/mercury/connections/1.0/request", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":null, + "body":"{\"accept\":[]}", + "created_time":"1718334045301", + "expires_time_plus":"1718420445301", + "attachments":[ + + ], + "thid":"635e1e59-54b2-4cce-b635-f70f6a4b0268", + "ack":[ + + ], + "direction":"SENT" + }, + { + "id":"76170446-761a-48e5-a869-1800089c6024", + "piuri":"https://atalaprism.io/mercury/connections/1.0/response", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":"null", + "body":"{\"goal\":null,\"goal_code\":null,\"accept\":[]}", + "created_time":"1718334045", + "expires_time_plus":"1718420447030", + "attachments":[ + + ], + "thid":"635e1e59-54b2-4cce-b635-f70f6a4b0268", + "ack":[ + + ] + }, + { + "id":"99383a8d-6943-40ad-87dd-b224dff3c80c", + "piuri":"https://didcomm.org/issue-credential/3.0/offer-credential", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":"null", + "body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":\"http://host.docker.internal:8000/prism-agent/schema-registry/schemas/f52ebc61-6146-3238-99c5-a3fd693b96f7/schema\",\"type\":\"https://didcomm.org/issue-credential/3.0/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"emailaddress\",\"value\":\"cristian.castro@iohk.io\"}]}},\"replacement_id\":null,\"comment\":null}", + "created_time":"1718334097", + "expires_time_plus":"1718420498750", + "attachments":[ + { + "id":"3235ce90-8625-4668-9262-19c03d710fc4", + "data":{ + "base64":"eyJzY2hlbWFfaWQiOiJodHRwOi8vaG9zdC5kb2NrZXIuaW50ZXJuYWw6ODAwMC9wcmlz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4MDkyMDU1OTQ3NDI2Mjk3MzI1NjIxMTE3OTU0NzE1MTUxMzYzNjUwODc4OTM1NTMzNTM2NzMzNjY1OTExMjAzNzkwMDY1NDg4MjMyNzUyMTkwMjU4NTA3MDMzMDYwMjU4NzgwMTU1MTA2NTQ2OTM5Mzc0ODI3MjQyODE3MjQ5NjUwMzE4OTY2MzkyNTYwNjEwMjMyMzg5NTUyMzU0NDI2ODU3OTA5MDI3NzU1Nzg1NTczMzA4MTEiXV19LCJub25jZSI6IjMzNTY5Njg3NzUyNDI0NzQzNzc2NTU0MCJ9" + }, + "format":"anoncreds/credential-offer@v1.0" + } + ], + "thid":"177d90ac-f7ac-41b1-af88-2dd8106633cb", + "ack":[ + + ] + }, + { + "id":"b6b4786a-8568-4ef4-9aa6-91e3657748e4", + "piuri":"https://didcomm.org/issue-credential/3.0/request-credential", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":null, + "body":"{\"goalCode\":\"Offer Credential\"}", + "created_time":"1718334102032", + "expires_time_plus":"1718420502032", + "attachments":[ + { + "id":"a6ebb2df-326e-4bc6-9e62-3d668dabea3b", + "media_type":"application/json", + "data":{ + "base64":"eyJlbnRyb3B5IjoiZGlkOnByaXNtOjZmMjNkZGFjZTUxOWI2OGRmYzBmYTA2ZTk5MmRiNDBmMmYzYzU4NGFmMzgyY2U0NDZmYTJmZDBlMDQyZTVkZWE6Q29VQkNvSUJFanNLQjIxaGMzUmxjakFRQVVvdUNnbHpaV053TWpVMmF6RVNJUU1jS3dFaXRHYlFLdEdhLWpGWGkzbTF1N09QMkpNdWtZWFFuWmszZlFJWHZ4SkRDZzloZFhSb1pXNTBhV05oZEdsdmJqQVFCRW91Q2dselpXTndNalUyYXpFU0lRTWNLd0VpdEdiUUt0R2EtakZYaTNtMXU3T1AySk11a1lYUW5aazNmUUlYdnciLCJjcmVkX2RlZl9pZCI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL3ByaXNtLWFnZW50L2NyZWRlbnRpYWwtZGVmaW5pdGlvbi1yZWdpc3RyeS9kZWZpbml0aW9ucy8zZjRlYTA5OC04N2I2LTMwMmEtYTcyNi1mOTNmZTkzOGNmMjQvZGVmaW5pdGlvbiIsImJsaW5kZWRfbXMiOnsidSI6IjgwOTQ1NTUxODIxMzU3OTIyMTY0MTY5Njk5MDk2NDM0NzM4MzA2ODI3NDEyNzYxNzU1NDY3OTE5Mj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NjEwOTUyNTg2NzAyMDgzMjQzMDY2MDEwNjA1MjY3MDQyNjI4ODUwOTE0OTIxNzAxNDE0Mzg2MzYxMjQzMDg0NDg0ODEyNzA5NTUyMjY5NTA4NTg1ODg4MDI1OTUzODUzMDA4NDc4OTcwODg0OTMzMzE5ODkyOTI4NjA1MTcxNTY5NDU0OTE3NDE5NTAyMDI3NjczODAzODUzOTE0ODg0NTQ1MjQ4NCJ9LCJyX2NhcHMiOnt9fSwibm9uY2UiOiI5NTgwMjEwNzc4NDA2MzYxNDUwNDk2ODEifQ" + }, + "format":"anoncreds/credential-request@v1.0" + } + ], + "thid":"177d90ac-f7ac-41b1-af88-2dd8106633cb", + "ack":[ + + ], + "direction":"SENT" + }, + { + "id":"5d2e5e11-4b6a-424b-921b-e89c3df596d7", + "piuri":"https://didcomm.org/issue-credential/3.0/issue-credential", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":"null", + "body":"{\"goal_code\":\"Issue Credential\",\"replacement_id\":null,\"more_available\":null,\"comment\":null}", + "created_time":"1718334107", + "expires_time_plus":"1718420509304", + "attachments":[ + { + "id":"a62c5510-37b7-4593-81eb-9190d9e14e3a", + "data":{ + "base64":"eyJzY2hlbWFfaWQiOiJodHRwOi8vaG9zdC5kb2NrZXIuaW50ZXJuYWw6ODAwMC9wcmlzbS1hZ2VudC9zY2hlbWEtcmVnaXN0cnkvc2NoZW1hcy9mNTJlYmM2MS02MTQ2LTMyMzgtOTljNS1hM2ZkNjkzYjk2Zjcvc2NoZW1hIiwiY3JlZF9kZWZfaWQiOiJodHRwOi8vMTkyLjE2OC42OC4xMTM6ODAwMC9wcmlzbS1hZ2VudC9jcmVkZW50aWFsLWRlZmluaXRpb24tcmVnaXN0cnkvZGVmaW5pdGlvbnMvM2Y0ZWEwOTgtODdiNi0zMDJhLWE3MjYtZjkzZmU5MzhjZjI0L2RlZmluaXRpb24iLCJyZXZfcmVnX2lkIjpudWxsLCJ2YWx1ZXMiOnsiZW1haWxhZGRyZXNzIjp7InJhdyI6ImNyaXN0aWFuLmNhc3Ryb0Bpb2hrLmlvIiwiZW5jb2RlZCI6IjM2MzQyMzgzNzQ1NTM4Njg0NzkxOTMwNTAzMzYyNTczOTQ0MjQzNzA2MjA3NTE4NzU5MDI1MTY5MTAyODM3MDAxMzM0NjExMzcyNzQzIn19LCJzaWduYXR1cmUiOnsicF9jcmVkZW50aWFsIjp7Im1f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NDc2NTE5ODc5ODYyMDAwODM3OTY5NTA4OTUzMTE1MDk0MzE3OTA1NzE3NTAxNTE5OTMyODAzOTI4ODIyMTYxMjIwMDk1NzczMTAwMjg3NjIwNjQxMDA1ODcxNDQ1MzA2IiwiYyI6IjkzNzkzMjcxOTUyNzkxNjM3NDIyODYxMTQzODAyMzM2NzAzODk3MjkxNzI2MDUwNTAyNDQwNTk5MjcwNDA2MzUyMDg5ODM2MDI5OTE5In0sInJldl9yZWciOm51bGwsIndpdG5lc3MiOm51bGx9" + }, + "format":"anoncreds/credential@v1.0" + } + ], + "thid":"177d90ac-f7ac-41b1-af88-2dd8106633cb", + "ack":[ + + ] + }, + { + "id":"cf1734d1-51d5-4275-9a40-18c36f44fb03", + "piuri":"https://didcomm.org/issue-credential/3.0/offer-credential", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":"null", + "body":"{\"multiple_available\":null,\"goal_code\":\"Offer Credential\",\"credential_preview\":{\"schema_id\":null,\"type\":\"https://didcomm.org/issue-credential/3.0/credential-credential\",\"body\":{\"attributes\":[{\"media_type\":null,\"name\":\"familyName\",\"value\":\"demo\"},{\"media_type\":null,\"name\":\"drivingClass\",\"value\":\"1\"},{\"media_type\":null,\"name\":\"dateOfIssuance\",\"value\":\"01/01/2024\"},{\"media_type\":null,\"name\":\"emailAddress\",\"value\":\"demo@email.com\"},{\"media_type\":null,\"name\":\"drivingLicenseID\",\"value\":\"A1221332\"}]}},\"replacement_id\":null,\"comment\":null}", + "created_time":"1718334142", + "expires_time_plus":"1718420545527", + "attachments":[ + { + "id":"6ba0515b-0f68-4c0a-8ecb-487d01dec978", + "data":{ + "data":"{\"options\":{\"domain\":\"domain\",\"challenge\":\"fd8c7f98-8473-42ba-83a8-5cfa460c55b9\"},\"presentation_definition\":{\"purpose\":null,\"format\":{\"jwt\":{\"proof_type\":[],\"alg\":[\"ES256K\"]},\"ldp\":null},\"name\":null,\"input_descriptors\":[],\"id\":\"3cb224c2-cb61-4f5d-ae5f-2fa89572597d\"}}" + }, + "format":"prism/jwt" + } + ], + "thid":"7524fc50-d834-4a1f-a617-f36dd1d571bd", + "ack":[ + + ] + }, + { + "id":"b3ec0d9c-c28b-4489-8b2d-3c936c32c665", + "piuri":"https://didcomm.org/issue-credential/3.0/request-credential", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":null, + "body":"{\"goalCode\":\"Offer Credential\"}", + "created_time":"1718334149224", + "expires_time_plus":"1718420549224", + "attachments":[ + { + "id":"02ae8939-6a48-4828-bbf9-10a68c0c4006", + "media_type":"prism/jwt", + "data":{ + "base64":"ZXlKaGJHY2lPaUpGVXpJMU5rc2lmUS5leUpwYzNNaU9pSmthV1E2Y0hKcGMyMDZNR0UwWWpVMU1qRTJPV1V6TVRVNE56Z3hOelF4Wm1KaVpXWm1aVGd4TWpFeU56ZzBaRE15WkRrd1kyWTRaakkyTWpJNU1qTm1NVEZtTm1WalpEazJOanBEYjFWQ1EyOUpRa1ZxYzB0Q01qRm9Zek5TYkdOcVFWRkJWVzkxUTJkc2VscFhUbmROYWxVeVlYcEZVMGxSVEdkNmFITjFUM0ZvUVhsSmJYa3RZemh2T1ZwdFNVbzBhVmxmUjJNNGRIWk9TVlF6YkRGM05UaG1Na0pLUkVObk9XaGtXRkp2V2xjMU1HRlhUbWhrUjJ4MlltcEJVVUpGYjNWRFoyeDZXbGRPZDAxcVZUSmhla1ZUU1ZGTVozcG9jM1ZQY1doQmVVbHRlUzFqT0c4NVdtMUpTalJwV1Y5SFl6aDBkazVKVkROc01YYzFPR1l5UVNJc0ltRjFaQ0k2SW1SdmJXRnBiaUlzSW5ad0lqcDdJa0JqYjI1MFpYaDBJanBiSW1oMGRIQnpPbHd2WEM5M2QzY3Vkek11YjNKblhDOHlNREU0WEM5amNtVmtaVzUwYVdGc2Mxd3ZkakVpWFN3aWRIbHdaU0k2V3lKV1pYSnBabWxoWW14bFVISmxjMlZ1ZEdGMGFXOXVJbDE5TENKdWIyNWpaU0k2SW1aa09HTTNaams0TFRnME56TXROREppWVMwNE0yRTRMVFZqWm1FME5qQmpOVFZpT1NKOS5mejg3SFNSYU5xb0d0Y3lXXzNkd2JRanE0ckR3LXlTME9ST1dnQ1I5LTBlM0RMTk4wM1p6UHVzejkzQnMza08wR2JrU3NaN1VLWGliZlBqNlpoQ3lPUQ" + } + } + ], + "thid":"7524fc50-d834-4a1f-a617-f36dd1d571bd", + "ack":[ + + ], + "direction":"SENT" + }, + { + "id":"e21457cc-d550-40f5-80ac-0e9d265adb47", + "piuri":"https://didcomm.org/issue-credential/3.0/issue-credential", + "from":{"method":"peer","methodId":"2.Ez6LSqWfJdwLMDmpew7Yd8AQS2MxDwvSCNpjaZ7EQVst8rkfA.Vz6MknpCj4WomXhC2eur8nf4wnoFzHpCA6EAFU6afEmmrUVRA.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6ImRpZDpwZWVyOjIuRXo2TFNnaHdTRTQzN3duREUxcHQzWDZoVkRVUXpTanNIemlucFgzWEZ2TWpSQW03eS5WejZNa2hoMWU1Q0VZWXE2SkJVY1RaNkNwMnJhbkNXUnJ2N1lheDNMZTRONTlSNmRkLlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW1oMGRIQnpPaTh2YzJsMExYQnlhWE50TFcxbFpHbGhkRzl5TG1GMFlXeGhjSEpwYzIwdWFXOGlMQ0poSWpwYkltUnBaR052YlcwdmRqSWlYWDE5LlNleUowSWpvaVpHMGlMQ0p6SWpwN0luVnlhU0k2SW5kemN6b3ZMM05wZEMxd2NtbHpiUzF0WldScFlYUnZjaTVoZEdGc1lYQnlhWE50TG1sdkwzZHpJaXdpWVNJNld5SmthV1JqYjIxdEwzWXlJbDE5ZlEiLCJyIjpbXSwiYSI6W119fQ"}, + "to":{"method":"peer","methodId":"2.Ez6LSrhfy5nfumryQUhCU9CRFZvEy3zZV2pUedwpUoYbeiZbq.Vz6MksfNehMay3PPDQEfaaeCotpgC5z9hCnbF6s8uYWUGjSYh.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHA6Ly8xOTIuMTY4LjY4LjExMzo4MDAwL2RpZGNvbW0iLCJyIjpbXSwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "fromPrior":"null", + "body":"{\"goal_code\":null,\"replacement_id\":null,\"more_available\":null,\"comment\":null}", + "created_time":"1718334153", + "expires_time_plus":"1718420555892", + "attachments":[ + { + "id":"69856638-0bd4-4d4c-be10-5b4c2fb56b03", + "data":{ + "base64":"ZXlKaGJHY2lPaUpGVXpJMU5rc2lmUS5leUpwYzNNaU9pSmthV1E2Y0hKcGMyMDZNek0zWlRobVpURTBOR0ZoWTJWa00yTmhNMlJrTlRrME5qSTBNRFJtTkRVNU9UWmxNMkl5TWpGaFltTTBNVEJoTnpJMVpXRTJOalV6TkRnNU56SmlZanBEY210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jTHpNNVlqQmlOekkyTFRCbU5tVXRORGxtTnkwNVl6VXlMVFl5WVRjNE1UY3hOelZsT0NNMUlpd2lkSGx3WlNJNklsTjBZWFIxYzB4cGMzUXlNREl4Ulc1MGNua2lMQ0p6ZEdGMGRYTk1hWE4wUTNKbFpHVnVkR2xoYkNJNkltaDBkSEE2WEM5Y0x6RTVNaTR4TmpndU5qZ3VNVEV6T2pnd01EQmNMM0J5YVhOdExXRm5aVzUwWEM5amNtVmtaVzUwYVdGc0xYTjBZWFIxYzF3dk16bGlNR0kzTWpZdE1HWTJaUzAwT1dZM0xUbGpOVEl0TmpKaE56Z3hOekUzTldVNEluMTlmUS5maW5ESHhybHRxbU9CcXBEZ3Zfa0NMVk02dnZCRFU3YWRoY01UV3Y2VTRwMlBha3puc0htbDl2TXpxNGpidWlfTXAwZDFoTm0tUXVVcFRMSUFiY2Z1QQ==" + }, + "format":"prism/jwt" + } + ], + "thid":"7524fc50-d834-4a1f-a617-f36dd1d571bd", + "ack":[ + + ] + } +] + """ + val getMediator = """ + [ + { + "mediator_did":{"method":"peer","methodId":"2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHBzOi8vc2l0LXByaXNtLW1lZGlhdG9yLmF0YWxhcHJpc20uaW8iLCJhIjpbImRpZGNvbW0vdjIiXX19.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6IndzczovL3NpdC1wcmlzbS1tZWRpYXRvci5hdGFsYXByaXNtLmlvL3dzIiwiYSI6WyJkaWRjb21tL3YyIl19fQ"}, + "holder_did":{"method":"peer","methodId":"2.Ez6LSok96TA4orHQXSMHZj3mqyUuVLMfLfGGqj27i1giErbXL.Vz6Mku5mY1GuJ9AN2vvDwjMv5QUC2zqKVRPCcbmJVYTFTCFmr"}, + "routing_did":{"method":"peer","methodId":"2.Ez6LSghwSE437wnDE1pt3X6hVDUQzSjsHzinpX3XFvMjRAm7y.Vz6Mkhh1e5CEYYq6JBUcTZ6Cp2ranCWRrv7Yax3Le4N59R6dd.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6Imh0dHBzOi8vc2l0LXByaXNtLW1lZGlhdG9yLmF0YWxhcHJpc20uaW8iLCJhIjpbImRpZGNvbW0vdjIiXX19.SeyJ0IjoiZG0iLCJzIjp7InVyaSI6IndzczovL3NpdC1wcmlzbS1tZWRpYXRvci5hdGFsYXByaXNtLmlvL3dzIiwiYSI6WyJkaWRjb21tL3YyIl19fQ"} + } + ] + """ }