Interface KeyManagementApi


  • @Path("/_matrix/identity/api/v1/pubkey")
    @Produces("application/json")
    public interface KeyManagementApi
    An identity service has some long-term public-private keypairs. These are named in a scheme algorithm:identifier, e.g. ed25519:0. When signing an association, the standard Signing JSON algorithm applies.
    The identity server may also keep track of some short-term public-private keypairs, which may have different usage and lifetime characteristics than the service's long-term keys.
    • Method Summary

      Modifier and Type Method Description
      void ephemeralValid​(String publicKey, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Check whether a short-term public key is valid.
      void get​(String keyId, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Get the public key for the passed key ID.
      void valid​(String publicKey, javax.ws.rs.core.UriInfo uriInfo, javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.container.AsyncResponse asyncResponse)
      Check whether a long-term public key is valid.
    • Method Detail

      • get

        @GET
        @Path("/{keyId}")
        void get​(@PathParam("keyId")
                 String keyId,
                 @Context
                 javax.ws.rs.core.UriInfo uriInfo,
                 @Context
                 javax.ws.rs.core.HttpHeaders httpHeaders,
                 @Suspended
                 javax.ws.rs.container.AsyncResponse asyncResponse)
        Get the public key for the passed key ID.
        Return: PublicKeyResponse.

        Status code 200: The public key exists.

        Status code 404: The public key was not found.

        Parameters:
        keyId - Required. The ID of the key. This should take the form algorithm:identifier where algorithm identifies the signing algorithm, and the identifier is an opaque string.
        uriInfo - Request information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • valid

        @GET
        @Path("/isvalid")
        void valid​(@QueryParam("public_key")
                   String publicKey,
                   @Context
                   javax.ws.rs.core.UriInfo uriInfo,
                   @Context
                   javax.ws.rs.core.HttpHeaders httpHeaders,
                   @Suspended
                   javax.ws.rs.container.AsyncResponse asyncResponse)
        Check whether a long-term public key is valid. The response should always be the same, provided the key exists.
        Return: KeyValidationResponse.

        Status code 200: The validity of the public key.

        Parameters:
        publicKey - Required. The unpadded base64-encoded public key to check.
        uriInfo - Request information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.
      • ephemeralValid

        @GET
        @Path("/ephemeral/isvalid")
        void ephemeralValid​(@QueryParam("public_key")
                            String publicKey,
                            @Context
                            javax.ws.rs.core.UriInfo uriInfo,
                            @Context
                            javax.ws.rs.core.HttpHeaders httpHeaders,
                            @Suspended
                            javax.ws.rs.container.AsyncResponse asyncResponse)
        Check whether a short-term public key is valid.
        Return: KeyValidationResponse.

        Status code 200: Whether the public key is recognised and is currently valid.

        Parameters:
        publicKey - Required. The unpadded base64-encoded public key to check.
        uriInfo - Request information.
        httpHeaders - Http headers.
        asyncResponse - Asynchronous response.