public class ClientAttributeCertificateResource extends Object
Modifier and Type | Field and Description |
---|---|
protected AdminEventBuilder |
adminEvent |
protected String |
attributePrefix |
static String |
CERTIFICATE_PEM |
protected ClientModel |
client |
static String |
JSON_WEB_KEY_SET |
static String |
PUBLIC_KEY_PEM |
protected RealmModel |
realm |
protected KeycloakSession |
session |
Constructor and Description |
---|
ClientAttributeCertificateResource(RealmModel realm,
AdminPermissionEvaluator 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(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
Upload certificate and eventually private key
|
CertificateRepresentation |
uploadJksCertificate(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input)
Upload only certificate, not private key
|
public static final String CERTIFICATE_PEM
public static final String PUBLIC_KEY_PEM
public static final String JSON_WEB_KEY_SET
protected RealmModel realm
protected ClientModel client
protected KeycloakSession session
protected AdminEventBuilder adminEvent
protected String attributePrefix
public ClientAttributeCertificateResource(RealmModel realm, AdminPermissionEvaluator 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(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input) throws IOException
input
- IOException
@POST @Path(value="upload-certificate") @Consumes(value="multipart/form-data") @Produces(value="application/json") public CertificateRepresentation uploadJksCertificate(org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput input) throws IOException
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 © 2019 JBoss by Red Hat. All rights reserved.