Class EstService
java.lang.Object
zeroecho.pki.server.est.EstService
EST RFC 7030 protocol service.
Implements the five core EST operations over the lifecycle-owned realm session.
No BouncyCastle imports are present; all CMS/cryptographic codec operations
are delegated to EstCmsCodec (which delegates to Pkix).
Endpoint registration uses the durable realm registry; operation methods are stateless with respect to the endpoint registry and safe to call concurrently.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable EST enrollment response. -
Constructor Summary
ConstructorsConstructorDescriptionEstService(ServerRealmContext realm) Creates an EST service over the given realm. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]cacerts(EstEndpoint endpoint) Returns the CA certificate chain for the endpoint as MIME-base64-encoded CMS certs-only (RFC 7030 section 4.1).byte[]csrattrs(EstEndpoint endpoint) Returns CSR attribute suggestions as MIME-base64-encoded RFC 7030CsrAttrsDER (RFC 7030 section 4.5).deregister(String label) Removes the endpoint with the given label.Returns the endpoint for the given label.list()Collects active endpoints in deterministic store-key order.voidregister(EstEndpoint endpoint) Registers an EST endpoint, replacing any existing endpoint with the same label.serverkeygen(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert) Performs server-key generation through durable encrypted-artifact admission.serverkeygen(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert, CancellationSignal cancellation) Freezes the authenticated original template and reserves capacity before generating a key.simpleenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert) Performs ESTsimpleenroll(RFC 7030 section 4.2): verifies the client CSR, durably admits the request and returns its current approval or issuance outcome.simpleenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert, CancellationSignal cancellation) Admits or continues enrollment with cancellation before the durable signing claim.simplereenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert) Performs ESTsimplereenroll(RFC 7030 section 4.2.2): renews the client's certificate after proving the authoritative predecessor identity and satisfying the frozen approval and proof policy.simplereenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert, CancellationSignal cancellation) Admits or continues exact-identity renewal with pre-claim cancellation.
-
Constructor Details
-
EstService
Creates an EST service over the given realm.- Parameters:
realm- lifecycle-owned realm context
-
-
Method Details
-
register
Registers an EST endpoint, replacing any existing endpoint with the same label.- Parameters:
endpoint- the endpoint to register
-
deregister
Removes the endpoint with the given label.- Parameters:
label- URL-safe endpoint label- Returns:
- the removed endpoint, or empty if absent
-
find
Returns the endpoint for the given label.- Parameters:
label- URL-safe endpoint label- Returns:
- the endpoint, or empty when not registered
-
list
Collects active endpoints in deterministic store-key order. Concurrent changes across persistence pages need not form one atomic snapshot.- Returns:
- current endpoint list
-
cacerts
Returns the CA certificate chain for the endpoint as MIME-base64-encoded CMS certs-only (RFC 7030 section 4.1).- Parameters:
endpoint- the EST endpoint- Returns:
- MIME-base64-encoded CMS certs-only DER
- Throws:
EstProtocolException- if the CA or chain is unavailable
-
simpleenroll
public EstService.EnrollmentResult simpleenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert) throws EstProtocolException Performs ESTsimpleenroll(RFC 7030 section 4.2): verifies the client CSR, durably admits the request and returns its current approval or issuance outcome. Completed results contain MIME-base64 CMS certificates and the frozen issuer chain.- Parameters:
endpoint- the EST endpointcsrBody- PKCS#10 DER, PEM, or RFC 7030 base64; self-signature must be validclientCert- authenticated mTLS client certificate- Returns:
- completed CMS response, pending approval/signing response, or terminal rejection
- Throws:
EstProtocolException- if input validation or durable admission is unavailable
-
simpleenroll
public EstService.EnrollmentResult simpleenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert, CancellationSignal cancellation) throws EstProtocolException Admits or continues enrollment with cancellation before the durable signing claim.- Parameters:
endpoint- exact endpointcsrBody- bounded original PKCS#10 DER, PEM, or base64clientCert- verified TLS end-client certificatecancellation- transport cancellation signal- Returns:
- durable response outcome
- Throws:
EstProtocolException- if validation or admission fails
-
simplereenroll
public EstService.EnrollmentResult simplereenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert) throws EstProtocolException Performs ESTsimplereenroll(RFC 7030 section 4.2.2): renews the client's certificate after proving the authoritative predecessor identity and satisfying the frozen approval and proof policy. Repeated identical requests retain one operation.- Parameters:
endpoint- the EST endpointcsrBody- renewal PKCS#10 DER, PEM, or base64; self-signature must be validclientCert- authenticated mTLS client certificate (the predecessor)- Returns:
- completed CMS response, pending approval/signing response, or terminal rejection
- Throws:
EstProtocolException- if identity validation or durable admission is unavailable
-
simplereenroll
public EstService.EnrollmentResult simplereenroll(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert, CancellationSignal cancellation) throws EstProtocolException Admits or continues exact-identity renewal with pre-claim cancellation.- Parameters:
endpoint- exact endpointcsrBody- bounded original PKCS#10 DER, PEM, or base64clientCert- verified TLS predecessor certificatecancellation- transport cancellation signal- Returns:
- durable response outcome
- Throws:
EstProtocolException- if validation or admission fails
-
csrattrs
Returns CSR attribute suggestions as MIME-base64-encoded RFC 7030CsrAttrsDER (RFC 7030 section 4.5).- Parameters:
endpoint- the EST endpoint- Returns:
- MIME-base64-encoded CsrAttrs DER (empty sequence when no suggestions)
-
serverkeygen
public EstServerKeygenResponse serverkeygen(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert) throws EstProtocolException Performs server-key generation through durable encrypted-artifact admission. This overload has no caller cancellation signal.- Parameters:
endpoint- registered endpointcsrBody- exact DER, PEM or MIME-base64 PKCS#10 templateclientCert- authenticated TLS recipient- Returns:
- pending, terminal or lazily leased encrypted delivery
- Throws:
EstProtocolException- if validation or custody is unavailable
-
serverkeygen
public EstServerKeygenResponse serverkeygen(EstEndpoint endpoint, byte[] csrBody, X509Certificate clientCert, CancellationSignal cancellation) throws EstProtocolException Freezes the authenticated original template and reserves capacity before generating a key. Ciphertext is generator-signed, encrypted and durably attached before approval or issuance. Exact retries resume the retained transaction and never regenerate a key. Template proof is ignored as required by RFC 7030; the generated CSR undergoes normal frozen-profile proof checks.- Parameters:
endpoint- registered endpointcsrBody- original template in DER, PEM or MIME-base64 formclientCert- actual authenticated TLS recipientcancellation- checked before generation, attachment and dispatch- Returns:
- typed protocol status with resource-free deferred delivery
- Throws:
EstProtocolException- if input, negotiation, policy or custody fails
-