All URIs are relative to http://localhost/ejbca/ejbca-rest-api
Method | HTTP request | Description |
---|---|---|
createCrl | POST /v1/ca/{issuer_dn}/createcrl | Create CRL(main, partition and delta) issued by this CA |
getCertificateAsPem | GET /v1/ca/{subject_dn}/certificate/download | Get PEM file with the active CA certificate chain |
getLatestCrl | GET /v1/ca/{issuer_dn}/getLatestCrl | Returns the latest CRL issued by this CA |
importCrl | POST /v1/ca/{issuer_dn}/importcrl | Import a certificate revocation list (CRL) for a CA |
listCas | GET /v1/ca | Returns the Response containing the list of CAs with general information per CA as Json |
status1 | GET /v1/ca/status | Get the status of this REST Resource |
CreateCrlRestResponse createCrl(issuerDn, deltacrl)
Create CRL(main, partition and delta) issued by this CA
// Import classes:
import com.keyfactor.ejbca.client.ApiClient;
import com.keyfactor.ejbca.client.ApiException;
import com.keyfactor.ejbca.client.Configuration;
import com.keyfactor.ejbca.client.model.*;
import com.keyfactor.ejbca.client.api.V1CaApi;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) {
// Set base path to EJBCA REST API
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost/ejbca/ejbca-rest-api");
// Retrieve client certificate and key
Path cert = Paths.get("path/to/clientcertificate");
Path key = Paths.get("path/to/key");
defaultClient.setClientCert(cert, key);
V1CaApi apiInstance = new V1CaApi(defaultClient);
String issuerDn = "issuerDn_example"; // String | the CRL issuers DN (CAs subject DN)
Boolean deltacrl = false; // Boolean | true to also create the deltaCRL, false to only create the base CRL
try {
CreateCrlRestResponse result = apiInstance.createCrl(issuerDn, deltacrl);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling V1CaApi#createCrl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
issuerDn | String | the CRL issuers DN (CAs subject DN) | |
deltacrl | Boolean | true to also create the deltaCRL, false to only create the base CRL | [optional] [default to false] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
getCertificateAsPem(subjectDn)
Get PEM file with the active CA certificate chain
// Import classes:
import com.keyfactor.ejbca.client.ApiClient;
import com.keyfactor.ejbca.client.ApiException;
import com.keyfactor.ejbca.client.Configuration;
import com.keyfactor.ejbca.client.model.*;
import com.keyfactor.ejbca.client.api.V1CaApi;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) {
// Set base path to EJBCA REST API
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost/ejbca/ejbca-rest-api");
// Retrieve client certificate and key
Path cert = Paths.get("path/to/clientcertificate");
Path key = Paths.get("path/to/key");
defaultClient.setClientCert(cert, key);
V1CaApi apiInstance = new V1CaApi(defaultClient);
String subjectDn = "subjectDn_example"; // String | CAs subject DN
try {
apiInstance.getCertificateAsPem(subjectDn);
} catch (ApiException e) {
System.err.println("Exception when calling V1CaApi#getCertificateAsPem");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
subjectDn | String | CAs subject DN |
null (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
0 | successful operation | - |
CrlRestResponse getLatestCrl(issuerDn, deltaCrl, crlPartitionIndex)
Returns the latest CRL issued by this CA
// Import classes:
import com.keyfactor.ejbca.client.ApiClient;
import com.keyfactor.ejbca.client.ApiException;
import com.keyfactor.ejbca.client.Configuration;
import com.keyfactor.ejbca.client.model.*;
import com.keyfactor.ejbca.client.api.V1CaApi;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) {
// Set base path to EJBCA REST API
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost/ejbca/ejbca-rest-api");
// Retrieve client certificate and key
Path cert = Paths.get("path/to/clientcertificate");
Path key = Paths.get("path/to/key");
defaultClient.setClientCert(cert, key);
V1CaApi apiInstance = new V1CaApi(defaultClient);
String issuerDn = "issuerDn_example"; // String | the CRL issuers DN (CAs subject DN)
Boolean deltaCrl = false; // Boolean | true to get the latest deltaCRL, false to get the latest complete CRL
Integer crlPartitionIndex = 0; // Integer | the CRL partition index
try {
CrlRestResponse result = apiInstance.getLatestCrl(issuerDn, deltaCrl, crlPartitionIndex);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling V1CaApi#getLatestCrl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
issuerDn | String | the CRL issuers DN (CAs subject DN) | |
deltaCrl | Boolean | true to get the latest deltaCRL, false to get the latest complete CRL | [optional] [default to false] |
crlPartitionIndex | Integer | the CRL partition index | [optional] [default to 0] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
importCrl(issuerDn, crlFile, crlPartitionIndex)
Import a certificate revocation list (CRL) for a CA
// Import classes:
import com.keyfactor.ejbca.client.ApiClient;
import com.keyfactor.ejbca.client.ApiException;
import com.keyfactor.ejbca.client.Configuration;
import com.keyfactor.ejbca.client.model.*;
import com.keyfactor.ejbca.client.api.V1CaApi;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) {
// Set base path to EJBCA REST API
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost/ejbca/ejbca-rest-api");
// Retrieve client certificate and key
Path cert = Paths.get("path/to/clientcertificate");
Path key = Paths.get("path/to/key");
defaultClient.setClientCert(cert, key);
V1CaApi apiInstance = new V1CaApi(defaultClient);
String issuerDn = "issuerDn_example"; // String | the CRL issuers DN (CAs subject DN)
File crlFile = new File("/path/to/file"); // File | CRL file in DER format
Integer crlPartitionIndex = 0; // Integer | CRL partition index
try {
apiInstance.importCrl(issuerDn, crlFile, crlPartitionIndex);
} catch (ApiException e) {
System.err.println("Exception when calling V1CaApi#importCrl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
issuerDn | String | the CRL issuers DN (CAs subject DN) | |
crlFile | File | CRL file in DER format | [optional] |
crlPartitionIndex | Integer | CRL partition index | [optional] [default to 0] |
null (empty response body)
No authorization required
- Content-Type: multipart/form-data
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | CRL file was imported successfully | - |
400 | Error while importing CRL file | - |
CaInfosRestResponse listCas()
Returns the Response containing the list of CAs with general information per CA as Json
Returns the Response containing the list of CAs with general information per CA as Json
// Import classes:
import com.keyfactor.ejbca.client.ApiClient;
import com.keyfactor.ejbca.client.ApiException;
import com.keyfactor.ejbca.client.Configuration;
import com.keyfactor.ejbca.client.model.*;
import com.keyfactor.ejbca.client.api.V1CaApi;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) {
// Set base path to EJBCA REST API
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost/ejbca/ejbca-rest-api");
// Retrieve client certificate and key
Path cert = Paths.get("path/to/clientcertificate");
Path key = Paths.get("path/to/key");
defaultClient.setClientCert(cert, key);
V1CaApi apiInstance = new V1CaApi(defaultClient);
try {
CaInfosRestResponse result = apiInstance.listCas();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling V1CaApi#listCas");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
RestResourceStatusRestResponse status1()
Get the status of this REST Resource
Returns status, API version and EJBCA version.
// Import classes:
import com.keyfactor.ejbca.client.ApiClient;
import com.keyfactor.ejbca.client.ApiException;
import com.keyfactor.ejbca.client.Configuration;
import com.keyfactor.ejbca.client.model.*;
import com.keyfactor.ejbca.client.api.V1CaApi;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) {
// Set base path to EJBCA REST API
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost/ejbca/ejbca-rest-api");
// Retrieve client certificate and key
Path cert = Paths.get("path/to/clientcertificate");
Path key = Paths.get("path/to/key");
defaultClient.setClientCert(cert, key);
V1CaApi apiInstance = new V1CaApi(defaultClient);
try {
RestResourceStatusRestResponse result = apiInstance.status1();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling V1CaApi#status1");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
RestResourceStatusRestResponse
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |