Class ClientAttributeCertificateResource


  • public class ClientAttributeCertificateResource
    extends Object
    Version:
    $Revision: 1 $
    Author:
    Bill Burke
    • Method Detail

      • generate

        @POST
        @Path("generate")
        @Produces("application/json")
        public CertificateRepresentation generate()
        Generate a new certificate with new key pair
        Returns:
      • uploadJks

        @POST
        @Path("upload")
        @Consumes("multipart/form-data")
        @Produces("application/json")
        public CertificateRepresentation uploadJks()
                                            throws IOException
        Upload certificate and eventually private key
        Parameters:
        input -
        Returns:
        Throws:
        IOException
      • uploadJksCertificate

        @POST
        @Path("upload-certificate")
        @Consumes("multipart/form-data")
        @Produces("application/json")
        public CertificateRepresentation uploadJksCertificate()
                                                       throws IOException
        Upload only certificate, not private key
        Parameters:
        input -
        Returns:
        information extracted from uploaded certificate - not necessarily the new state of certificate on the server
        Throws:
        IOException
      • getKeystore

        @POST
        @Path("/download")
        @Produces("application/octet-stream")
        @Consumes("application/json")
        public byte[] getKeystore​(KeyStoreConfig config)
        Get a keystore file for the client, containing private key and public certificate
        Parameters:
        config - Keystore configuration as JSON
        Returns:
      • generateAndGetKeystore

        @POST
        @Path("/generate-and-download")
        @Produces("application/octet-stream")
        @Consumes("application/json")
        public byte[] generateAndGetKeystore​(KeyStoreConfig config)
        Generate a new keypair and certificate, and get the private key file Generates a keypair and certificate and serves the private key in a specified keystore format. Only generated public certificate is saved in Keycloak DB - the private key is not.
        Parameters:
        config - Keystore configuration as JSON
        Returns: