Skip to content

Commit c1b3e5c

Browse files
committed
chore: revert to keyUri on callbacks
1 parent ff0980e commit c1b3e5c

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/messaging/MessageEnvelope.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function decrypt(
9191
peerPublicKey,
9292
data: hexToU8a(ciphertext),
9393
nonce: hexToU8a(nonce),
94-
verificationMethod: receiverKeyUri,
94+
keyUri: receiverKeyUri,
9595
})
9696
).data
9797
} catch (cause) {
@@ -174,7 +174,7 @@ export async function encrypt(
174174
receivedAt: message.receivedAt,
175175
ciphertext,
176176
nonce,
177-
senderKeyUri: encrypted.verificationMethod,
177+
senderKeyUri: encrypted.keyUri,
178178
receiverKeyUri,
179179
}
180180
}

src/messaging/interface/session/Session.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe('Session', () => {
124124
data: encryptedChallenge,
125125
nonce: nonce,
126126
peerPublicKey: bobEncKey.keyAgreement[0].publicKey,
127-
verificationMethod: sessionRequest.encryptionKeyUri,
127+
keyUri: sessionRequest.encryptionKeyUri,
128128
})
129129
const decryptedChallenge = u8aToString(decryptedChallengeBytes.data)
130130
expect(decryptedChallenge).toBe(challenge)

src/messaging/interface/session/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export async function verifySession(
9090
data: encryptedChallenge,
9191
nonce,
9292
peerPublicKey: Did.multibaseKeyToDidKey((encryptionKey as VerificationMethod).publicKeyMultibase).publicKey,
93-
verificationMethod: encryptionKeyUri,
93+
keyUri: encryptionKeyUri,
9494
})
9595

9696
const decryptedChallenge = u8aToString(decryptedBytes.data)

src/tests/messageUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export function makeEncryptCallback({ secretKey }: KiltEncryptionKeypair): Encry
155155
// encrypted data
156156
data: box,
157157
// used did key uri for encryption.
158-
verificationMethod: `${didDocument.id}${keyId}`,
158+
keyUri: `${didDocument.id}${keyId}`,
159159
}
160160
}
161161
}

src/types/Message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export interface EncryptResponseData {
254254
/**
255255
* The DID verification method used for the encryption.
256256
*/
257-
verificationMethod: DidUrl
257+
keyUri: DidUrl
258258
}
259259

260260
/**
@@ -283,7 +283,7 @@ export interface DecryptRequestData {
283283
/**
284284
* The DID verification method, which should be used for decryption.
285285
*/
286-
verificationMethod: DidUrl
286+
keyUri: DidUrl
287287
}
288288

289289
export interface DecryptResponseData {

0 commit comments

Comments
 (0)