public class MuxedSKM extends SessionKeyManager
| Constructor and Description |
|---|
MuxedSKM(TransientSessionKeyManager elg,
RatchetSKM ec)Combines ElGamal and ECIES SKMs with adaptive decrypt ordering. |
| Modifier and Type | Method and Description |
|---|---|
RatchetEntry | consumeNextAvailableTag(PublicKey target)EC only |
SessionTag | consumeNextAvailableTag(PublicKey target,
SessionKey key)ElG only |
SessionKey | consumeTag(SessionTag tag)Tries ElGamal tag lookup first, falls back to ratchet lookup. |
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)Delegates to the appropriate key manager by encryption type. |
long | getAvailableTimeLeft(PublicKey target,
SessionKey key)Delegates to the appropriate key manager by encryption type. |
SessionKey | getCurrentKey(PublicKey target)ElG only |
SessionKey | getCurrentOrNewKey(PublicKey target)ElG only |
RatchetSKM | getECSKM()Return the eCSKM |
TransientSessionKeyManager | getElgSKM()Return the elgSKM |
int | getLowThreshold()Get the low threshold for tag sending. |
int | getTagsToSend()Get the number of tags to send. |
(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)Renders debug status for both key managers. |
(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()Shuts down both ElGamal and ECIES key managers. |
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 |
failTagspublic MuxedSKM(TransientSessionKeyManager elg, RatchetSKM ec)
public RatchetEntry consumeNextAvailableTag(PublicKey target)
public SessionTag consumeNextAvailableTag(PublicKey target, SessionKey key)
consumeNextAvailableTag in class SessionKeyManagerpublic SessionKey consumeTag(SessionTag tag)
consumeTag 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 SessionKeyManagertarget - the targetkey - the session keyts - the tag set handlepublic int getAvailableTags(PublicKey target, SessionKey key)
getAvailableTags in class SessionKeyManagerpublic long getAvailableTimeLeft(PublicKey target, SessionKey key)
getAvailableTimeLeft in class SessionKeyManagerpublic SessionKey getCurrentKey(PublicKey target)
getCurrentKey in class SessionKeyManagerpublic SessionKey getCurrentOrNewKey(PublicKey target)
getCurrentOrNewKey in class SessionKeyManagerpublic RatchetSKM getECSKM()
public TransientSessionKeyManager getElgSKM()
public int getLowThreshold()
SessionKeyManagergetLowThreshold in class SessionKeyManagerpublic int getTagsToSend()
SessionKeyManagergetTagsToSend in class SessionKeyManagerboolean preferRatchet()
public void renderStatusHTML(Writer out) throws IOException
renderStatusHTML in class SessionKeyManagerout - the writer to render toIOException - if an I/O error occursvoid reportDecryptResult(boolean isRatchet,
boolean success)isRatchet - true for EC, false for ElGsuccess - true for successful decryptpublic boolean shouldSendTags(PublicKey target, SessionKey key)
shouldSendTags in class SessionKeyManagertarget - the targetkey - the session keypublic boolean shouldSendTags(PublicKey target, SessionKey key, int lowThreshold)
shouldSendTags in class SessionKeyManagertarget - the targetkey - the session keylowThreshold - the low thresholdpublic void shutdown()
shutdown in class SessionKeyManagerpublic void tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts)
tagsAcked in class SessionKeyManagertarget - the targetkey - the session keyts - the tag set handlepublic 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