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.

The session owns its key material. close() destroys the AES SecretKey, which zeroes the bytes it holds; a SecretKeySpec cannot do that (its destroy() throws DestroyFailedException), so the key is held in a destroyable key of this package. After close the session must not be used: getAesKey() throws, and a key reference taken before the close reports Destroyable.isDestroyed() and refuses Key.getEncoded().

  • 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()
      Destroys the AES SecretKey, zeroing the key bytes the session owns. Idempotent.
      Specified by:
      close in interface AutoCloseable