public class MuxedSKM extends SessionKeyManager
Constructor and Description |
---|
MuxedSKM(TransientSessionKeyManager elg,
RatchetSKM ec) |
Modifier and Type | Method and Description |
---|---|
RatchetEntry |
consumeNextAvailableTag(PublicKey target)
EC only
|
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() |
TransientSessionKeyManager |
getElgSKM() |
int |
getLowThreshold() |
int |
getTagsToSend()
How many to send, IF we need to.
|
(package private) boolean |
preferRatchet()
Should we try the Ratchet slow decrypt before ElG 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
One time session
|
void |
tagsReceived(SessionKey key,
Set<SessionTag> sessionTags)
ElG only
|
void |
tagsReceived(SessionKey key,
Set<SessionTag> sessionTags,
long expire)
ElG only
|
failTags
public MuxedSKM(TransientSessionKeyManager elg, RatchetSKM ec)
public TransientSessionKeyManager getElgSKM()
public RatchetSKM getECSKM()
boolean preferRatchet()
void reportDecryptResult(boolean isRatchet, boolean success)
isRatchet
- true for EC, false for ElGsuccess
- true for successful decryptpublic SessionKey getCurrentKey(PublicKey target)
getCurrentKey
in class SessionKeyManager
public SessionKey getCurrentOrNewKey(PublicKey target)
getCurrentOrNewKey
in class SessionKeyManager
public void createSession(PublicKey target, SessionKey key)
createSession
in class SessionKeyManager
public SessionKey createSession(PublicKey target)
createSession
in class SessionKeyManager
public SessionTag consumeNextAvailableTag(PublicKey target, SessionKey key)
consumeNextAvailableTag
in class SessionKeyManager
public RatchetEntry consumeNextAvailableTag(PublicKey target)
public int getTagsToSend()
SessionKeyManager
getTagsToSend
in class SessionKeyManager
public int getLowThreshold()
getLowThreshold
in class SessionKeyManager
public boolean shouldSendTags(PublicKey target, SessionKey key)
shouldSendTags
in class SessionKeyManager
public boolean shouldSendTags(PublicKey target, SessionKey key, int lowThreshold)
shouldSendTags
in class SessionKeyManager
public int getAvailableTags(PublicKey target, SessionKey key)
SessionKeyManager
getAvailableTags
in class SessionKeyManager
public long getAvailableTimeLeft(PublicKey target, SessionKey key)
SessionKeyManager
getAvailableTimeLeft
in class SessionKeyManager
public TagSetHandle tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags)
tagsDelivered
in class SessionKeyManager
public void tagsReceived(SessionKey key, Set<SessionTag> sessionTags)
tagsReceived
in class SessionKeyManager
public void tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire)
tagsReceived
in class SessionKeyManager
sessionTags
- modifiable; NOT copiedexpire
- time from nowpublic void tagsReceived(SessionKey key, RatchetSessionTag tag, long expire)
expire
- time from nowpublic SessionKey consumeTag(SessionTag tag)
SessionKeyManager
consumeTag
in class SessionKeyManager
public void shutdown()
SessionKeyManager
shutdown
in class SessionKeyManager
public void renderStatusHTML(Writer out) throws IOException
renderStatusHTML
in class SessionKeyManager
IOException
public void failTags(PublicKey target, SessionKey key, TagSetHandle ts)
failTags
in class SessionKeyManager
public void tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts)
tagsAcked
in class SessionKeyManager