Put Client Certificate Operation
-
Use
PutClientCertificateOperation
to register an existing client certificate. -
To register an existing client certificate from the Studio, see Upload an existing client certificate.
-
In this article:
Put client certificate example
byte[] rawCert = Files.readAllBytes(Paths.get("<path-to-certificate.crt>"));
String certificateAsBase64 = Base64.getEncoder().encodeToString(rawCert);
store.maintenance().server().send(
new PutClientCertificateOperation(
"certificateName",
certificateAsBase64,
new HashMap<>(),
SecurityClearance.CLUSTER_ADMIN));
Syntax
public PutClientCertificateOperation(String name,
String certificate,
Map<String, DatabaseAccess> permissions,
SecurityClearance clearance)
Parameter | Type | Description |
---|---|---|
name | String |
A name for the certificate. |
certificate | String |
The certificate to register. |
permissions | Map<String, DatabaseAccess> |
A dictionary mapping database name to access level. Relevant only when clearance is VALID_USER . |
clearance | SecurityClearance |
Access level (role) assigned to the certificate. |
public enum SecurityClearance {
CLUSTER_ADMIN,
CLUSTER_NODE,
OPERATOR,
VALID_USER
}
public enum DatabaseAccess {
READ,
READ_WRITE,
ADMIN
}