LocalKeys returns the local keys for the server. See https://matrix.org/docs/spec/server_server/unstable.html#publishing-keys
(cfg *config.FederationAPI)
| 131 | // LocalKeys returns the local keys for the server. |
| 132 | // See https://matrix.org/docs/spec/server_server/unstable.html#publishing-keys |
| 133 | func LocalKeys(cfg *config.FederationAPI) util.JSONResponse { |
| 134 | keys, err := localKeys(cfg, time.Now().Add(cfg.Matrix.KeyValidityPeriod)) |
| 135 | if err != nil { |
| 136 | return util.ErrorResponse(err) |
| 137 | } |
| 138 | return util.JSONResponse{Code: http.StatusOK, JSON: keys} |
| 139 | } |
| 140 | |
| 141 | func localKeys(cfg *config.FederationAPI, validUntil time.Time) (*gomatrixserverlib.ServerKeys, error) { |
| 142 | var keys gomatrixserverlib.ServerKeys |