Skip to main content

Module signatures

Module signatures 

Source
Expand description

Implements the signature upload endpoint (See https://spec.matrix.org/v1.16/client-server-api/#post_matrixclientv3keyssignaturesupload).

This endpoint is quite complex in that it requires many checks in order to be done properly. This is why it got its dedicated module.

StructsΒ§

SignatureError
Thrown when a signature is not valid
SignaturesComponent
Component implementing endpoints for signatures.
ValidSignature
Contains a signature to be inserted in the database.

EnumsΒ§

SignaturesUploadError πŸ”’

FunctionsΒ§

check_signing πŸ”’
Checks that a signature uploaded in upload_keys_signature is cryptographically correct.
new_failure πŸ”’
Helper function that generates a [upload_signatures::v3::Failure]. These are returned by the upload_keys_signature endpoint.
process_device_keys_signatures πŸ”’
This function is part of upload_keys_signature and processes signatures uploaded for device keys owned by the requester.
process_other_master_key_signatures πŸ”’
This function is part of upload_keys_signature and processes signatures uploaded for Master keys owned by other users.
process_self_master_key_signatures πŸ”’
This function is part of upload_keys_signature and processes signatures uploaded for the Master key owned by the requester.
separate_signatures πŸ”’
Separates the received signed keys into the three cases (See SignedKeysList and upload_keys_signature).
upload_signatures_handler πŸ”’
Handler for POST /_matrix/client/v3/keys/signatures/upload (See https://spec.matrix.org/v1.16/client-server-api/#post_matrixclientv3keyssignaturesupload).

Type AliasesΒ§

Failures πŸ”’
Map from user ID to a map from key ID (string) to failure.
SignedKeysList πŸ”’
Since there are three possible signatures being uploaded (See upload_keys_signature), we first separate the request’s signed objects into the three possible cases, and return a 3-tuple containing the uploaded keys for each cases: ( Key ID and signed device keys belonging to the requester, Key ID and Master key for the key owned by the requester, A map from user ID to a map of key ID to cross-signing key )