public class ClientAttributeCertificateResource extends Object
Modifier and Type | Field and Description |
---|---|
protected AdminEventBuilder |
adminEvent |
protected String |
attributePrefix |
protected String |
certificateAttribute |
protected ClientModel |
client |
static String |
PRIVATE_KEY |
protected String |
privateAttribute |
protected RealmModel |
realm |
protected KeycloakSession |
session |
static String |
X509CERTIFICATE |
Constructor and Description |
---|
ClientAttributeCertificateResource(RealmModel realm,
RealmAuth auth,
ClientModel client,
KeycloakSession session,
String attributePrefix,
AdminEventBuilder adminEvent) |
Modifier and Type | Method and Description |
---|---|
CertificateRepresentation |
generate()
Generate a new certificate with new key pair
|
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.
|
CertificateRepresentation |
getKeyInfo()
Get key info
|
byte[] |
getKeystore(KeyStoreConfig config)
Get a keystore file for the client, containing private key and public certificate
|
CertificateRepresentation |
uploadJks(javax.ws.rs.core.UriInfo uriInfo,
org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
Upload certificate and eventually private key
|
CertificateRepresentation |
uploadJksCertificate(javax.ws.rs.core.UriInfo uriInfo,
org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
Upload only certificate, not private key
|
public static final String PRIVATE_KEY
public static final String X509CERTIFICATE
protected RealmModel realm
protected ClientModel client
protected KeycloakSession session
protected AdminEventBuilder adminEvent
protected String attributePrefix
protected String privateAttribute
protected String certificateAttribute
public ClientAttributeCertificateResource(RealmModel realm, RealmAuth auth, ClientModel client, KeycloakSession session, String attributePrefix, AdminEventBuilder adminEvent)
@GET @Produces(value="application/json") public CertificateRepresentation getKeyInfo()
@POST @Path(value="generate") @Produces(value="application/json") public CertificateRepresentation generate()
@POST @Path(value="upload") @Consumes(value="multipart/form-data") @Produces(value="application/json") public CertificateRepresentation uploadJks(@Context javax.ws.rs.core.UriInfo uriInfo, org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input) throws IOException
uriInfo
- input
- IOException
@POST @Path(value="upload-certificate") @Consumes(value="multipart/form-data") @Produces(value="application/json") public CertificateRepresentation uploadJksCertificate(@Context javax.ws.rs.core.UriInfo uriInfo, org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input) throws IOException
uriInfo
- input
- IOException
@POST @Path(value="/download") @Produces(value="application/octet-stream") @Consumes(value="application/json") public byte[] getKeystore(KeyStoreConfig config)
config
- Keystore configuration as JSON@POST @Path(value="/generate-and-download") @Produces(value="application/octet-stream") @Consumes(value="application/json") public byte[] generateAndGetKeystore(KeyStoreConfig config)
config
- Keystore configuration as JSONCopyright © 2016 JBoss by Red Hat. All rights reserved.