Skip to content

/cas/{id}/download

Docs for PKI Manager 3.17.0 (released 2026-11-24), from main 4d59c30 (30 commits after the release).

GET
/cas/{id}/download
curl --request GET \
--url 'https://pki.example.com/api/v1/cas/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/download?format=pem' \
--header 'Authorization: Bearer <token>'

Download CA certificate in various formats.

Certificate Formats (public certificate only):

  • pem - PEM text format (Base64-encoded with headers)
  • crt - CRT text certificate (same as PEM)
  • der - DER binary compact format
  • cer - CER Windows-compatible format (same as DER)

Truststore Formats (public certificate only, for trust validation):

  • p12-truststore - PKCS#12 truststore containing only the CA certificate
  • jks-truststore - Java KeyStore truststore containing only the CA certificate

Keystore Formats (certificate + private key, for CA signing operations):

  • p12-keystore - PKCS#12 keystore with CA certificate and private key
  • jks-keystore - Java KeyStore with CA certificate and private key

Security Note: Keystore formats expose the CA’s private key. They are refused with 403 CA_KEY_EXPORT_DISABLED unless the server runs with ALLOW_CA_KEY_EXPORT=true. When enabled, only the admin role may use them (403 CA_KEY_EXPORT_ADMIN_REQUIRED otherwise) and every attempt is written to the audit log as ca.export_private_key.

id
required
string format: uuid
format
required
string
Allowed values: pem crt der cer p12-truststore p12-keystore jks-truststore jks-keystore

Download format

password
string

DEPRECATED: use the X-Export-Password header instead. A password in the URL is recorded in browser history and proxy/server logs. Password for P12 and JKS formats. Required for keystore formats, optional for truststore formats (defaults to “changeit” if not provided)

x-export-password
string

Export password for password-protected formats. Preferred over the deprecated password query parameter: a header is not recorded in browser history or in proxy/server access logs. Takes precedence over the query parameter.

Default Response

Media typeapplication/json
object
data

Base64-encoded certificate data

string
mimeType
string
filename
string

Example generated

{
"data": "example",
"mimeType": "example",
"filename": "example"
}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
field
string
message
string

Example generated

{
"error": {
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}
}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
field
string
message
string

Example generated

{
"error": {
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}
}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
field
string
message
string

Example generated

{
"error": {
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}
}

Default Response

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
field
string
message
string

Example generated

{
"error": {
"code": "example",
"message": "example",
"details": [
{
"field": "example",
"message": "example"
}
]
}
}

PKI Manager is a personal project of Oriol Rius, built for his own use. It is not a commercial product. About this project