Changeset View
Changeset View
Standalone View
Standalone View
src/crypto/crypto.hpp
| Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | public: | ||||
| * @param k The key of the group session. | * @param k The key of the group session. | ||||
| * @param sessionKey The session key. | * @param sessionKey The session key. | ||||
| * @param ed25519Key The ed25519 identity key of the sender of the m.room_key event. | * @param ed25519Key The ed25519 identity key of the sender of the m.room_key event. | ||||
| * | * | ||||
| * @return true iff the session is created or updated. | * @return true iff the session is created or updated. | ||||
| */ | */ | ||||
| bool createInboundGroupSession(KeyOfGroupSession k, std::string sessionKey, std::string ed25519Key); | bool createInboundGroupSession(KeyOfGroupSession k, std::string sessionKey, std::string ed25519Key); | ||||
| /** | |||||
| * Import group sessions from json. | |||||
| * | |||||
| * This function first validates the format. If a key passes | |||||
| * format validation, this calls createInboundGroupSession. | |||||
| * | |||||
| * @param keys The json array of group session keys. In the | |||||
| * key-export format specified in the spec. | |||||
| * @return The number of keys successfully imported. | |||||
| */ | |||||
| std::size_t importInboundGroupSessions(const nlohmann::json &keys); | |||||
| bool hasInboundGroupSession(KeyOfGroupSession k) const; | bool hasInboundGroupSession(KeyOfGroupSession k) const; | ||||
| std::string outboundGroupSessionInitialKey(std::string roomId); | std::string outboundGroupSessionInitialKey(std::string roomId); | ||||
| std::string outboundGroupSessionCurrentKey(std::string roomId); | std::string outboundGroupSessionCurrentKey(std::string roomId); | ||||
| /// Check whether the signature of userId/deviceId is valid in object | /// Check whether the signature of userId/deviceId is valid in object | ||||
| bool verify(nlohmann::json object, std::string userId, std::string deviceId, std::string ed25519Key); | bool verify(nlohmann::json object, std::string userId, std::string deviceId, std::string ed25519Key); | ||||
| ▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines | |||||