1
0
Форкнуть 0

Fix identifier tests (added JWK keyUse)

This commit is contained in:
Andreas Mikolajewski 2021-06-07 22:14:58 +02:00
Родитель a01376708c
Коммит d23d73f1d0
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -44,7 +44,7 @@ class IdentifierCreatorTest {
fun `identifier gets created properly`() {
val actualIdentifier = identifierCreator.create(personaName)
val expectedDid =
"did:ion:EiD4wQ0yXIT9apnLPuyqc4W4j7Qg2ZS2fCEOH8P6c-ZDXw:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJzZWNwMjU2azEiLCJraWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsImt0eSI6IkVDIiwieCI6ImRNZ3Fsck5TTTVjcG9TNFdYcldFbUhkSDJicEk2TTRzOU1EYVRrU0xWRVEiLCJ5IjoiX3ZTTTBoZTVsNmx6cER2OHBiMExtZUZBZlNncmR6enhWNzlpUklNTlN3byJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiRWNkc2FTZWNwMjU2azFWZXJpZmljYXRpb25LZXkyMDE5In1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlCVTUxeHJ0T1F2UmpQbEFnX3FSeXZFM3NyOXAyLVdKUTVTdGZYUXpuM01LQSJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpRDFfbk5VRllCME5wUW9vdlVCY0tGdWF6bW8zekZSRWxSeUVnS3A0eGZ1WGciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUJBYzZYckEyT3RGeVVYZUJ5Nmx1THFmeFo2ZGU4YV9jQnVLalBaZDZzMDVBIn19"
"did:ion:EiBVf7IBYOSLyFGiGsKYGQgodtndrmSXIk8HYt2Iw404bg:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJzZWNwMjU2azEiLCJraWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsImt0eSI6IkVDIiwidXNlIjoic2lnIiwieCI6ImRNZ3Fsck5TTTVjcG9TNFdYcldFbUhkSDJicEk2TTRzOU1EYVRrU0xWRVEiLCJ5IjoiX3ZTTTBoZTVsNmx6cER2OHBiMExtZUZBZlNncmR6enhWNzlpUklNTlN3byJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiRWNkc2FTZWNwMjU2azFWZXJpZmljYXRpb25LZXkyMDE5In1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlCalVVN2YyRDJGYmxOMG9BT0tjOERtSUNnZlA4ODV0MmRKWXgtRG5TLTI2USJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpQ0F6RVlmeVFiUW1LS2M4V2kxUTAxUWdaMXBFdEtFZW56eTAwTmJrS0JRbEEiLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaURURWZhSXppdGV3ajRFMlpVaWh4aXVPSkpXNHltQkYzek5PQ1U4RkF5OEpnIn19"
assertThat(actualIdentifier.id).isEqualTo(expectedDid)
assertThat(actualIdentifier.signatureKeyReference).isEqualTo(firstKeyId.replace("-", ""))
assertThat(actualIdentifier.recoveryKeyReference).isEqualTo(secondKeyId.replace("-", ""))
@ -100,8 +100,8 @@ class IdentifierCreatorTest {
every { keyStore.getKey(Constants.MAIN_IDENTIFIER_REFERENCE) } returns OctetSequenceKey.Builder(masterSeed).build()
val actualIdentifier = identifierCreator.createPairwiseId(masterIdentifier, "randomDid")
val expectedDid =
"did:ion:EiDm_INb-7RpbbbiftnuCXt033w6UCLiL7aUEZRSEtaydA:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJzZWNwMjU2azEiLCJraWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsImt0eSI6IkVDIiwieCI6IkJCdkxxSkNyeWJoLUJhV1VOMDhLdG9ibUl4ME5SZUNCQTVDWDhKTzI0ZXciLCJ5IjoiaUJVM1A2TGt4VTJKb0Y3MnpFTEprUjdEZmxJLWNtN1F1aHBMZEZCTXJCYyJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiRWNkc2FTZWNwMjU2azFWZXJpZmljYXRpb25LZXkyMDE5In1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlDYllJcEJTaVU5dFVlOS1GdWd3Ti1MWmxPQS03dGlOWThHWWJUejFXY3JQdyJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpQW96Ty1JcGQ5SFFESjNOaUtVaF92UnVoc3JDX0ctbUR3QjExMjlQN1N6Z2ciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUJDYy1HQmt0NXo0Y1FXQUhHc1RFM3FocktxZG1nM0NyWDY1cEhWNVVBeDFBIn19"
val expectedPairwiseName = "q9eFTKE8MG8LO_YzDIgmGw"
"did:ion:EiAOWWLKPjQuCfLtolMIPU9Sgtxp68OxL_lBaUWbquEyqQ:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsInB1YmxpY0tleUp3ayI6eyJjcnYiOiJzZWNwMjU2azEiLCJraWQiOiI2NTA2YWE2NzFhNTE0MmEwYTE4NzU0NDJiM2QxY2QyNSIsImt0eSI6IkVDIiwidXNlIjoic2lnIiwieCI6IjdPZF8tSFY0OXhuMlgxY1g3VE9FdmJrTHVyc0dIZHhoanZmck1QdGhDbjQiLCJ5IjoidzNtbHZMUnJXSjV0N1FObUFVN0tJWTRzNnBjUkRIMEpEdUlGR29NSmNmQSJ9LCJwdXJwb3NlcyI6WyJhdXRoZW50aWNhdGlvbiJdLCJ0eXBlIjoiRWNkc2FTZWNwMjU2azFWZXJpZmljYXRpb25LZXkyMDE5In1dfX1dLCJ1cGRhdGVDb21taXRtZW50IjoiRWlESWI4V0xGRjZiQXYyTFcyalhhUllJTXNrdW1rTkxHbW9YZVBqLTJwbUQxdyJ9LCJzdWZmaXhEYXRhIjp7ImRlbHRhSGFzaCI6IkVpRGFENk9wZXZKLWItNHBHZmhoSmdld3JfMVl5RmZJRFBkYS1zWmJDTDFUaWciLCJyZWNvdmVyeUNvbW1pdG1lbnQiOiJFaUNoLS1fZ1dIa0plX3FKdFV3WGJ5anE0QWhmZWViTGVJc2g3dWxkWUtLSXJ3In19"
val expectedPairwiseName = "jDgUbT04B8KF2TNjWlu1YA"
assertThat(actualIdentifier.id).isEqualTo(expectedDid)
assertThat(actualIdentifier.signatureKeyReference).isEqualTo(firstKeyId.replace("-", ""))
assertThat(actualIdentifier.recoveryKeyReference).isEqualTo(secondKeyId.replace("-", ""))