Class DefaultProfileService
java.lang.Object
zeroecho.pki.impl.core.DefaultProfileService
- All Implemented Interfaces:
ProfileService
Store-backed implementation of the certificate-profile lifecycle.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultProfileService(PkiStore store, Clock clock, AuditSink auditSink) Creates a profile service using one authoritative clock.DefaultProfileService(PkiStore store, Clock clock, AuditSink auditSink, X509AlgorithmBindingRegistry algorithmBindings) Creates a profile service bound to one immutable algorithm registry.DefaultProfileService(PkiStore store, Clock clock, AuditSink auditSink, X509AlgorithmBindingRegistry algorithmBindings, boolean signingConfigured, Optional<String> certificateBinding, Optional<String> crlBinding, Optional<String> publicKeyBinding) Creates a profile service with the session's explicit signing bindings. -
Method Summary
Modifier and TypeMethodDescriptionactivateProfile(String profileId, long profileVersion) Explicitly activates one already imported version.getActiveReference(String profileId) Retrieves the current active reference without activating anything.getImportedVersion(String profileId, long profileVersion) Retrieves one immutable imported version for administration.Imports a built-in provisioning template through the same document path.importProfile(byte[] jsonDocument) Imports a bounded strict JSON profile document without activating it.importProfile(InputStream jsonDocument) Imports a strict JSON profile document without taking ownership of the supplied stream.listImportedVersions(String profileId) Lists immutable imported versions for one logical profile.requireActiveProfile(String profileId) Resolves and validates the exact active profile.
-
Constructor Details
-
DefaultProfileService
-
DefaultProfileService
public DefaultProfileService(PkiStore store, Clock clock, AuditSink auditSink, X509AlgorithmBindingRegistry algorithmBindings) Creates a profile service bound to one immutable algorithm registry.- Parameters:
store- authoritative PKI storeclock- authoritative clockauditSink- audit sinkalgorithmBindings- active immutable binding registry
-
DefaultProfileService
public DefaultProfileService(PkiStore store, Clock clock, AuditSink auditSink, X509AlgorithmBindingRegistry algorithmBindings, boolean signingConfigured, Optional<String> certificateBinding, Optional<String> crlBinding, Optional<String> publicKeyBinding) Creates a profile service with the session's explicit signing bindings.- Parameters:
store- authoritative PKI storeclock- authoritative lifecycle clockauditSink- audit destinationalgorithmBindings- active immutable binding registrysigningConfigured- whether signing capabilities are enabledcertificateBinding- optional explicit certificate-signature bindingcrlBinding- optional explicit CRL-signature bindingpublicKeyBinding- optional explicit subject-public-key binding
-
-
Method Details
-
importProfile
Description copied from interface:ProfileServiceImports a bounded strict JSON profile document without activating it.- Specified by:
importProfilein interfaceProfileService- Parameters:
jsonDocument- canonical profile JSON bytes- Returns:
- imported immutable profile reference
-
importProfile
Description copied from interface:ProfileServiceImports a strict JSON profile document without taking ownership of the supplied stream.- Specified by:
importProfilein interfaceProfileService- Parameters:
jsonDocument- bounded profile JSON stream, left open- Returns:
- imported immutable profile reference
-
importBuiltIn
Description copied from interface:ProfileServiceImports a built-in provisioning template through the same document path.- Specified by:
importBuiltInin interfaceProfileService- Parameters:
template- versioned built-in profile template- Returns:
- imported immutable profile reference
-
activateProfile
Description copied from interface:ProfileServiceExplicitly activates one already imported version.- Specified by:
activateProfilein interfaceProfileService- Parameters:
profileId- nonblank logical profile identifierprofileVersion- positive imported version- Returns:
- exact newly active profile reference
-
requireActiveProfile
Description copied from interface:ProfileServiceResolves and validates the exact active profile.- Specified by:
requireActiveProfilein interfaceProfileService- Parameters:
profileId- nonblank logical profile identifier- Returns:
- validated immutable active profile
-
getImportedVersion
public Optional<ImportedCertificateProfileVersion> getImportedVersion(String profileId, long profileVersion) Description copied from interface:ProfileServiceRetrieves one immutable imported version for administration.- Specified by:
getImportedVersionin interfaceProfileService- Parameters:
profileId- nonblank logical profile identifierprofileVersion- positive imported version- Returns:
- imported version, or empty when absent
-
listImportedVersions
Description copied from interface:ProfileServiceLists immutable imported versions for one logical profile.- Specified by:
listImportedVersionsin interfaceProfileService- Parameters:
profileId- nonblank logical profile identifier- Returns:
- immutable versions in ascending version order
-
getActiveReference
Description copied from interface:ProfileServiceRetrieves the current active reference without activating anything.- Specified by:
getActiveReferencein interfaceProfileService- Parameters:
profileId- nonblank logical profile identifier- Returns:
- active reference, or empty when none is active
-