Class PqcTransportSession
java.lang.Object
co.ankatech.ankasecure.sdk.transport.PqcTransportSession
- All Implemented Interfaces:
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
-
getAesKey
-
getCreatedAt
-
isClosed
public boolean isClosed()- Returns:
trueifclose()has been called; never throws
-
close
public void close()Destroys the AESSecretKey, zeroing the key bytes the session owns. Idempotent.- Specified by:
closein interfaceAutoCloseable
-