diff options
author | RaindropsSys <raindrops@equestria.dev> | 2023-11-17 23:25:29 +0100 |
---|---|---|
committer | RaindropsSys <raindrops@equestria.dev> | 2023-11-17 23:25:29 +0100 |
commit | 953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch) | |
tree | 8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/olmlib.d.ts | |
parent | 62a9199846b0c07c03218703b33e8385764f42d9 (diff) | |
download | pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2 pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip |
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/olmlib.d.ts')
-rw-r--r-- | includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/olmlib.d.ts | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/olmlib.d.ts b/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/olmlib.d.ts deleted file mode 100644 index 18ee3c9..0000000 --- a/includes/external/matrix/node_modules/matrix-js-sdk/lib/crypto/olmlib.d.ts +++ /dev/null @@ -1,146 +0,0 @@ -import type { PkSigning } from "@matrix-org/olm"; -import type { IOneTimeKey } from "../@types/crypto"; -import { OlmDevice } from "./OlmDevice"; -import { DeviceInfo } from "./deviceinfo"; -import { MatrixClient } from "../client"; -import { ISignatures } from "../@types/signed"; -import { MatrixEvent } from "../models/event"; -import { IMessage } from "./algorithms/olm"; -declare enum Algorithm { - Olm = "m.olm.v1.curve25519-aes-sha2", - Megolm = "m.megolm.v1.aes-sha2", - MegolmBackup = "m.megolm_backup.v1.curve25519-aes-sha2" -} -/** - * matrix algorithm tag for olm - */ -export declare const OLM_ALGORITHM = Algorithm.Olm; -/** - * matrix algorithm tag for megolm - */ -export declare const MEGOLM_ALGORITHM = Algorithm.Megolm; -/** - * matrix algorithm tag for megolm backups - */ -export declare const MEGOLM_BACKUP_ALGORITHM = Algorithm.MegolmBackup; -export interface IOlmSessionResult { - /** device info */ - device: DeviceInfo; - /** base64 olm session id; null if no session could be established */ - sessionId: string | null; -} -/** - * Encrypt an event payload for an Olm device - * - * @param resultsObject - The `ciphertext` property - * of the m.room.encrypted event to which to add our result - * - * @param olmDevice - olm.js wrapper - * @param payloadFields - fields to include in the encrypted payload - * - * Returns a promise which resolves (to undefined) when the payload - * has been encrypted into `resultsObject` - */ -export declare function encryptMessageForDevice(resultsObject: Record<string, IMessage>, ourUserId: string, ourDeviceId: string | undefined, olmDevice: OlmDevice, recipientUserId: string, recipientDevice: DeviceInfo, payloadFields: Record<string, any>): Promise<void>; -interface IExistingOlmSession { - device: DeviceInfo; - sessionId: string | null; -} -/** - * Get the existing olm sessions for the given devices, and the devices that - * don't have olm sessions. - * - * - * - * @param devicesByUser - map from userid to list of devices to ensure sessions for - * - * @returns resolves to an array. The first element of the array is a - * a map of user IDs to arrays of deviceInfo, representing the devices that - * don't have established olm sessions. The second element of the array is - * a map from userId to deviceId to {@link OlmSessionResult} - */ -export declare function getExistingOlmSessions(olmDevice: OlmDevice, baseApis: MatrixClient, devicesByUser: Record<string, DeviceInfo[]>): Promise<[Map<string, DeviceInfo[]>, Map<string, Map<string, IExistingOlmSession>>]>; -/** - * Try to make sure we have established olm sessions for the given devices. - * - * @param devicesByUser - map from userid to list of devices to ensure sessions for - * - * @param force - If true, establish a new session even if one - * already exists. - * - * @param otkTimeout - The timeout in milliseconds when requesting - * one-time keys for establishing new olm sessions. - * - * @param failedServers - An array to fill with remote servers that - * failed to respond to one-time-key requests. - * - * @param log - A possibly customised log - * - * @returns resolves once the sessions are complete, to - * an Object mapping from userId to deviceId to - * {@link OlmSessionResult} - */ -export declare function ensureOlmSessionsForDevices(olmDevice: OlmDevice, baseApis: MatrixClient, devicesByUser: Map<string, DeviceInfo[]>, force?: boolean, otkTimeout?: number, failedServers?: string[], log?: import("../logger").PrefixedLogger): Promise<Map<string, Map<string, IOlmSessionResult>>>; -export interface IObject { - unsigned?: object; - signatures?: ISignatures; -} -/** - * Verify the signature on an object - * - * @param olmDevice - olm wrapper to use for verify op - * - * @param obj - object to check signature on. - * - * @param signingUserId - ID of the user whose signature should be checked - * - * @param signingDeviceId - ID of the device whose signature should be checked - * - * @param signingKey - base64-ed ed25519 public key - * - * Returns a promise which resolves (to undefined) if the the signature is good, - * or rejects with an Error if it is bad. - */ -export declare function verifySignature(olmDevice: OlmDevice, obj: IOneTimeKey | IObject, signingUserId: string, signingDeviceId: string, signingKey: string): Promise<void>; -/** - * Sign a JSON object using public key cryptography - * @param obj - Object to sign. The object will be modified to include - * the new signature - * @param key - the signing object or the private key - * seed - * @param userId - The user ID who owns the signing key - * @param pubKey - The public key (ignored if key is a seed) - * @returns the signature for the object - */ -export declare function pkSign(obj: object & IObject, key: Uint8Array | PkSigning, userId: string, pubKey: string): string; -/** - * Verify a signed JSON object - * @param obj - Object to verify - * @param pubKey - The public key to use to verify - * @param userId - The user ID who signed the object - */ -export declare function pkVerify(obj: IObject, pubKey: string, userId: string): void; -/** - * Check that an event was encrypted using olm. - */ -export declare function isOlmEncrypted(event: MatrixEvent): boolean; -/** - * Encode a typed array of uint8 as base64. - * @param uint8Array - The data to encode. - * @returns The base64. - */ -export declare function encodeBase64(uint8Array: ArrayBuffer | Uint8Array): string; -/** - * Encode a typed array of uint8 as unpadded base64. - * @param uint8Array - The data to encode. - * @returns The unpadded base64. - */ -export declare function encodeUnpaddedBase64(uint8Array: ArrayBuffer | Uint8Array): string; -/** - * Decode a base64 string to a typed array of uint8. - * @param base64 - The base64 to decode. - * @returns The decoded data. - */ -export declare function decodeBase64(base64: string): Uint8Array; -export {}; -//# sourceMappingURL=olmlib.d.ts.map
\ No newline at end of file |