Class EnrollmentRuntime.CredentialLease

java.lang.Object
zeroecho.pki.server.enrollment.EnrollmentRuntime.CredentialLease
All Implemented Interfaces:
AutoCloseable
Enclosing class:
EnrollmentRuntime

public final class EnrollmentRuntime.CredentialLease extends Object implements AutoCloseable
Bounded credential borrower. Key imports occur outside the runtime monitor. Do not share a lease across threads or close it concurrently with a use. Certificate lists are immutable and contain public material only.
  • Method Details

    • configuration

      Returns the exact frozen public configuration.
      Returns:
      immutable credential configuration
    • responseChain

      public List<X509Certificate> responseChain()
      Returns response leaf followed by its exact authority chain.
      Returns:
      immutable public certificate chain, empty for PBM-only sets
    • requestTrustAnchors

      public List<X509Certificate> requestTrustAnchors()
      Returns this authority's configured request trust anchors.
      Returns:
      immutable public anchors
    • privateKey

      public PrivateKey privateKey()
      Imports the provisioned response private key. The caller may use it only during this lease and must not serialize, log or retain it.
      Returns:
      private key for the exact response certificate
      Throws:
      IllegalStateException - if absent or import fails
    • pbmSecret

      public SecretKey pbmSecret(String senderKid)
      Imports a configured PBM secret for the exact senderKID. The caller owns any extracted byte copy and must zero it after use.
      Parameters:
      senderKid - exact canonical configured senderKID
      Returns:
      borrowed secret key, usable only within this lease
      Throws:
      IllegalStateException - if not configured or import fails
    • close

      public void close()
      Releases this borrower exactly once; it does not close shared custody.
      Specified by:
      close in interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object