Class PqcSessionManager
java.lang.Object
co.ankatech.ankasecure.sdk.transport.PqcSessionManager
Manages PQC transport sessions: generates a key pair for the configured
KEM (
PqcTransportConfig.getKemAlgorithm()), performs the handshake,
unwraps the AES session key, and caches the session until its TTL expires.
One session is cached at a time, guarded by one lock. Every replacement of the cached session
(TTL expiry, replaceIfCurrent(PqcTransportSession), invalidateSession()) closes the
evicted session, which destroys its AES key. A request therefore never reads the key from a session
another thread may close: it takes a PqcSessionManager.Lease, a private copy of the key taken under the same
lock, and zeroes that copy when the request ends.
-
Constructor Summary
ConstructorsConstructorDescriptionPqcSessionManager(co.ankatech.ankasecure.openapi.client.AnkaSecureOpenApiClient client, PqcTransportConfig config) Constructs manager with the given client and config. -
Method Summary
Modifier and TypeMethodDescriptionReturns an active session, or performs a new handshake if none exists or TTL expired.voidInvalidates the current session, forcing handshake on next request.
-
Constructor Details
-
PqcSessionManager
public PqcSessionManager(co.ankatech.ankasecure.openapi.client.AnkaSecureOpenApiClient client, PqcTransportConfig config) Constructs manager with the given client and config.- Parameters:
client- ANKASecure client to perform handshakeconfig- PQC transport config; its KEM is the one every handshake uses
-
-
Method Details
-
getSession
Returns an active session, or performs a new handshake if none exists or TTL expired.- Returns:
- active transport session containing sessionId and AES key
- Throws:
co.ankatech.secure.client.invoker.ApiException- on handshake or unwrap errors
-
invalidateSession
public void invalidateSession()Invalidates the current session, forcing handshake on next request.
-