Class PqcTransportSession

java.lang.Object
co.ankatech.ankasecure.sdk.transport.PqcTransportSession
All Implemented Interfaces:
AutoCloseable

public final class PqcTransportSession extends Object implements AutoCloseable
Internal representation of a PQC transport session: holds sessionId, AES key, and creation timestamp.

SDK-003 (secure-memory-cutover Slice 3): now implements AutoCloseable. close() calls Zeroization.destroyIfPossible(Object) on the AES SecretKey (best-effort — SecretKeySpec.destroy() throws DestroyFailedException by default, which destroyIfPossible swallows; the wrapping byte[] was already zeroized in PqcSessionManager.getSession() immediately after the SecretKeySpec was constructed). After close, the session must not be used; call sites guard with isClosed() where needed.

  • Method Details

    • getSessionId

      public String getSessionId()
    • getAesKey

      public SecretKey getAesKey()
    • getCreatedAt

      public Instant getCreatedAt()
    • isClosed

      public boolean isClosed()
      Returns:
      true if close() has been called; never throws
    • close

      public void close()
      Best-effort destruction of the underlying AES SecretKey. Idempotent. The wrapping byte[] was already zeroized at session creation time in PqcSessionManager.getSession().
      Specified by:
      close in interface AutoCloseable