Class DisclosureService
java.lang.Object
zeroecho.pki.server.DisclosureService
Durable disclosure authority and capability-based retrieval decision service.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPersisted commitment-only capability authority.static enumSafe retrieval result that reveals no protected-object existence.static final recordConfiguration-driven safe defaults.static enumDurable one-time delivery classification without retaining the raw token.static final classOne-time raw-token issuance result.static enumPublic-object classes with independent default policies.static final recordTyped disclosure owner, keeping ACME accounts outside administrative principals.static enumPersisted disclosure states, independent of issuance and publication.static final recordDurable policy bound to exact object and profile/policy commitment. -
Constructor Summary
ConstructorsConstructorDescriptionDisclosureService(RealmId realmId, ServerControlStore store, DisclosureService.Defaults defaults, Clock clock, SecureRandom random, AuditSink auditSink) Creates a durable disclosure service with an injected random source and clock. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbearerCredential(String capabilityId, byte[] token) Returns the strict bearer credential for one non-secret capability ID.static StringbearerCredential(DisclosureService.Capability capability, byte[] token) Returns the strict one-time bearer credential for an issued capability.change(PkiId objectId, DisclosureService.Policy policy, boolean exposureApprovalRequired, boolean approvalPresented, String actorPrincipalId) Changes only disclosure metadata; increased exposure may require approval.classifyDelivery(String capabilityId, boolean delivered) Persists the safe post-write delivery classification without changing token validity.decide(PkiId objectId, Optional<SecurityPrincipal> principal, boolean ownerRelationship, boolean administrativePermission, Optional<byte[]> capabilityToken) Evaluates direct retrieval separately from search authorization.decideRepository(PkiId objectId, Optional<SecurityPrincipal> principal, boolean ownerRelationship, boolean administrativePermission, Optional<String> bearer) Evaluates public repository retrieval using a point-addressable bearer credential.defaultPolicy(DisclosureService.ObjectType type, boolean rootCa, boolean sensitive) Returns the default policy for one object classification.issueCapability(PkiId objectId, Instant expiresAt, String actorPrincipalId) Issues 256 random capability bits and persists only their commitment.register(PkiId objectId, DisclosureService.ObjectType type, DisclosureService.Policy policy, Optional<String> ownerPrincipalId, String profileOrPolicyCommitment, String actorPrincipalId) Persists the first disclosure record without touching PKI content.registerExact(PkiId objectId, DisclosureService.ObjectType type, DisclosureService.Policy policy, Optional<DisclosureService.Owner> owner, String profileOrPolicyCommitment, String actorPrincipalId) Persists or exactly replays one disclosure record with an optional typed owner.revokeCapability(String capabilityId, String actorPrincipalId) Revokes a capability without revealing or recovering its raw token.
-
Constructor Details
-
DisclosureService
public DisclosureService(RealmId realmId, ServerControlStore store, DisclosureService.Defaults defaults, Clock clock, SecureRandom random, AuditSink auditSink) Creates a durable disclosure service with an injected random source and clock.- Parameters:
realmId- owning security realmstore- durable server-control storedefaults- configuration-driven disclosure defaultsclock- authoritative server clockrandom- cryptographically secure token sourceauditSink- required safe audit sink
-
-
Method Details
-
defaultPolicy
public DisclosureService.Policy defaultPolicy(DisclosureService.ObjectType type, boolean rootCa, boolean sensitive) Returns the default policy for one object classification.- Parameters:
type- protected object classificationrootCa- whether a CA certificate is a rootsensitive- whether a leaf contains sensitive data- Returns:
- configured default disclosure policy
-
register
public DisclosureService.Record register(PkiId objectId, DisclosureService.ObjectType type, DisclosureService.Policy policy, Optional<String> ownerPrincipalId, String profileOrPolicyCommitment, String actorPrincipalId) Persists the first disclosure record without touching PKI content.- Parameters:
objectId- exact protected object identifiertype- protected object classificationpolicy- effective or requested disclosure policyownerPrincipalId- optional administrative ownerprofileOrPolicyCommitment- governing profile or policy commitmentactorPrincipalId- authenticated audit actor- Returns:
- newly persisted disclosure record
-
registerExact
public DisclosureService.Record registerExact(PkiId objectId, DisclosureService.ObjectType type, DisclosureService.Policy policy, Optional<DisclosureService.Owner> owner, String profileOrPolicyCommitment, String actorPrincipalId) Persists or exactly replays one disclosure record with an optional typed owner.- Parameters:
objectId- exact disclosed object identitytype- exact object classificationpolicy- frozen disclosure policyowner- optional explicit protocol or administrative ownerprofileOrPolicyCommitment- exact governing policy commitmentactorPrincipalId- audit actor; never inferred fromowner- Returns:
- newly committed or exactly matching existing record
- Throws:
IllegalStateException- if an existing record differs
-
change
public DisclosureService.Record change(PkiId objectId, DisclosureService.Policy policy, boolean exposureApprovalRequired, boolean approvalPresented, String actorPrincipalId) Changes only disclosure metadata; increased exposure may require approval.- Parameters:
objectId- exact protected object identifierpolicy- effective or requested disclosure policyexposureApprovalRequired- whether increased exposure requires approvalapprovalPresented- whether the required approval is presentactorPrincipalId- authenticated audit actor- Returns:
- durably updated disclosure record
-
decide
public DisclosureService.Decision decide(PkiId objectId, Optional<SecurityPrincipal> principal, boolean ownerRelationship, boolean administrativePermission, Optional<byte[]> capabilityToken) Evaluates direct retrieval separately from search authorization.- Parameters:
objectId- exact protected object identifierprincipal- optional authenticated principalownerRelationship- whether the principal owns the objectadministrativePermission- whether explicit administrative access is grantedcapabilityToken- optional raw capability token- Returns:
- non-revealing retrieval decision
-
decideRepository
public DisclosureService.Decision decideRepository(PkiId objectId, Optional<SecurityPrincipal> principal, boolean ownerRelationship, boolean administrativePermission, Optional<String> bearer) Evaluates public repository retrieval using a point-addressable bearer credential. Capability and principal authority are not combined.- Parameters:
objectId- exact repository object identityprincipal- authenticated principal, or empty for a public requestownerRelationship- whether the principal owns the objectadministrativePermission- whether administrative disclosure is authorizedbearer- point-addressable bearer credential, or empty- Returns:
- a non-disclosing allow or deny decision
-
bearerCredential
Returns the strict one-time bearer credential for an issued capability.- Parameters:
capability- persisted capability metadatatoken- exact 32-byte raw capability token- Returns:
- strict point-addressable bearer credential
-
bearerCredential
Returns the strict bearer credential for one non-secret capability ID.- Parameters:
capabilityId- stable non-bearer capability identifiertoken- exact 32-byte raw capability token- Returns:
- strict point-addressable bearer credential
-
issueCapability
public DisclosureService.IssuedCapability issueCapability(PkiId objectId, Instant expiresAt, String actorPrincipalId) Issues 256 random capability bits and persists only their commitment.- Parameters:
objectId- exact protected object identifierexpiresAt- mandatory capability expiryactorPrincipalId- authenticated audit actor- Returns:
- one-time raw token and persisted commitment-only metadata
-
revokeCapability
Revokes a capability without revealing or recovering its raw token.- Parameters:
capabilityId- stable non-bearer capability identifieractorPrincipalId- authenticated audit actor- Returns:
- durably revoked capability
-
classifyDelivery
Persists the safe post-write delivery classification without changing token validity.- Parameters:
capabilityId- stable non-bearer capability identifierdelivered- whether raw-token delivery completed- Returns:
- durably classified capability metadata
-