forked from turt2live/matrix-bot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unusable until the rust-sdk has Node bindings for key backups
- Loading branch information
1 parent
bb93184
commit 74f8864
Showing
4 changed files
with
159 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Signatures } from "./Crypto"; | ||
|
||
/** | ||
* The kinds of key backup encryption algorithms allowed by the spec. | ||
* @category Models | ||
*/ | ||
export enum KeyBackupEncryptionAlgorithm { | ||
MegolmBackupV1Curve25519AesSha2 = "m.megolm_backup.v1.curve25519-aes-sha2", | ||
} | ||
|
||
/** | ||
* Information about a server-side key backup. | ||
*/ | ||
export interface IKeyBackupInfo { | ||
algorithm: string | KeyBackupEncryptionAlgorithm; | ||
auth_data: object; | ||
} | ||
|
||
export type KeyBackupVersion = string; | ||
|
||
export interface IKeyBackupVersion { | ||
version: KeyBackupVersion; | ||
} | ||
|
||
export interface IKeyBackupInfoRetrieved extends IKeyBackupInfo, IKeyBackupVersion { | ||
count: number; | ||
etag: string; | ||
} | ||
|
||
export type IKeyBackupInfoUpdate = IKeyBackupInfo & Partial<IKeyBackupVersion>; | ||
|
||
export interface ICurve25519AuthDataUnsigned { | ||
public_key: string; | ||
} | ||
|
||
export type ICurve25519AuthData = ICurve25519AuthDataUnsigned & Signatures; |