Skip to main content

verify_policy_server_signature

Function verify_policy_server_signature 

Source
pub fn verify_policy_server_signature(
    room_policy: &RoomPolicyEventContent,
    object: &BTreeMap<String, CanonicalJsonValue>,
    rules: &RoomVersionRules,
) -> Result<(), VerificationError>
Available on crate feature signatures only.
Expand description

Verify that the given event has a valid signature from the given policy server.

If the event is an m.room.policy event with an empty state_key string, this function succeeds without checking the signature.

For other cases, this returns an error if the signature is missing or invalid.

§Parameters

  • room_policy: The content of the m.room.policy event in the current state of the room. If there is no m.room.policy event in the state of the room or it is invalid, it is assumed that the room has no policy server so this function should not be called to check for the policy server signature.
  • object: The JSON object of the event that was signed.
  • rules: The rules of the version of the event’s room.