Class AcmeService
java.lang.Object
zeroecho.pki.server.acme.AcmeService
Transport-neutral durable ACME state machine and constrained PKI integration.
Account identity is protocol-scoped. No method accepts an administrative principal or permission as issuance authority. Directory activation freezes one exact authority, profile, issuer generation, chain path, provider set, and profile-owned confirmation policy. External validators return evidence only.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSafe immutable directory-registration input. -
Constructor Summary
ConstructorsConstructorDescriptionAcmeService(ServerRealmContext realm, Clock clock, SecureRandom random, Map<String, AcmeChallengeProvider> providers, Map<String, ProviderConfig> providerConfigurations) Creates an ACME service without EAB providers.AcmeService(ServerRealmContext realm, Clock clock, SecureRandom random, Map<String, AcmeChallengeProvider> providers, Map<String, ProviderConfig> providerConfigurations, Map<String, AcmeExternalAccountBindingProvider> eabProviders, Map<String, ProviderConfig> eabProviderConfigurations) Creates a realm-bound ACME service with periodic-only reconciliation compatibility.AcmeService(ServerRealmContext realm, Clock clock, SecureRandom random, Map<String, AcmeChallengeProvider> providers, Map<String, ProviderConfig> providerConfigurations, Map<String, AcmeExternalAccountBindingProvider> eabProviders, Map<String, ProviderConfig> eabProviderConfigurations, Runnable reconciliationWake) Creates a realm-bound ACME service from explicitly enabled providers. -
Method Summary
Modifier and TypeMethodDescriptionReturns one account record without exposing contact data through transport automatically.accountByKey(String directoryId, String keyThumbprint) Resolves an account by its authenticated key identity within one directory.accountDirectory(String accountId) Resolves the exact frozen directory for one existing account resource.accountKey(String accountId, String kid) Resolves one active account key for strict KID authentication.accounts(int offset, int limit) Returns a deterministic bounded page of accounts for administrative inspection.activateDirectory(String directoryId) Activates one exact directory revision after revalidating all frozen PKI authority.activeDirectory(String alias) Resolves the sole active directory revision for one public alias.authorization(String accountId, String authorizationId) Returns one account-owned authorization without revealing another account's state.authorizationDirectory(String authorizationId) Resolves the exact frozen directory for one existing authorization resource.Returns one account-owned challenge without URL-derived authority.challengeDirectory(String challengeId) Resolves the exact frozen directory for one existing challenge resource.completeCredentialConfirmation(String accountId, String expectedAccountCommitment, String orderId, long expectedLifecycleRevision, String expectedLifecycleRecordCommitment, String expectedChallengeRecordCommitment, byte[] response) Completes or exactly replays confirmation proof processing for one valid account-owned order.Returns configured challenge-provider identities and supported challenge types without options.Returns explicitly configured external-account-binding provider identifiers without options.createAccount(AcmeState.Directory directory, String keyThumbprint, byte[] publicKeySpki, List<String> contacts, boolean termsAgreed, Optional<String> eabPolicyCommitment, boolean onlyReturnExisting) Creates or returns an account under one exact active directory.createOrder(String accountId, String expectedAccountCommitment, AcmeState.Directory directory, List<AcmeState.Identifier> requested, Optional<Instant> notBefore, Optional<Instant> notAfter, Duration orderLifetime) Atomically creates one account-owned order, authorization, and challenge graph.deactivateAccount(String accountId) Durably changes account status while preserving its key and history commitment.deactivateAccount(String accountId, String expectedCommitment) Durably changes account status after exact account-key authority revalidation.deactivateDirectory(String directoryId) Deactivates new account/order admission while existing unexpired orders remain usable.directories(int offset, int limit) Returns a deterministic bounded page of directory revisions.Returns one exact directory revision for administrative and protocol inspection.finalizeOrder(String accountId, String expectedAccountCommitment, String orderId, byte[] csrDer) Finalizes a ready order through the existing strict CSR and issuance services.finalizeOrder(String accountId, String expectedAccountCommitment, String orderId, byte[] csrDer, CancellationSignal cancellation) Finalizes a ready order while propagating transport cancellation into signing.issueCredentialConfirmationChallenge(String accountId, String expectedAccountCommitment, String orderId) Issues or exactly replays confirmation proof material for one valid account-owned order.nonceScope(String alias) Returns the canonical nonce scope for one known directory alias.Polls an account-owned order using the exact current authentication snapshot.order(String accountId, String expectedAccountCommitment, String orderId, CancellationSignal cancellation) Continues an authenticated order with cancellation before durable admission.orderDirectory(String orderId) Resolves the exact frozen directory for one existing order resource.intpendingOrderCount(String accountId, int stopAt) Counts pending nonterminal orders up to a caller-supplied finite bound.registerDirectory(AcmeService.DirectoryRegistration registration) Registers directly after resolving the same exact active-profile precondition.registerDirectory(AcmeService.DirectoryRegistration registration, ServerControlOperation.AcmeDirectoryProfilePrecondition profilePrecondition) Registers one immutable inactive directory revision from an approval-bound profile precondition.Resolves the active profile precondition that must be bound into approval.revokeCertificate(String accountId, String expectedAccountCommitment, AcmeState.Directory directory, byte[] certificateDer, RevocationReason reason, String requestId) Revokes one certificate issued to the authenticated account through the bound directory.rolloverAccount(String accountId, String expectedCommitment, String replacementThumbprint, byte[] replacementSpki) Atomically replaces one account key after exact old-record authentication.updateAccountContacts(String accountId, String expectedCommitment, List<String> contacts) Atomically replaces bounded account contact metadata without changing key authority.validateChallenge(String accountId, String expectedAccountCommitment, String challengeId, String accountKeyThumbprint, Instant deadline, CancellationSignal cancellation) Claims and performs one explicit challenge validation attempt.verifyExternalAccountBinding(AcmeState.Directory directory, String keyThumbprint, Optional<byte[]> nestedJws) Verifies EAB inside its explicit secret-confining provider and returns only a safe commitment.
-
Constructor Details
-
AcmeService
public AcmeService(ServerRealmContext realm, Clock clock, SecureRandom random, Map<String, AcmeChallengeProvider> providers, Map<String, ProviderConfig> providerConfigurations, Map<String, AcmeExternalAccountBindingProvider> eabProviders, Map<String, ProviderConfig> eabProviderConfigurations, Runnable reconciliationWake) Creates a realm-bound ACME service from explicitly enabled providers.- Parameters:
realm- realm context owning all ACME stateclock- authoritative server clockrandom- cryptographically secure identifier sourceproviders- explicitly enabled challenge providers keyed by identifierproviderConfigurations- validated configuration for each challenge providereabProviders- explicitly enabled external-account-binding providerseabProviderConfigurations- validated configuration for each EAB providerreconciliationWake- callback that promptly wakes durable signing reconciliation
-
AcmeService
public AcmeService(ServerRealmContext realm, Clock clock, SecureRandom random, Map<String, AcmeChallengeProvider> providers, Map<String, ProviderConfig> providerConfigurations, Map<String, AcmeExternalAccountBindingProvider> eabProviders, Map<String, ProviderConfig> eabProviderConfigurations) Creates a realm-bound ACME service with periodic-only reconciliation compatibility.- Parameters:
realm- realm context owning all ACME stateclock- authoritative server clockrandom- cryptographically secure identifier sourceproviders- explicitly enabled challenge providers keyed by identifierproviderConfigurations- validated configuration for each challenge providereabProviders- explicitly enabled external-account-binding providerseabProviderConfigurations- validated configuration for each EAB provider
-
AcmeService
public AcmeService(ServerRealmContext realm, Clock clock, SecureRandom random, Map<String, AcmeChallengeProvider> providers, Map<String, ProviderConfig> providerConfigurations) Creates an ACME service without EAB providers.- Parameters:
realm- realm context owning all ACME stateclock- authoritative server clockrandom- cryptographically secure identifier sourceproviders- explicitly enabled challenge providers keyed by identifierproviderConfigurations- validated configuration for each challenge provider
-
-
Method Details
-
configuredChallengeProviders
Returns configured challenge-provider identities and supported challenge types without options.- Returns:
- immutable map of non-secret configured provider metadata
-
configuredEabProviders
-
resolveDirectoryProfilePrecondition
public ServerControlOperation.AcmeDirectoryProfilePrecondition resolveDirectoryProfilePrecondition(AcmeService.DirectoryRegistration registration) Resolves the active profile precondition that must be bound into approval.- Parameters:
registration- validated directory registration input- Returns:
- authoritative profile and policy precondition
-
registerDirectory
public AcmeState.Directory registerDirectory(AcmeService.DirectoryRegistration registration, ServerControlOperation.AcmeDirectoryProfilePrecondition profilePrecondition) Registers one immutable inactive directory revision from an approval-bound profile precondition.- Parameters:
registration- validated directory registration inputprofilePrecondition- approval-bound authoritative profile precondition- Returns:
- durably registered inactive directory revision
-
registerDirectory
Registers directly after resolving the same exact active-profile precondition.- Parameters:
registration- validated directory registration input- Returns:
- durably registered inactive directory revision
-
activateDirectory
Activates one exact directory revision after revalidating all frozen PKI authority.- Parameters:
directoryId- stable directory identifier- Returns:
- active directory revision
-
deactivateDirectory
Deactivates new account/order admission while existing unexpired orders remain usable.- Parameters:
directoryId- stable directory identifier- Returns:
- inactive directory revision
-
activeDirectory
Resolves the sole active directory revision for one public alias.- Parameters:
alias- public directory alias- Returns:
- sole active directory revision
-
nonceScope
-
directory
Returns one exact directory revision for administrative and protocol inspection.- Parameters:
directoryId- stable directory identifier- Returns:
- exact directory revision
-
accountDirectory
Resolves the exact frozen directory for one existing account resource.- Parameters:
accountId- stable account identifier- Returns:
- account's frozen directory revision
-
orderDirectory
Resolves the exact frozen directory for one existing order resource.- Parameters:
orderId- stable order identifier- Returns:
- order's frozen directory revision
-
authorizationDirectory
Resolves the exact frozen directory for one existing authorization resource.- Parameters:
authorizationId- stable authorization identifier- Returns:
- authorization's frozen directory revision
-
challengeDirectory
Resolves the exact frozen directory for one existing challenge resource.- Parameters:
challengeId- stable challenge identifier- Returns:
- challenge's frozen directory revision
-
directories
Returns a deterministic bounded page of directory revisions.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- deterministic bounded directory page
-
createAccount
public AcmeState.Account createAccount(AcmeState.Directory directory, String keyThumbprint, byte[] publicKeySpki, List<String> contacts, boolean termsAgreed, Optional<String> eabPolicyCommitment, boolean onlyReturnExisting) Creates or returns an account under one exact active directory.- Parameters:
directory- exact frozen directory revisionkeyThumbprint- authenticated account-key thumbprintpublicKeySpki- canonical subject-public-key informationcontacts- bounded account contact URIstermsAgreed- whether current terms were acceptedeabPolicyCommitment- optional external-account-binding policy commitmentonlyReturnExisting- whether account creation must be refused- Returns:
- existing or newly created account
-
accountByKey
Resolves an account by its authenticated key identity within one directory.- Parameters:
directoryId- stable directory identifierkeyThumbprint- authenticated account-key thumbprint- Returns:
- matching account, or empty when unknown
-
verifyExternalAccountBinding
public Optional<String> verifyExternalAccountBinding(AcmeState.Directory directory, String keyThumbprint, Optional<byte[]> nestedJws) Verifies EAB inside its explicit secret-confining provider and returns only a safe commitment.- Parameters:
directory- exact frozen directory revisionkeyThumbprint- authenticated account-key thumbprintnestedJws- optional nested EAB JWS document- Returns:
- safe policy commitment, or empty when EAB is unused
-
accountKey
Resolves one active account key for strict KID authentication.- Parameters:
accountId- stable account identifierkid- exact account key identifier- Returns:
- validated account key and record commitment
-
account
Returns one account record without exposing contact data through transport automatically.- Parameters:
accountId- stable account identifier- Returns:
- exact account record
-
deactivateAccount
Durably changes account status while preserving its key and history commitment.- Parameters:
accountId- stable account identifier- Returns:
- durably deactivated account
-
deactivateAccount
Durably changes account status after exact account-key authority revalidation.- Parameters:
accountId- stable account identifierexpectedCommitment- expected current account-record commitment- Returns:
- durably deactivated account
-
updateAccountContacts
public AcmeState.Account updateAccountContacts(String accountId, String expectedCommitment, List<String> contacts) Atomically replaces bounded account contact metadata without changing key authority.- Parameters:
accountId- stable account identifierexpectedCommitment- expected current account-record commitmentcontacts- bounded account contact URIs- Returns:
- durably updated account
-
rolloverAccount
public AcmeState.Account rolloverAccount(String accountId, String expectedCommitment, String replacementThumbprint, byte[] replacementSpki) Atomically replaces one account key after exact old-record authentication.- Parameters:
accountId- stable account identifierexpectedCommitment- expected current account-record commitmentreplacementThumbprint- replacement account-key thumbprintreplacementSpki- canonical replacement public key- Returns:
- account with the replacement key
-
accounts
Returns a deterministic bounded page of accounts for administrative inspection.- Parameters:
offset- zero-based page offsetlimit- positive page-size limit- Returns:
- deterministic bounded account page
-
createOrder
public AcmeState.Order createOrder(String accountId, String expectedAccountCommitment, AcmeState.Directory directory, List<AcmeState.Identifier> requested, Optional<Instant> notBefore, Optional<Instant> notAfter, Duration orderLifetime) Atomically creates one account-owned order, authorization, and challenge graph.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentdirectory- exact frozen directory revisionrequested- requested certificate identifiersnotBefore- optional requested validity startnotAfter- optional requested validity endorderLifetime- positive order lifetime- Returns:
- durably created order
-
pendingOrderCount
Counts pending nonterminal orders up to a caller-supplied finite bound.- Parameters:
accountId- stable account identifierstopAt- positive early-stop bound- Returns:
- number of pending orders, capped by the supplied bound
-
revokeCertificate
public RevocationRecord revokeCertificate(String accountId, String expectedAccountCommitment, AcmeState.Directory directory, byte[] certificateDer, RevocationReason reason, String requestId) Revokes one certificate issued to the authenticated account through the bound directory.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentdirectory- exact frozen directory revisioncertificateDer- canonical certificate DERreason- permanent revocation reasonrequestId- stable request correlation identifier- Returns:
- committed revocation record
-
validateChallenge
public AcmeState.Challenge validateChallenge(String accountId, String expectedAccountCommitment, String challengeId, String accountKeyThumbprint, Instant deadline, CancellationSignal cancellation) Claims and performs one explicit challenge validation attempt.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentchallengeId- stable challenge identifieraccountKeyThumbprint- authenticated account-key thumbprintdeadline- absolute validation deadlinecancellation- cooperative cancellation signal- Returns:
- durably completed challenge attempt
-
finalizeOrder
public AcmeState.Order finalizeOrder(String accountId, String expectedAccountCommitment, String orderId, byte[] csrDer) Finalizes a ready order through the existing strict CSR and issuance services.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentorderId- stable order identifiercsrDer- canonical PKCS#10 request DER- Returns:
- current durable order after finalization processing
-
finalizeOrder
public AcmeState.Order finalizeOrder(String accountId, String expectedAccountCommitment, String orderId, byte[] csrDer, CancellationSignal cancellation) Finalizes a ready order while propagating transport cancellation into signing.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentorderId- stable order identifiercsrDer- canonical PKCS#10 request DERcancellation- cooperative cancellation signal- Returns:
- current durable order after finalization processing
-
order
Polls an account-owned order using the exact current authentication snapshot. Pending approvals remain processing; approved retained requests may dispatch.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- current account commitment verified by JWS authenticationorderId- stable order identifier- Returns:
- account-owned order after durable continuation
-
order
public AcmeState.Order order(String accountId, String expectedAccountCommitment, String orderId, CancellationSignal cancellation) Continues an authenticated order with cancellation before durable admission.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- current JWS-authenticated account commitmentorderId- stable order identifiercancellation- transport cancellation signal- Returns:
- account-owned order after durable continuation
-
authorization
Returns one account-owned authorization without revealing another account's state.- Parameters:
accountId- stable account identifierauthorizationId- stable authorization identifier- Returns:
- account-owned authorization
-
challenge
Returns one account-owned challenge without URL-derived authority.- Parameters:
accountId- stable account identifierchallengeId- stable challenge identifier- Returns:
- account-owned challenge
-
issueCredentialConfirmationChallenge
public CredentialConfirmationProofChallenge issueCredentialConfirmationChallenge(String accountId, String expectedAccountCommitment, String orderId) Issues or exactly replays confirmation proof material for one valid account-owned order.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentorderId- stable order identifier- Returns:
- issued or replayed confirmation challenge
-
completeCredentialConfirmation
public CredentialConfirmationProofResult completeCredentialConfirmation(String accountId, String expectedAccountCommitment, String orderId, long expectedLifecycleRevision, String expectedLifecycleRecordCommitment, String expectedChallengeRecordCommitment, byte[] response) Completes or exactly replays confirmation proof processing for one valid account-owned order.- Parameters:
accountId- stable account identifierexpectedAccountCommitment- expected current account-record commitmentorderId- stable order identifierexpectedLifecycleRevision- expected confirmation lifecycle revisionexpectedLifecycleRecordCommitment- expected lifecycle-record commitmentexpectedChallengeRecordCommitment- expected proof-challenge record commitmentresponse- suite-defined proof response bytes- Returns:
- durable confirmation result
-