Interface EncryptionApi


  • @Path("/_matrix/client/r0/keys")
    @Consumes("application/json")
    @Produces("application/json")
    public interface EncryptionApi
    Matrix optionally supports end-to-end encryption, allowing rooms to be created whose conversation contents is not decryptable or interceptable on any of the participating homeservers.
    • Method Summary

      Modifier and Type Method Description
      void changes​(String from, String to, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Gets a list of users who have updated their device identity keys since a previous sync token.
      void claim​(ClaimRequest claimRequest, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Claims one-time keys for use in pre-key messages.
      void query​(QueryRequest queryRequest, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Returns the current devices and identity keys for the given users.
      void uploadKey​(UploadRequest uploadRequest, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse, javax.ws.rs.core.SecurityContext securityContext)
      Publishes end-to-end encryption keys for the device.
    • Method Detail

      • uploadKey

        @POST
        @Path("/upload")
        void uploadKey​(UploadRequest uploadRequest,
                       @Context
                       javax.ws.rs.core.UriInfo uriInfo,
                       @Context
                       javax.ws.rs.core.HttpHeaders httpHeaders,
                       @Suspended
                       javax.ws.rs.container.AsyncResponse asyncResponse,
                       @Context
                       javax.ws.rs.core.SecurityContext securityContext)
        Publishes end-to-end encryption keys for the device.
        Requires auth: Yes.
        Return: UploadResponse.

        Status code 200: The provided keys were sucessfully uploaded.

        Parameters:
        uploadRequest - JSON body parameters.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • query

        @POST
        @Path("/query")
        void query​(QueryRequest queryRequest,
                   @Context
                   javax.ws.rs.core.UriInfo uriInfo,
                   @Context
                   javax.ws.rs.core.HttpHeaders httpHeaders,
                   @Suspended
                   javax.ws.rs.container.AsyncResponse asyncResponse,
                   @Context
                   javax.ws.rs.core.SecurityContext securityContext)
        Returns the current devices and identity keys for the given users.
        Requires auth: Yes.
        Return: QueryResponse.

        Status code 200: The device information.

        Parameters:
        queryRequest - JSON body parameters.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • claim

        @POST
        @Path("/claim")
        void claim​(ClaimRequest claimRequest,
                   @Context
                   javax.ws.rs.core.UriInfo uriInfo,
                   @Context
                   javax.ws.rs.core.HttpHeaders httpHeaders,
                   @Suspended
                   javax.ws.rs.container.AsyncResponse asyncResponse,
                   @Context
                   javax.ws.rs.core.SecurityContext securityContext)
        Claims one-time keys for use in pre-key messages.
        Requires auth: Yes.
        Return: ClaimResponse.

        Status code 200: The claimed keys.

        Parameters:
        claimRequest - JSON body parameters.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.
      • changes

        @GET
        @Path("/changes")
        void changes​(@QueryParam("from")
                     String from,
                     @QueryParam("to")
                     String to,
                     @Context
                     javax.ws.rs.core.UriInfo uriInfo,
                     @Context
                     javax.ws.rs.core.HttpHeaders httpHeaders,
                     @Suspended
                     javax.ws.rs.container.AsyncResponse asyncResponse,
                     @Context
                     javax.ws.rs.core.SecurityContext securityContext)
        Gets a list of users who have updated their device identity keys since a previous sync token.
        The server should include in the results any users who:
        • currently share a room with the calling user (ie, both users have membership state join); and
        • added new device identity keys or removed an existing device with identity keys, between from and to.
        Requires auth: Yes.
        Return: ChangesResponse.

        Status code 200: The list of users who updated their devices.

        Parameters:
        from - Required. The desired start point of the list. Should be the next_batch field from a response to an earlier call to /sync. Users who have not uploaded new device identity keys since this point, nor deleted existing devices with identity keys since then, will be excluded from the results.
        to - Required. The desired end point of the list. Should be the next_batch field from a recent call to /sync - typically the most recent such call. This may be used by the server as a hint to check its caches are up to date.
        uriInfo - Request Information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
        securityContext - Security context.