Certificate tools

These tools manage Alpacon’s built-in PKI: certificate authorities (CAs) that sign certificates, certificate signing requests (CSRs) that request them, the certificates that get issued, and the revocation requests that invalidate them. They back requests like “create a CA for alpacax.com”, “request a certificate for web-01.internal”, or “revoke the certificate that’s about to expire.”

The typical lifecycle is: create a CA once per domain with create_certificate_authority, then request a certificate with create_sign_request. The CA is chosen from the DNS names in the request; an IP-only request finds no CA. A manager of the CA’s server approves the request with approve_sign_request, and the CA issues the certificate. CA ownership alone grants no approval authority. If a certificate needs to be invalidated early, revoke_certificate starts a revocation request. It is approved as it is filed when the caller meets the conditions under revoke_certificate; otherwise it waits for a manager of the CA’s server to approve it.

Note

All tools accept workspace (required) and region (optional, defaults to the configured region). These common parameters are omitted from the tables below.

Summary

ToolDescriptionAccess
list_certificate_authoritiesList certificate authoritiesRead-only
create_certificate_authorityCreate a certificate authorityAdditive
get_certificate_authorityGet certificate authority detailsRead-only
update_certificate_authorityUpdate a certificate authority’s validity periods or ownerIdempotent write
delete_certificate_authorityDelete a certificate authority that has never received a certificate requestDestructive
list_sign_requestsList certificate signing requestsRead-only
create_sign_requestCreate a certificate signing requestAdditive
get_sign_requestGet certificate signing request detailsRead-only
delete_sign_requestCancel a pending certificate signing requestDestructive
approve_sign_requestApprove a pending CSR so the CA issues the certificateAdditive
deny_sign_requestDeny a certificate signing requestDestructive
retry_sign_requestRetry a CSR stuck in the signing stateIdempotent write
list_certificatesList issued certificatesRead-only
get_certificateGet certificate detailsRead-only
revoke_certificateCreate a revocation request for a certificateDestructive
list_revoke_requestsList certificate revocation requestsRead-only
get_revoke_requestGet revocation request detailsRead-only
approve_revoke_requestApprove a pending revocation requestDestructive
deny_revoke_requestDeny a pending revocation requestDestructive
retry_revoke_requestRetry a revocation request stuck in the revoking stateIdempotent write
cancel_revoke_requestCancel a pending revocation requestDestructive

Certificate authorities

A certificate authority (CA) is the root of trust that signs certificates for a domain. Each CA is hosted on a server (agent) and owned by a user. CLI equivalent: alpacon authority.

list_certificate_authorities

Lists certificate authorities configured in the workspace, including CA names, domains, validity periods, and key algorithm/size. Use this to discover available CAs before creating sign requests.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination
page_sizeintegerNoNumber of items per page

Example

“What certificate authorities do we have set up?”

The agent calls list_certificate_authorities and reports each CA’s name, domain, and validity settings.

create_certificate_authority

Creates a new CA for signing certificates within the workspace. Requires a name, root domain, organization, the server (agent) that hosts the CA, and an owner user. Optionally sets validity periods, key algorithm (rsa or ecdsa), key size (2048/4096 for RSA, 256/384 for ECDSA), and whether to install the CA automatically on the agent.

Access: Additive

Parameters

ParameterTypeRequiredDescription
namestringYesName of the certificate authority
domainstringYesRoot domain of the CA; must be unique
organizationstringYesOrganization name that this CA belongs to
server_idstringYesServer (agent) UUID that runs this CA
ownerstringYesOwner user UUID
root_valid_daysintegerNoValidity of the root certificate in days
default_valid_daysintegerNoDefault validity for child certificates in days
max_valid_daysintegerNoMaximum validity users can request in days
key_algorithmstringNoKey algorithm: rsa or ecdsa
key_sizeintegerNoKey size in bits: 2048/4096 for RSA, 256/384 for ECDSA
installbooleanNoInstall the CA automatically on the agent

Example

“Set up a certificate authority for alpacax.com, hosted on the ca-server agent”

The agent calls create_certificate_authority with domain="alpacax.com", the resolved server_id, and the requesting user as owner.

get_certificate_authority

Gets detailed information about a specific CA by ID: configuration, validity period, key algorithm/size, and status. Use list_certificate_authorities to discover CA IDs.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
ca_idstringYesCertificate authority ID

Example

“Show me the details of the alpacax.com CA”

The agent looks up the CA ID from list_certificate_authorities, then calls get_certificate_authority to return its full configuration.

update_certificate_authority

Updates an existing CA. This is a partial update—only the fields provided are changed. default_valid_days, max_valid_days, and owner are updatable; the CA’s name, domain, hosting server, and key parameters are immutable after creation. Requires a manager of the CA’s server.

Access: Idempotent write

Parameters

ParameterTypeRequiredDescription
ca_idstringYesCertificate authority ID
default_valid_daysintegerNoNew default validity for child certificates in days
max_valid_daysintegerNoNew maximum validity users can request in days
ownerstringNoNew owner user UUID

Example

“Lower the default and max certificate validity on the alpacax.com CA to 90 days”

The agent calls update_certificate_authority with ca_id, default_valid_days=90 and max_valid_days=90; all other CA settings are left unchanged. The default can’t exceed the max, so lowering the max below the current default alone is refused.

delete_certificate_authority

Deletes a CA that has never received a certificate request. If the CA has received any request, the deletion is refused and the CA is kept along with its sign requests, certificate records, and revocations. To stop using a CA with history, delete the server it runs on—the CA then leaves the CA list and is no longer chosen to sign requests. Requires a manager of the CA’s server.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
ca_idstringYesCertificate authority ID to delete

Example

“Delete the old staging CA, we don’t use it anymore”

The agent confirms the CA ID with the user before calling delete_certificate_authority, since a successful deletion cannot be undone. If the CA has already received certificate requests, the call is refused and nothing is deleted.

Sign requests (CSRs)

A certificate signing request (CSR) asks a CA to issue a certificate. CSRs move through requested, signing, signed, failed, canceled, or denied states. CLI equivalent: alpacon csr.

A manager of the CA’s server is an account with the admin role (Staff or Superuser), a maintainer of that server, or an owner or manager of a group the server belongs to. CA ownership alone does not grant permission to approve, deny, retry, or mark a request as failed.

list_sign_requests

Lists CSRs in the workspace, including status, common names, and associated CAs. Use this to review pending certificate requests.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination
page_sizeintegerNoNumber of items per page

Example

“Are there any certificate requests waiting for approval?”

The agent calls list_sign_requests and filters the results down to those in the requested state.

create_sign_request

Any signed-in user can create a CSR to request a new certificate. A service token is refused with 403 cert_principal_not_supported. Include DNS names in domain_list so Alpacon can select a CA by its root domain; a request with only ip_list entries cannot find a CA. The common name is derived from the first SAN entry, and the organization is inherited from the matched CA. The requester or a manager of the CA’s server can submit the CSR body while the request is requested.

Access: Additive

Parameters

ParameterTypeRequiredDescription
domain_listarrayNoSubject Alternative Names: DNS entries
ip_listarrayNoSubject Alternative Names: IP addresses
valid_daysintegerNoCertificate validity in days

Example

“Request a certificate for web-01.alpacax.com”

The agent calls create_sign_request with domain_list=["web-01.alpacax.com"]; Alpacon matches it to the CA that owns the alpacax.com root domain.

get_sign_request

Gets detailed information about a specific CSR by ID: status, common name, SANs, associated CA, and processing details.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
csr_idstringYesCertificate signing request ID

Example

“What’s the status of the CSR for web-01.alpacax.com?”

The agent finds the CSR ID via list_sign_requests, then calls get_sign_request for its full status and processing details.

delete_sign_request

Cancels a CSR. Only requested (pending) CSRs can be canceled—the CSR transitions to the canceled state; CSRs already being processed or completed cannot be canceled this way. Requires the original requester or a manager of the CA’s server.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
csr_idstringYesCertificate signing request ID to cancel

Example

“Cancel the certificate request I just submitted for the wrong domain”

The agent calls delete_sign_request with the CSR ID; the request moves to canceled instead of being issued.

approve_sign_request

Approves a pending CSR so the CA issues the certificate. Use list_sign_requests to find pending CSRs. Requires a manager of the CA’s server.

Access: Additive

Parameters

ParameterTypeRequiredDescription
csr_idstringYesCertificate signing request ID to approve

Example

“Approve the pending CSR for web-01.alpacax.com”

The agent calls approve_sign_request with the CSR ID; the CA then issues the certificate.

deny_sign_request

Denies a CSR in the requested state. Any other state is refused with cert_request_in_progress. The requester is notified of the decision. Requires a manager of the CA’s server.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
csr_idstringYesCertificate signing request ID to deny

Example

“Deny that CSR, the domain doesn’t belong to us”

The agent calls deny_sign_request with the CSR ID; the requester is notified.

retry_sign_request

Retries a CSR that’s stuck in the signing (processing) state by re-sending the request to the CA. Only CSRs in the signing state can be retried. Requires a manager of the CA’s server.

Access: Idempotent write

Parameters

ParameterTypeRequiredDescription
csr_idstringYesCertificate signing request ID to retry

Example

“That CSR has been stuck signing for 10 minutes, try it again”

The agent calls retry_sign_request with the CSR ID to re-dispatch the request to the CA.

Certificates

Issued certificates are read-only from this API—certificates come into existence only through the sign request flow. CLI equivalent: alpacon cert.

list_certificates

Lists issued certificates in the workspace, including common names, expiry dates, and revocation status. Filterable by authority_id.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
authority_idstringNoFilter by certificate authority ID
pageintegerNoPage number for pagination
page_sizeintegerNoNumber of items per page

Example

“List all certificates issued by the alpacax.com CA”

The agent calls list_certificates with authority_id set to that CA’s ID.

get_certificate

Gets detailed information about a specific issued certificate by ID: content, common name, SANs, expiry date, and revocation status.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
certificate_idstringYesCertificate ID

Example

“When does the web-01.alpacax.com certificate expire?”

The agent finds the certificate ID via list_certificates, then calls get_certificate to check its expiry date.

revoke_certificate

Creates a revocation request to invalidate an issued certificate. The caller must be the person who requested the certificate or a manager of the CA’s server; other callers receive 403 cert_revoke_target_denied. Optionally include an RFC 5280 reason code and a free-text requested_reason.

The request is approved as it is filed only when the caller manages the CA’s server and is an admin or holds an approver role for a group the server belongs to, for all groups, or globally. When calling with an API token, the token must also have the revoke_request:approve scope; a browser session always passes this token-scope check. Otherwise the request waits for a manager of the CA’s server to approve it through approve_revoke_request.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
certificate_idstringYesCertificate ID to revoke
reasonintegerNoRFC 5280 revocation reason code (default: 0, unspecified). One of 0, 1, 2, 3, 4, 5, 6, 9, 10
requested_reasonstringNoFree-text explanation for the revocation

Reason codes:

CodeReason
0Unspecified
1Key compromise
2CA compromise
3Affiliation changed
4Superseded
5Cessation of operation
6Certificate hold
9Privilege withdrawn
10AA compromise

Example

“Revoke the web-01.alpacax.com certificate, the key was compromised”

The agent calls revoke_certificate with certificate_id and reason=1. The request is approved as it is filed only when the caller meets all the conditions above; otherwise it waits for approval.

Revocation requests

A revocation request tracks the approval workflow for invalidating a certificate. revoke_certificate creates one; these tools review and manage it directly. Requests move through requested, revoking, revoked, failed, denied, or canceled states. CLI equivalent: alpacon revoke.

list_revoke_requests

Lists certificate revocation requests in the workspace along with their status. Use this to review pending revocation requests.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination
page_sizeintegerNoNumber of items per page

Example

“Are there any revocation requests waiting on my approval?”

The agent calls list_revoke_requests and filters the results down to those in the requested state.

get_revoke_request

Gets detailed information about a specific revocation request by ID: reason, status, and associated certificate.

Access: Read-only

Parameters

ParameterTypeRequiredDescription
revoke_idstringYesRevocation request ID

Example

“What’s the status of the revocation request for that compromised certificate?”

The agent finds the revocation request ID via list_revoke_requests, then calls get_revoke_request for its status.

approve_revoke_request

Approves a pending revocation request. The certificate is revoked and added to the CRL (certificate revocation list) after approval. Requires a manager of the CA’s server.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
revoke_idstringYesRevocation request ID to approve

Example

“Approve that pending revocation request”

The agent calls approve_revoke_request with the revocation request ID so the CA can process the revocation.

deny_revoke_request

Denies a pending revocation request. The certificate remains valid. Requires a manager of the CA’s server.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
revoke_idstringYesRevocation request ID to deny

Example

“Deny that revocation request, the certificate is still needed”

The agent calls deny_revoke_request with the revocation request ID; the certificate stays valid.

retry_revoke_request

Retries a revocation request that’s stuck in the revoking state by re-sending the request to the CA. Only requests in the revoking state can be retried. Requires a manager of the CA’s server.

Access: Idempotent write

Parameters

ParameterTypeRequiredDescription
revoke_idstringYesRevocation request ID to retry

Example

“That revocation has been stuck revoking for a while, try it again”

The agent calls retry_revoke_request with the revocation request ID to re-dispatch it to the CA.

cancel_revoke_request

Cancels a pending revocation request, withdrawing it before it’s approved. The request transitions to the canceled state and the certificate remains valid. Only requested (pending) revocation requests can be canceled. Requires the original requester or a manager of the CA’s server.

Access: Destructive

Parameters

ParameterTypeRequiredDescription
revoke_idstringYesRevocation request ID to cancel

Example

“Actually don’t revoke that certificate, cancel the request”

The agent calls cancel_revoke_request with the revocation request ID; the certificate is unaffected.

Last updated: