public class MuxedPQSKM extends SessionKeyManager
| Constructor and Description |
|---|
MuxedPQSKM(RatchetSKM ec,
RatchetSKM pq) |
| Modifier and Type | Method and Description |
|---|---|
RatchetEntry |
consumeNextAvailableTag(PublicKey target)
EC/PQ
|
SessionTag |
consumeNextAvailableTag(PublicKey target,
SessionKey key)
ElG only
|
SessionKey |
consumeTag(SessionTag tag)
Determine if we have received a session key associated with the given session tag,
and if so, discard it (but keep track for frequent dups) and return the decryption
key it was received with (via tagsReceived(...)).
|
SessionKey |
createSession(PublicKey target)
ElG only
|
void |
createSession(PublicKey target,
SessionKey key)
ElG only
|
void |
failTags(PublicKey target,
SessionKey key,
TagSetHandle ts)
ElG only
|
int |
getAvailableTags(PublicKey target,
SessionKey key)
Determine (approximately) how many available session tags for the current target
have been confirmed and are available
|
long |
getAvailableTimeLeft(PublicKey target,
SessionKey key)
Determine how long the available tags will be available for before expiring, in
milliseconds
|
SessionKey |
getCurrentKey(PublicKey target)
ElG only
|
SessionKey |
getCurrentOrNewKey(PublicKey target)
ElG only
|
RatchetSKM |
getECSKM() |
int |
getLowThreshold()
Get the low threshold for tag sending.
|
RatchetSKM |
getPQSKM() |
int |
getTagsToSend()
Get the number of tags to send.
|
(package private) boolean |
preferRatchet()
Should we try the Ratchet slow decrypt before PQ slow decrypt?
Adaptive test based on previous mix of traffic for this SKM,
as reported by reportDecryptResult().
|
void |
renderStatusHTML(Writer out) |
(package private) void |
reportDecryptResult(boolean isRatchet,
boolean success)
Report the result of a slow decrypt attempt.
|
boolean |
shouldSendTags(PublicKey target,
SessionKey key)
ElG only
|
boolean |
shouldSendTags(PublicKey target,
SessionKey key,
int lowThreshold)
ElG only
|
void |
shutdown()
Called when the system is closing down, instructing the session key manager to take
whatever precautions are necessary (saving state, etc)
|
void |
tagsAcked(PublicKey target,
SessionKey key,
TagSetHandle ts)
ElG only
|
TagSetHandle |
tagsDelivered(PublicKey target,
SessionKey key,
Set<SessionTag> sessionTags)
ElG only
|
void |
tagsReceived(SessionKey key,
RatchetSessionTag tag,
long expire)
EC only.
|
void |
tagsReceived(SessionKey key,
Set<SessionTag> sessionTags)
ElG only
|
void |
tagsReceived(SessionKey key,
Set<SessionTag> sessionTags,
long expire)
ElG only
|
failTagspublic MuxedPQSKM(RatchetSKM ec, RatchetSKM pq)
public RatchetEntry consumeNextAvailableTag(PublicKey target)
public SessionTag consumeNextAvailableTag(PublicKey target, SessionKey key)
consumeNextAvailableTag in class SessionKeyManagerpublic SessionKey consumeTag(SessionTag tag)
SessionKeyManagerconsumeTag in class SessionKeyManagerpublic SessionKey createSession(PublicKey target)
createSession in class SessionKeyManagerpublic void createSession(PublicKey target, SessionKey key)
createSession in class SessionKeyManagerpublic void failTags(PublicKey target, SessionKey key, TagSetHandle ts)
failTags in class SessionKeyManagerpublic int getAvailableTags(PublicKey target, SessionKey key)
SessionKeyManagergetAvailableTags in class SessionKeyManagerpublic long getAvailableTimeLeft(PublicKey target, SessionKey key)
SessionKeyManagergetAvailableTimeLeft in class SessionKeyManagerpublic SessionKey getCurrentKey(PublicKey target)
getCurrentKey in class SessionKeyManagerpublic SessionKey getCurrentOrNewKey(PublicKey target)
getCurrentOrNewKey in class SessionKeyManagerpublic RatchetSKM getECSKM()
public int getLowThreshold()
SessionKeyManagergetLowThreshold in class SessionKeyManagerpublic RatchetSKM getPQSKM()
public int getTagsToSend()
SessionKeyManagergetTagsToSend in class SessionKeyManagerboolean preferRatchet()
public void renderStatusHTML(Writer out) throws IOException
renderStatusHTML in class SessionKeyManagerIOExceptionvoid reportDecryptResult(boolean isRatchet,
boolean success)
isRatchet - true for EC, false for PQsuccess - true for successful decryptpublic boolean shouldSendTags(PublicKey target, SessionKey key)
shouldSendTags in class SessionKeyManagertarget - the target public keykey - the session keypublic boolean shouldSendTags(PublicKey target, SessionKey key, int lowThreshold)
shouldSendTags in class SessionKeyManagertarget - the target public keykey - the session keylowThreshold - the low thresholdpublic void shutdown()
SessionKeyManagershutdown in class SessionKeyManagerpublic void tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts)
tagsAcked in class SessionKeyManagerpublic TagSetHandle tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags)
tagsDelivered in class SessionKeyManagerpublic void tagsReceived(SessionKey key, RatchetSessionTag tag, long expire)
expire - time from nowpublic void tagsReceived(SessionKey key, Set<SessionTag> sessionTags)
tagsReceived in class SessionKeyManagerpublic void tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire)
tagsReceived in class SessionKeyManagersessionTags - modifiable; NOT copiedexpire - time from now