Skip to content

Commit

Permalink
feat: use authentication key instead of master
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian G <[email protected]>
  • Loading branch information
cristianIOHK committed Sep 4, 2024
1 parent 5d3e067 commit 9c2ecd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ open class PolluxImpl(
}
val verificationMethod =
(authentication as DIDDocument.Authentication).verificationMethods.find { verificationMethod ->
verificationMethod.id.did == did && verificationMethod.id.fragment == PrismDIDPublicKey.Usage.MASTER_KEY.defaultId()
verificationMethod.id.did == did && verificationMethod.id.fragment == PrismDIDPublicKey.Usage.AUTHENTICATION_KEY.defaultId()
}

return verificationMethod?.id?.string()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import kotlinx.coroutines.test.runTest
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.encodeToJsonElement
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import org.didcommx.didcomm.common.Typ
import org.hyperledger.identus.apollo.base64.base64UrlDecoded
import org.hyperledger.identus.apollo.derivation.MnemonicHelper
Expand Down Expand Up @@ -1175,13 +1176,13 @@ class PolluxImplTest {
challenge = challenge,
credential = credential
)

assertTrue(signedClaims.contains("."))

val splits = signedClaims.split(".")
val header = splits[0].base64UrlDecoded
val json = Json.parseToJsonElement(header)
assertTrue(json.jsonObject.containsKey("kid"))
val kid = json.jsonObject["kid"]!!.jsonPrimitive.content
assertEquals("did:prism:cd6cf9f94a43c53e286b0f2015c0083701350a694f52a22ee02e3bd29d93eba9:CrQBCrEBEjsKB21hc3RlcjAQAUouCglzZWNwMjU2azESIQKJIokEe_iKRGsr0f2EEa1JHGm59g0qP7QMtw6FcVxW9xJDCg9hdXRoZW50aWNhdGlvbjAQBEouCglzZWNwMjU2azESIQKJIokEe_iKRGsr0f2EEa1JHGm59g0qP7QMtw6FcVxW9xotCgojZGlkY29tbS0xEhBESURDb21tTWVzc2FnaW5nGg1kaWQ6cGVlcjp0ZXN0#authentication0", kid)
}

private suspend fun createVerificationTestCase(testCaseOptions: VerificationTestCase): Triple<String, String, String> {
Expand Down

0 comments on commit 9c2ecd0

Please sign in to comment.