Certificate Management REST Interface

V1ca

getCertificateAsPem

Get PEM file with CA certificates


/v1/ca/{subject_dn}/certificate/download

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/ca/{subject_dn}/certificate/download"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1caApi;

import java.io.File;
import java.util.*;

public class V1caApiExample {

    public static void main(String[] args) {
        
        V1caApi apiInstance = new V1caApi();
        String subjectDn = subjectDn_example; // String | CAs subject DN
        try {
            apiInstance.getCertificateAsPem(subjectDn);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#getCertificateAsPem");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1caApi;

public class V1caApiExample {

    public static void main(String[] args) {
        V1caApi apiInstance = new V1caApi();
        String subjectDn = subjectDn_example; // String | CAs subject DN
        try {
            apiInstance.getCertificateAsPem(subjectDn);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#getCertificateAsPem");
            e.printStackTrace();
        }
    }
}
String *subjectDn = subjectDn_example; // CAs subject DN

V1caApi *apiInstance = [[V1caApi alloc] init];

// Get PEM file with CA certificates
[apiInstance getCertificateAsPemWith:subjectDn
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1caApi()

var subjectDn = subjectDn_example; // {String} CAs subject DN


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.getCertificateAsPem(subjectDn, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCertificateAsPemExample
    {
        public void main()
        {
            
            var apiInstance = new V1caApi();
            var subjectDn = subjectDn_example;  // String | CAs subject DN

            try
            {
                // Get PEM file with CA certificates
                apiInstance.getCertificateAsPem(subjectDn);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1caApi.getCertificateAsPem: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1caApi();
$subjectDn = subjectDn_example; // String | CAs subject DN

try {
    $api_instance->getCertificateAsPem($subjectDn);
} catch (Exception $e) {
    echo 'Exception when calling V1caApi->getCertificateAsPem: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1caApi;

my $api_instance = WWW::SwaggerClient::V1caApi->new();
my $subjectDn = subjectDn_example; # String | CAs subject DN

eval { 
    $api_instance->getCertificateAsPem(subjectDn => $subjectDn);
};
if ($@) {
    warn "Exception when calling V1caApi->getCertificateAsPem: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1caApi()
subjectDn = subjectDn_example # String | CAs subject DN

try: 
    # Get PEM file with CA certificates
    api_instance.get_certificate_as_pem(subjectDn)
except ApiException as e:
    print("Exception when calling V1caApi->getCertificateAsPem: %s\n" % e)

Parameters

Path parameters
Name Description
subject_dn*
String
CAs subject DN
Required

Responses

Status: default - successful operation


getLatestCrl

Returns the latest CRL issued by this CA


/v1/ca/{issuer_dn}/getLatestCrl

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/ca/{issuer_dn}/getLatestCrl?deltaCrl="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1caApi;

import java.io.File;
import java.util.*;

public class V1caApiExample {

    public static void main(String[] args) {
        
        V1caApi apiInstance = new V1caApi();
        String issuerDn = issuerDn_example; // String | the CRL issuers DN (CAs subject DN)
        Boolean deltaCrl = true; // Boolean | true to get the latest deltaCRL, false to get the latest complete CRL
        try {
            CrlRestResponse result = apiInstance.getLatestCrl(issuerDn, deltaCrl);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#getLatestCrl");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1caApi;

public class V1caApiExample {

    public static void main(String[] args) {
        V1caApi apiInstance = new V1caApi();
        String issuerDn = issuerDn_example; // String | the CRL issuers DN (CAs subject DN)
        Boolean deltaCrl = true; // Boolean | true to get the latest deltaCRL, false to get the latest complete CRL
        try {
            CrlRestResponse result = apiInstance.getLatestCrl(issuerDn, deltaCrl);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#getLatestCrl");
            e.printStackTrace();
        }
    }
}
String *issuerDn = issuerDn_example; // the CRL issuers DN (CAs subject DN)
Boolean *deltaCrl = true; // true to get the latest deltaCRL, false to get the latest complete CRL (optional) (default to false)

V1caApi *apiInstance = [[V1caApi alloc] init];

// Returns the latest CRL issued by this CA
[apiInstance getLatestCrlWith:issuerDn
    deltaCrl:deltaCrl
              completionHandler: ^(CrlRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1caApi()

var issuerDn = issuerDn_example; // {String} the CRL issuers DN (CAs subject DN)

var opts = { 
  'deltaCrl': true // {Boolean} true to get the latest deltaCRL, false to get the latest complete CRL
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getLatestCrl(issuerDn, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getLatestCrlExample
    {
        public void main()
        {
            
            var apiInstance = new V1caApi();
            var issuerDn = issuerDn_example;  // String | the CRL issuers DN (CAs subject DN)
            var deltaCrl = true;  // Boolean | true to get the latest deltaCRL, false to get the latest complete CRL (optional)  (default to false)

            try
            {
                // Returns the latest CRL issued by this CA
                CrlRestResponse result = apiInstance.getLatestCrl(issuerDn, deltaCrl);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1caApi.getLatestCrl: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1caApi();
$issuerDn = issuerDn_example; // String | the CRL issuers DN (CAs subject DN)
$deltaCrl = true; // Boolean | true to get the latest deltaCRL, false to get the latest complete CRL

try {
    $result = $api_instance->getLatestCrl($issuerDn, $deltaCrl);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1caApi->getLatestCrl: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1caApi;

my $api_instance = WWW::SwaggerClient::V1caApi->new();
my $issuerDn = issuerDn_example; # String | the CRL issuers DN (CAs subject DN)
my $deltaCrl = true; # Boolean | true to get the latest deltaCRL, false to get the latest complete CRL

eval { 
    my $result = $api_instance->getLatestCrl(issuerDn => $issuerDn, deltaCrl => $deltaCrl);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1caApi->getLatestCrl: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1caApi()
issuerDn = issuerDn_example # String | the CRL issuers DN (CAs subject DN)
deltaCrl = true # Boolean | true to get the latest deltaCRL, false to get the latest complete CRL (optional) (default to false)

try: 
    # Returns the latest CRL issued by this CA
    api_response = api_instance.get_latest_crl(issuerDn, deltaCrl=deltaCrl)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1caApi->getLatestCrl: %s\n" % e)

Parameters

Path parameters
Name Description
issuer_dn*
String
the CRL issuers DN (CAs subject DN)
Required
Query parameters
Name Description
deltaCrl
Boolean
true to get the latest deltaCRL, false to get the latest complete CRL

Responses

Status: 200 - successful operation


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


/v1/ca

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/ca"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1caApi;

import java.io.File;
import java.util.*;

public class V1caApiExample {

    public static void main(String[] args) {
        
        V1caApi apiInstance = new V1caApi();
        try {
            CaInfosRestResponse result = apiInstance.listCas();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#listCas");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1caApi;

public class V1caApiExample {

    public static void main(String[] args) {
        V1caApi apiInstance = new V1caApi();
        try {
            CaInfosRestResponse result = apiInstance.listCas();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#listCas");
            e.printStackTrace();
        }
    }
}

V1caApi *apiInstance = [[V1caApi alloc] init];

// Returns the Response containing the list of CAs with general information per CA as Json
[apiInstance listCasWithCompletionHandler: 
              ^(CaInfosRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1caApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.listCas(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class listCasExample
    {
        public void main()
        {
            
            var apiInstance = new V1caApi();

            try
            {
                // Returns the Response containing the list of CAs with general information per CA as Json
                CaInfosRestResponse result = apiInstance.listCas();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1caApi.listCas: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1caApi();

try {
    $result = $api_instance->listCas();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1caApi->listCas: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1caApi;

my $api_instance = WWW::SwaggerClient::V1caApi->new();

eval { 
    my $result = $api_instance->listCas();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1caApi->listCas: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1caApi()

try: 
    # Returns the Response containing the list of CAs with general information per CA as Json
    api_response = api_instance.list_cas()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1caApi->listCas: %s\n" % e)

Parameters

Responses

Status: 200 - successful operation


status

Get the status of this RestResource


/v1/ca/status

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/ca/status"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1caApi;

import java.io.File;
import java.util.*;

public class V1caApiExample {

    public static void main(String[] args) {
        
        V1caApi apiInstance = new V1caApi();
        try {
            RestResourceStatusRestResponse result = apiInstance.status();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#status");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1caApi;

public class V1caApiExample {

    public static void main(String[] args) {
        V1caApi apiInstance = new V1caApi();
        try {
            RestResourceStatusRestResponse result = apiInstance.status();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1caApi#status");
            e.printStackTrace();
        }
    }
}

V1caApi *apiInstance = [[V1caApi alloc] init];

// Get the status of this RestResource
[apiInstance statusWithCompletionHandler: 
              ^(RestResourceStatusRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1caApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.status(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class statusExample
    {
        public void main()
        {
            
            var apiInstance = new V1caApi();

            try
            {
                // Get the status of this RestResource
                RestResourceStatusRestResponse result = apiInstance.status();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1caApi.status: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1caApi();

try {
    $result = $api_instance->status();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1caApi->status: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1caApi;

my $api_instance = WWW::SwaggerClient::V1caApi->new();

eval { 
    my $result = $api_instance->status();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1caApi->status: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1caApi()

try: 
    # Get the status of this RestResource
    api_response = api_instance.status()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1caApi->status: %s\n" % e)

Parameters

Responses

Status: 200 - successful operation


V1certificate

enrollKeystore

Keystore enrollment

Creates a keystore for the specified end entity


/v1/certificate/enrollkeystore

Usage and SDK Samples

curl -X POST "https://localhost/ejbca/ejbca-rest-api/v1/certificate/enrollkeystore"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        KeyStoreRestRequest body = ; // KeyStoreRestRequest | 
        try {
            CertificateRestResponse result = apiInstance.enrollKeystore(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#enrollKeystore");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        KeyStoreRestRequest body = ; // KeyStoreRestRequest | 
        try {
            CertificateRestResponse result = apiInstance.enrollKeystore(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#enrollKeystore");
            e.printStackTrace();
        }
    }
}
KeyStoreRestRequest *body = ; //  (optional)

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Keystore enrollment
[apiInstance enrollKeystoreWith:body
              completionHandler: ^(CertificateRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var opts = { 
  'body':  // {KeyStoreRestRequest} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.enrollKeystore(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class enrollKeystoreExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var body = new KeyStoreRestRequest(); // KeyStoreRestRequest |  (optional) 

            try
            {
                // Keystore enrollment
                CertificateRestResponse result = apiInstance.enrollKeystore(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.enrollKeystore: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$body = ; // KeyStoreRestRequest | 

try {
    $result = $api_instance->enrollKeystore($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->enrollKeystore: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $body = WWW::SwaggerClient::Object::KeyStoreRestRequest->new(); # KeyStoreRestRequest | 

eval { 
    my $result = $api_instance->enrollKeystore(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->enrollKeystore: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
body =  # KeyStoreRestRequest |  (optional)

try: 
    # Keystore enrollment
    api_response = api_instance.enroll_keystore(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->enrollKeystore: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 201 - successful operation


enrollPkcs10Certificate

Enrollment by PKCS10 request

Enroll certificate given PKCS10 CSR. Given CSR must be base64 encoded PEM format


/v1/certificate/pkcs10enroll

Usage and SDK Samples

curl -X POST "https://localhost/ejbca/ejbca-rest-api/v1/certificate/pkcs10enroll"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        EnrollCertificateRestRequest body = ; // EnrollCertificateRestRequest | 
        try {
            CertificateRestResponse result = apiInstance.enrollPkcs10Certificate(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#enrollPkcs10Certificate");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        EnrollCertificateRestRequest body = ; // EnrollCertificateRestRequest | 
        try {
            CertificateRestResponse result = apiInstance.enrollPkcs10Certificate(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#enrollPkcs10Certificate");
            e.printStackTrace();
        }
    }
}
EnrollCertificateRestRequest *body = ; //  (optional)

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Enrollment by PKCS10 request
[apiInstance enrollPkcs10CertificateWith:body
              completionHandler: ^(CertificateRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var opts = { 
  'body':  // {EnrollCertificateRestRequest} 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.enrollPkcs10Certificate(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class enrollPkcs10CertificateExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var body = new EnrollCertificateRestRequest(); // EnrollCertificateRestRequest |  (optional) 

            try
            {
                // Enrollment by PKCS10 request
                CertificateRestResponse result = apiInstance.enrollPkcs10Certificate(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.enrollPkcs10Certificate: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$body = ; // EnrollCertificateRestRequest | 

try {
    $result = $api_instance->enrollPkcs10Certificate($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->enrollPkcs10Certificate: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $body = WWW::SwaggerClient::Object::EnrollCertificateRestRequest->new(); # EnrollCertificateRestRequest | 

eval { 
    my $result = $api_instance->enrollPkcs10Certificate(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->enrollPkcs10Certificate: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
body =  # EnrollCertificateRestRequest |  (optional)

try: 
    # Enrollment by PKCS10 request
    api_response = api_instance.enroll_pkcs10_certificate(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->enrollPkcs10Certificate: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 201 - successful operation


finalizeEnrollment

Finalize enrollment

Finalizes enrollment after administrator approval using request Id


/v1/certificate/{request_id}/finalize

Usage and SDK Samples

curl -X POST "https://localhost/ejbca/ejbca-rest-api/v1/certificate/{request_id}/finalize"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        Integer requestId = 56; // Integer | Approval request id
        FinalizeRestRequest body = ; // FinalizeRestRequest | responseFormat must be one of 'P12', 'JKS', 'DER'
        try {
            CertificateRestResponse result = apiInstance.finalizeEnrollment(requestId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#finalizeEnrollment");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        Integer requestId = 56; // Integer | Approval request id
        FinalizeRestRequest body = ; // FinalizeRestRequest | responseFormat must be one of 'P12', 'JKS', 'DER'
        try {
            CertificateRestResponse result = apiInstance.finalizeEnrollment(requestId, body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#finalizeEnrollment");
            e.printStackTrace();
        }
    }
}
Integer *requestId = 56; // Approval request id
FinalizeRestRequest *body = ; // responseFormat must be one of 'P12', 'JKS', 'DER' (optional)

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Finalize enrollment
[apiInstance finalizeEnrollmentWith:requestId
    body:body
              completionHandler: ^(CertificateRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var requestId = 56; // {Integer} Approval request id

var opts = { 
  'body':  // {FinalizeRestRequest} responseFormat must be one of 'P12', 'JKS', 'DER'
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.finalizeEnrollment(requestId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class finalizeEnrollmentExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var requestId = 56;  // Integer | Approval request id
            var body = new FinalizeRestRequest(); // FinalizeRestRequest | responseFormat must be one of 'P12', 'JKS', 'DER' (optional) 

            try
            {
                // Finalize enrollment
                CertificateRestResponse result = apiInstance.finalizeEnrollment(requestId, body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.finalizeEnrollment: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$requestId = 56; // Integer | Approval request id
$body = ; // FinalizeRestRequest | responseFormat must be one of 'P12', 'JKS', 'DER'

try {
    $result = $api_instance->finalizeEnrollment($requestId, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->finalizeEnrollment: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $requestId = 56; # Integer | Approval request id
my $body = WWW::SwaggerClient::Object::FinalizeRestRequest->new(); # FinalizeRestRequest | responseFormat must be one of 'P12', 'JKS', 'DER'

eval { 
    my $result = $api_instance->finalizeEnrollment(requestId => $requestId, body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->finalizeEnrollment: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
requestId = 56 # Integer | Approval request id
body =  # FinalizeRestRequest | responseFormat must be one of 'P12', 'JKS', 'DER' (optional)

try: 
    # Finalize enrollment
    api_response = api_instance.finalize_enrollment(requestId, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->finalizeEnrollment: %s\n" % e)

Parameters

Path parameters
Name Description
request_id*
Integer (int32)
Approval request id
Required
Body parameters
Name Description
body

Responses

Status: 201 - successful operation


getCertificatesAboutToExpire

Get a list of certificates that are about to expire

List of certificates expiring within specified number of days


/v1/certificate/expire

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/certificate/expire?days=&offset=&maxNumberOfResults="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        Long days = 789; // Long | Request certificates expiring within this number of days
        Integer offset = 56; // Integer | Next offset to display results of, if maxNumberOfResults is exceeded
        Integer maxNumberOfResults = 56; // Integer | Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results
        try {
            ExpiringCertificatesRestResponse result = apiInstance.getCertificatesAboutToExpire(days, offset, maxNumberOfResults);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#getCertificatesAboutToExpire");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        Long days = 789; // Long | Request certificates expiring within this number of days
        Integer offset = 56; // Integer | Next offset to display results of, if maxNumberOfResults is exceeded
        Integer maxNumberOfResults = 56; // Integer | Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results
        try {
            ExpiringCertificatesRestResponse result = apiInstance.getCertificatesAboutToExpire(days, offset, maxNumberOfResults);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#getCertificatesAboutToExpire");
            e.printStackTrace();
        }
    }
}
Long *days = 789; // Request certificates expiring within this number of days (optional)
Integer *offset = 56; // Next offset to display results of, if maxNumberOfResults is exceeded (optional)
Integer *maxNumberOfResults = 56; // Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results (optional)

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Get a list of certificates that are about to expire
[apiInstance getCertificatesAboutToExpireWith:days
    offset:offset
    maxNumberOfResults:maxNumberOfResults
              completionHandler: ^(ExpiringCertificatesRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var opts = { 
  'days': 789, // {Long} Request certificates expiring within this number of days
  'offset': 56, // {Integer} Next offset to display results of, if maxNumberOfResults is exceeded
  'maxNumberOfResults': 56 // {Integer} Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getCertificatesAboutToExpire(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class getCertificatesAboutToExpireExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var days = 789;  // Long | Request certificates expiring within this number of days (optional) 
            var offset = 56;  // Integer | Next offset to display results of, if maxNumberOfResults is exceeded (optional) 
            var maxNumberOfResults = 56;  // Integer | Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results (optional) 

            try
            {
                // Get a list of certificates that are about to expire
                ExpiringCertificatesRestResponse result = apiInstance.getCertificatesAboutToExpire(days, offset, maxNumberOfResults);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.getCertificatesAboutToExpire: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$days = 789; // Long | Request certificates expiring within this number of days
$offset = 56; // Integer | Next offset to display results of, if maxNumberOfResults is exceeded
$maxNumberOfResults = 56; // Integer | Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results

try {
    $result = $api_instance->getCertificatesAboutToExpire($days, $offset, $maxNumberOfResults);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->getCertificatesAboutToExpire: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $days = 789; # Long | Request certificates expiring within this number of days
my $offset = 56; # Integer | Next offset to display results of, if maxNumberOfResults is exceeded
my $maxNumberOfResults = 56; # Integer | Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results

eval { 
    my $result = $api_instance->getCertificatesAboutToExpire(days => $days, offset => $offset, maxNumberOfResults => $maxNumberOfResults);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->getCertificatesAboutToExpire: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
days = 789 # Long | Request certificates expiring within this number of days (optional)
offset = 56 # Integer | Next offset to display results of, if maxNumberOfResults is exceeded (optional)
maxNumberOfResults = 56 # Integer | Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results (optional)

try: 
    # Get a list of certificates that are about to expire
    api_response = api_instance.get_certificates_about_to_expire(days=days, offset=offset, maxNumberOfResults=maxNumberOfResults)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->getCertificatesAboutToExpire: %s\n" % e)

Parameters

Query parameters
Name Description
days
Long (int64)
Request certificates expiring within this number of days
offset
Integer (int32)
Next offset to display results of, if maxNumberOfResults is exceeded
maxNumberOfResults
Integer (int32)
Maximum number of certificates to display. If result exceeds this value. Modify 'offset' to retrieve more results

Responses

Status: 200 - successful operation


revocationStatus

Checks revocation status of the specified certificate

Checks revocation status of the specified certificate


/v1/certificate/{issuer_dn}/{certificate_serial_number}/revocationstatus

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/certificate/{issuer_dn}/{certificate_serial_number}/revocationstatus"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        String issuerDn = issuerDn_example; // String | Subject DN of the issuing CA
        String certificateSerialNumber = certificateSerialNumber_example; // String | hex serial number (without prefix, e.g. '00')
        try {
            RevokeStatusRestResponse result = apiInstance.revocationStatus(issuerDn, certificateSerialNumber);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#revocationStatus");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        String issuerDn = issuerDn_example; // String | Subject DN of the issuing CA
        String certificateSerialNumber = certificateSerialNumber_example; // String | hex serial number (without prefix, e.g. '00')
        try {
            RevokeStatusRestResponse result = apiInstance.revocationStatus(issuerDn, certificateSerialNumber);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#revocationStatus");
            e.printStackTrace();
        }
    }
}
String *issuerDn = issuerDn_example; // Subject DN of the issuing CA
String *certificateSerialNumber = certificateSerialNumber_example; // hex serial number (without prefix, e.g. '00')

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Checks revocation status of the specified certificate
[apiInstance revocationStatusWith:issuerDn
    certificateSerialNumber:certificateSerialNumber
              completionHandler: ^(RevokeStatusRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var issuerDn = issuerDn_example; // {String} Subject DN of the issuing CA

var certificateSerialNumber = certificateSerialNumber_example; // {String} hex serial number (without prefix, e.g. '00')


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.revocationStatus(issuerDn, certificateSerialNumber, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class revocationStatusExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var issuerDn = issuerDn_example;  // String | Subject DN of the issuing CA
            var certificateSerialNumber = certificateSerialNumber_example;  // String | hex serial number (without prefix, e.g. '00')

            try
            {
                // Checks revocation status of the specified certificate
                RevokeStatusRestResponse result = apiInstance.revocationStatus(issuerDn, certificateSerialNumber);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.revocationStatus: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$issuerDn = issuerDn_example; // String | Subject DN of the issuing CA
$certificateSerialNumber = certificateSerialNumber_example; // String | hex serial number (without prefix, e.g. '00')

try {
    $result = $api_instance->revocationStatus($issuerDn, $certificateSerialNumber);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->revocationStatus: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $issuerDn = issuerDn_example; # String | Subject DN of the issuing CA
my $certificateSerialNumber = certificateSerialNumber_example; # String | hex serial number (without prefix, e.g. '00')

eval { 
    my $result = $api_instance->revocationStatus(issuerDn => $issuerDn, certificateSerialNumber => $certificateSerialNumber);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->revocationStatus: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
issuerDn = issuerDn_example # String | Subject DN of the issuing CA
certificateSerialNumber = certificateSerialNumber_example # String | hex serial number (without prefix, e.g. '00')

try: 
    # Checks revocation status of the specified certificate
    api_response = api_instance.revocation_status(issuerDn, certificateSerialNumber)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->revocationStatus: %s\n" % e)

Parameters

Path parameters
Name Description
issuer_dn*
String
Subject DN of the issuing CA
Required
certificate_serial_number*
String
hex serial number (without prefix, e.g. '00')
Required

Responses

Status: 200 - successful operation


revokeCertificate

Revokes the specified certificate

Revokes the specified certificate


/v1/certificate/{issuer_dn}/{certificate_serial_number}/revoke

Usage and SDK Samples

curl -X PUT "https://localhost/ejbca/ejbca-rest-api/v1/certificate/{issuer_dn}/{certificate_serial_number}/revoke?reason=&date="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        String issuerDn = issuerDn_example; // String | Subject DN of the issuing CA
        String certificateSerialNumber = certificateSerialNumber_example; // String | hex serial number (without prefix, e.g. '00')
        String reason = reason_example; // String | Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE
        String date = date_example; // String | ISO 8601 Date string, eg. '2018-06-15T14:07:09Z'
        try {
            RevokeStatusRestResponse result = apiInstance.revokeCertificate(issuerDn, certificateSerialNumber, reason, date);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#revokeCertificate");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        String issuerDn = issuerDn_example; // String | Subject DN of the issuing CA
        String certificateSerialNumber = certificateSerialNumber_example; // String | hex serial number (without prefix, e.g. '00')
        String reason = reason_example; // String | Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE
        String date = date_example; // String | ISO 8601 Date string, eg. '2018-06-15T14:07:09Z'
        try {
            RevokeStatusRestResponse result = apiInstance.revokeCertificate(issuerDn, certificateSerialNumber, reason, date);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#revokeCertificate");
            e.printStackTrace();
        }
    }
}
String *issuerDn = issuerDn_example; // Subject DN of the issuing CA
String *certificateSerialNumber = certificateSerialNumber_example; // hex serial number (without prefix, e.g. '00')
String *reason = reason_example; // Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE (optional)
String *date = date_example; // ISO 8601 Date string, eg. '2018-06-15T14:07:09Z' (optional)

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Revokes the specified certificate
[apiInstance revokeCertificateWith:issuerDn
    certificateSerialNumber:certificateSerialNumber
    reason:reason
    date:date
              completionHandler: ^(RevokeStatusRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var issuerDn = issuerDn_example; // {String} Subject DN of the issuing CA

var certificateSerialNumber = certificateSerialNumber_example; // {String} hex serial number (without prefix, e.g. '00')

var opts = { 
  'reason': reason_example, // {String} Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE
  'date': date_example // {String} ISO 8601 Date string, eg. '2018-06-15T14:07:09Z'
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.revokeCertificate(issuerDn, certificateSerialNumber, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class revokeCertificateExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var issuerDn = issuerDn_example;  // String | Subject DN of the issuing CA
            var certificateSerialNumber = certificateSerialNumber_example;  // String | hex serial number (without prefix, e.g. '00')
            var reason = reason_example;  // String | Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE (optional) 
            var date = date_example;  // String | ISO 8601 Date string, eg. '2018-06-15T14:07:09Z' (optional) 

            try
            {
                // Revokes the specified certificate
                RevokeStatusRestResponse result = apiInstance.revokeCertificate(issuerDn, certificateSerialNumber, reason, date);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.revokeCertificate: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$issuerDn = issuerDn_example; // String | Subject DN of the issuing CA
$certificateSerialNumber = certificateSerialNumber_example; // String | hex serial number (without prefix, e.g. '00')
$reason = reason_example; // String | Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE
$date = date_example; // String | ISO 8601 Date string, eg. '2018-06-15T14:07:09Z'

try {
    $result = $api_instance->revokeCertificate($issuerDn, $certificateSerialNumber, $reason, $date);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->revokeCertificate: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $issuerDn = issuerDn_example; # String | Subject DN of the issuing CA
my $certificateSerialNumber = certificateSerialNumber_example; # String | hex serial number (without prefix, e.g. '00')
my $reason = reason_example; # String | Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE
my $date = date_example; # String | ISO 8601 Date string, eg. '2018-06-15T14:07:09Z'

eval { 
    my $result = $api_instance->revokeCertificate(issuerDn => $issuerDn, certificateSerialNumber => $certificateSerialNumber, reason => $reason, date => $date);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->revokeCertificate: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
issuerDn = issuerDn_example # String | Subject DN of the issuing CA
certificateSerialNumber = certificateSerialNumber_example # String | hex serial number (without prefix, e.g. '00')
reason = reason_example # String | Must be valid RFC5280 reason. One of
 NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE,
 CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION,
 CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE (optional)
date = date_example # String | ISO 8601 Date string, eg. '2018-06-15T14:07:09Z' (optional)

try: 
    # Revokes the specified certificate
    api_response = api_instance.revoke_certificate(issuerDn, certificateSerialNumber, reason=reason, date=date)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->revokeCertificate: %s\n" % e)

Parameters

Path parameters
Name Description
issuer_dn*
String
Subject DN of the issuing CA
Required
certificate_serial_number*
String
hex serial number (without prefix, e.g. '00')
Required
Query parameters
Name Description
reason
String
Must be valid RFC5280 reason. One of NOT_REVOKED, UNSPECIFIED ,KEYCOMPROMISE, CACOMPROMISE, AFFILIATIONCHANGED, SUPERSEDED, CESSATIONOFOPERATION, CERTIFICATEHOLD, REMOVEFROMCRL, PRIVILEGESWITHDRAWN, AACOMPROMISE
date
String
ISO 8601 Date string, eg. '2018-06-15T14:07:09Z'

Responses

Status: 200 - successful operation


searchCertificates

Searches for certificates confirming giving criteria.

Insert as many search criteria as needed. A reference about allowed values for criteria could be found below, under SearchCertificateCriteriaRestRequest model.


/v1/certificate/search

Usage and SDK Samples

curl -X POST "https://localhost/ejbca/ejbca-rest-api/v1/certificate/search"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        SearchCertificatesRestRequest body = ; // SearchCertificatesRestRequest | Maximum number of results and collection of search criterias.
        try {
            SearchCertificatesRestResponse result = apiInstance.searchCertificates(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#searchCertificates");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        SearchCertificatesRestRequest body = ; // SearchCertificatesRestRequest | Maximum number of results and collection of search criterias.
        try {
            SearchCertificatesRestResponse result = apiInstance.searchCertificates(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#searchCertificates");
            e.printStackTrace();
        }
    }
}
SearchCertificatesRestRequest *body = ; // Maximum number of results and collection of search criterias. (optional)

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Searches for certificates confirming giving criteria.
[apiInstance searchCertificatesWith:body
              completionHandler: ^(SearchCertificatesRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var opts = { 
  'body':  // {SearchCertificatesRestRequest} Maximum number of results and collection of search criterias.
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.searchCertificates(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class searchCertificatesExample
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();
            var body = new SearchCertificatesRestRequest(); // SearchCertificatesRestRequest | Maximum number of results and collection of search criterias. (optional) 

            try
            {
                // Searches for certificates confirming giving criteria.
                SearchCertificatesRestResponse result = apiInstance.searchCertificates(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.searchCertificates: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();
$body = ; // SearchCertificatesRestRequest | Maximum number of results and collection of search criterias.

try {
    $result = $api_instance->searchCertificates($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->searchCertificates: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();
my $body = WWW::SwaggerClient::Object::SearchCertificatesRestRequest->new(); # SearchCertificatesRestRequest | Maximum number of results and collection of search criterias.

eval { 
    my $result = $api_instance->searchCertificates(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->searchCertificates: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()
body =  # SearchCertificatesRestRequest | Maximum number of results and collection of search criterias. (optional)

try: 
    # Searches for certificates confirming giving criteria.
    api_response = api_instance.search_certificates(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->searchCertificates: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 200 - successful operation


status1

Get the status of this REST Resource

Returns status and version of the resource.


/v1/certificate/status

Usage and SDK Samples

curl -X GET "https://localhost/ejbca/ejbca-rest-api/v1/certificate/status"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.V1certificateApi;

import java.io.File;
import java.util.*;

public class V1certificateApiExample {

    public static void main(String[] args) {
        
        V1certificateApi apiInstance = new V1certificateApi();
        try {
            RestResourceStatusRestResponse result = apiInstance.status1();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#status1");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.V1certificateApi;

public class V1certificateApiExample {

    public static void main(String[] args) {
        V1certificateApi apiInstance = new V1certificateApi();
        try {
            RestResourceStatusRestResponse result = apiInstance.status1();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling V1certificateApi#status1");
            e.printStackTrace();
        }
    }
}

V1certificateApi *apiInstance = [[V1certificateApi alloc] init];

// Get the status of this REST Resource
[apiInstance status1WithCompletionHandler: 
              ^(RestResourceStatusRestResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var CertificateManagementRestInterface = require('certificate_management_rest_interface');

var api = new CertificateManagementRestInterface.V1certificateApi()

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.status1(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class status1Example
    {
        public void main()
        {
            
            var apiInstance = new V1certificateApi();

            try
            {
                // Get the status of this REST Resource
                RestResourceStatusRestResponse result = apiInstance.status1();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling V1certificateApi.status1: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\Api\V1certificateApi();

try {
    $result = $api_instance->status1();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1certificateApi->status1: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::V1certificateApi;

my $api_instance = WWW::SwaggerClient::V1certificateApi->new();

eval { 
    my $result = $api_instance->status1();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling V1certificateApi->status1: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.V1certificateApi()

try: 
    # Get the status of this REST Resource
    api_response = api_instance.status1()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling V1certificateApi->status1: %s\n" % e)

Parameters

Responses

Status: 200 - successful operation


Generated 2018-10-05T10:06:23.071+02:00