MCPcopy Create free account
hub / github.com/CommE2E/comm / prepareLargeNotifData

Function prepareLargeNotifData

lib/push/crypto.js:631–650  ·  view source on GitHub ↗
(
  copyWithMessageInfos: string,
  encryptedNotifUtilsAPI: EncryptedNotifUtilsAPI,
)

Source from the content-addressed store, hash-verified

629}
630
631async function prepareLargeNotifData(
632 copyWithMessageInfos: string,
633 encryptedNotifUtilsAPI: EncryptedNotifUtilsAPI,
634): Promise<LargeNotifEncryptionResult> {
635 const encryptionKey = await encryptedNotifUtilsAPI.generateAESKey();
636 const encryptedCopyWithMessageInfos =
637 await encryptedNotifUtilsAPI.encryptWithAESKey(
638 encryptionKey,
639 copyWithMessageInfos,
640 );
641 const blobHash = await encryptedNotifUtilsAPI.getBlobHash(
642 encryptedCopyWithMessageInfos,
643 );
644 const blobHashBase64url = toBase64URL(blobHash);
645 return {
646 blobHash: blobHashBase64url,
647 encryptedCopyWithMessageInfos,
648 encryptionKey,
649 };
650}
651
652export {
653 prepareEncryptedAPNsVisualNotifications,

Callers 2

Calls 1

toBase64URLFunction · 0.90

Tested by

no test coverage detected