Skip to content

Overview

Public Key Infrastructure (PKI) Management System REST API.

This API provides RESTful endpoints for managing Certificate Authorities (CAs), certificates, Certificate Revocation Lists (CRLs), and related operations.

OpenAPI Specification

The OpenAPI 3.1 specification is available at:

  • JSON: /api/v1/openapi.json
  • YAML: /api/v1/openapi.yaml

Use these URLs to integrate with third-party tools, code generators, or API clients.

Features

  • Certificate Authority management (create, revoke, delete)
  • Certificate lifecycle management (issue, renew, revoke, download)
  • Bulk operations for certificates
  • CRL generation and distribution
  • Audit logging and reporting
  • Global search across all entities

Authentication

Most API endpoints require authentication via OAuth2/OIDC Bearer tokens.

Obtaining a Token

For users (web application): Authentication is handled automatically via the web UI using Authorization Code flow with PKCE.

For machine-to-machine (M2M) access: Use the Client Credentials flow:

curl -X POST "http://keycloak:8080/realms/pki-dev/protocol/openid-connect/token" \
  -d "grant_type=client_credentials" \
  -d "client_id=pki-service" \
  -d "client_secret=YOUR_SECRET"

Using the Token

Include the token in the Authorization header:

Authorization: Bearer <access_token>

Integration service tokens (Kubernetes, SCEP, other services)

The X.509 endpoints under /api/v1/external always require a CA-bound pkimg_... service token, including when OIDC is disabled. Use the separate integrationToken authorization scheme in Swagger. OIDC JWTs do not replace service tokens on these endpoints.

Create an integration in Operations → Integrations, choose its type (kubernetes, scep, or generic) and issuing CA, and copy the token shown once at creation. Never distribute this backend token to SCEP devices.

Integration management uses the separate tRPC API at /trpc/integration.* (list, getById, register, revoke), outside this REST specification. Register and revoke require an admin role when OIDC is enabled. The legacy cluster.* API remains compatible; new clients should use integration.*.

Public Endpoints (No Auth Required)

  • GET /health - Health check
  • GET /api/docs - This documentation
  • GET /api/v1/openapi.json - OpenAPI specification
  • GET /cas/:caId.pem - CA certificate download
  • GET /crl/:caId.crl - CRL download

Rate Limiting

No rate limiting is currently enforced. This may change in future versions.

Information

  • License: MIT
  • OpenAPI version: 3.1.0

CA-bound service token created under Operations → Integrations. Required for /external endpoints even when OIDC is disabled; independent of the OIDC JWT used for management.

Security scheme type: http

Bearer format: pkimg_ service token

JWT token obtained from OIDC provider (Keycloak, Auth0, Okta, etc.)

Security scheme type: http

Bearer format: JWT