File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
crates/matrix-sdk-crypto/src/backups Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ impl MegolmV1BackupKey {
63
63
key
64
64
}
65
65
66
+ /// Get the full name of the backup algorithm this backup key supports.
67
+ pub fn backup_algorithm ( & self ) -> & str {
68
+ "m.megolm_backup.v1.curve25519-aes-sha2"
69
+ }
70
+
66
71
/// Get all the signatures of this `MegolmV1BackupKey`.
67
72
pub fn signatures ( & self ) -> BTreeMap < UserId , BTreeMap < DeviceKeyId , String > > {
68
73
self . inner . signatures . to_owned ( )
Original file line number Diff line number Diff line change @@ -228,8 +228,8 @@ impl RecoveryKey {
228
228
. expect ( "Can't generate a libom PkDecryption object from our private key" )
229
229
}
230
230
231
- /// Extract the public key from this `RecoveryKey`.
232
- pub fn public_key ( & self ) -> MegolmV1BackupKey {
231
+ /// Extract the megolm.v1 public key from this `RecoveryKey`.
232
+ pub fn megolm_v1_public_key ( & self ) -> MegolmV1BackupKey {
233
233
let pk = self . get_pk_decrytpion ( ) ;
234
234
let public_key = MegolmV1BackupKey :: new ( pk. public_key ( ) , None ) ;
235
235
public_key
Original file line number Diff line number Diff line change @@ -417,7 +417,7 @@ mod test {
417
417
assert_eq ! ( counts. backed_up, 0 , "No room keys have been backed up yet" ) ;
418
418
419
419
let recovery_key = RecoveryKey :: new ( ) . expect ( "Can't create new recovery key" ) ;
420
- let backup_key = recovery_key. public_key ( ) ;
420
+ let backup_key = recovery_key. megolm_v1_public_key ( ) ;
421
421
backup_key. set_version ( "1" . to_owned ( ) ) ;
422
422
423
423
backup_machine. enable_backup_v1 ( backup_key) . await ?;
You can’t perform that action at this time.
0 commit comments