Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33307618
D12340.1768798752.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12340.1768798752.diff
View Options
diff --git a/services/commtest/src/identity/olm_account_infos.rs b/services/commtest/src/identity/olm_account_infos.rs
--- a/services/commtest/src/identity/olm_account_infos.rs
+++ b/services/commtest/src/identity/olm_account_infos.rs
@@ -16,11 +16,32 @@
}
impl ClientPublicKeys {
+ /// Generates random keys with given `ed25519` primary account
+ /// signing public key. Use [`ClientPublicKeys::default`] for random key.
+ pub fn new(primary_signing_public_key: impl Into<String>) -> Self {
+ Self {
+ primary_identity_public_keys: IdentityPublicKeys {
+ ed25519: primary_signing_public_key.into(),
+ curve25519: generate_random_olm_key(),
+ },
+ notification_identity_public_keys: IdentityPublicKeys {
+ ed25519: generate_random_olm_key(),
+ curve25519: generate_random_olm_key(),
+ },
+ }
+ }
+
pub fn device_id(&self) -> String {
self.primary_identity_public_keys.ed25519.clone()
}
}
+impl Default for ClientPublicKeys {
+ fn default() -> Self {
+ Self::new(generate_random_olm_key())
+ }
+}
+
lazy_static! {
pub static ref DEFAULT_CLIENT_KEYS: ClientPublicKeys = ClientPublicKeys {
primary_identity_public_keys: IdentityPublicKeys {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 4:59 AM (14 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5954472
Default Alt Text
D12340.1768798752.diff (1 KB)
Attached To
Mode
D12340: [commtest] Add default impl for ClientPublicKeys
Attached
Detach File
Event Timeline
Log In to Comment