Packages that use SessionKey
Package
Description
Interfaces and factories for the base I2P SDK used to develop applications that communicate through I2P.
Internal implementation of the I2P client SDK - the client side of the Invisible Internet Client Protocol (I2CP), separating implementation from the interfaces in
net.i2p.client. Core cryptographic primitives used throughout I2P: symmetric ciphers (AES, ChaCha20), hashes (SHA-1, SHA-256, SHA-384, SHA-512), HMAC and HKDF key derivation, the ElGamal and DSA/EdDSA/RedDSA engines, key and certificate utilities, and the entropy harvester.
X25519 elliptic curve Diffie-Hellman key exchange (RFC 7748), wrapping Noise's Curve25519 operations with Java Security API parameter specifications.
Common data structures used by the I2P protocols: Destination, LeaseSet, PublicKey, Signature, Certificate and their friends.
Low-level messages sent between routers - the Invisible Internet Network Protocol (I2NP).
The I2PTunnel configuration web interface (i2ptunnel.war): servlets and helpers for creating and editing tunnels.
The I2P router application handles I2P network communication.
Router-specific cryptography: ElGamal+AES garlic encryption (ElGamalAESEngine), session key and tag caching for repeated peer communication (TransientSessionKeyManager), router-family shared keys (FamilyKeyCrypto), and the ratchet and pqc subpackages.
The Double Ratchet with X25519 key agreement and ECIES hybrid encryption, used by the NTCP2 and SSU transports for session encryption.
Garlic message creation, parsing and handling, and the outbound message jobs: one-shot sends, source routing and delivery status handling.
The Kademlia distributed hash table (DHT) network database: lookup, store and explore jobs, the data store, the floodfill variants, and lookup throttling.
Peer profiles and capacity calculation, peer test jobs, peer selection for tunnel building, and the database and tunnel history used for peer selection.
NTCP2, the TCP transport: framed, ratchet-encrypted and mutually authenticated connections between routers.
SSU2, the UDP transport: datagram sessions with Holepunch peer discovery, plus the older SSU compatibility code.
Tunnel messages and the tunnel layer: the
TunnelManagerFacade, tunnel build request and reply processing, and the inbound and outbound tunnel structures. Tunnel pool management: pool lifecycle, peer selection, build scheduling and failure handling for client and exploratory tunnels.
General utility classes shared across the core libraries and the router.
Uses of SessionKey in net.i2p.client
Methods in net.i2p.client with parameters of type SessionKeyModifier and TypeMethodDescriptionbooleanI2PSession.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent) End-to-End Crypto is disabled, tags and keys are ignored.booleanI2PSession.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, int proto, int fromPort, int toPort) See I2PSessionMuxedImpl for proto/port details.booleanI2PSession.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire) End-to-End Crypto is disabled, tags and keys are ignored.booleanI2PSession.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire, int proto, int fromPort, int toPort) See I2PSessionMuxedImpl for proto/port details.booleanI2PSession.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire, int proto, int fromPort, int toPort, int flags) See I2PSessionMuxedImpl for proto/port details.booleanI2PSession.sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set<SessionTag> tagsSent) End-to-End Crypto is disabled, tags and keys are ignored!Uses of SessionKey in net.i2p.client.impl
Methods in net.i2p.client.impl with parameters of type SessionKeyModifier and TypeMethodDescriptionprotected booleanI2PSessionImpl2.sendBestEffort(Destination dest, byte[] payload, SessionKey keyUsed, Set<SessionTag> tagsSent, long expires) Send a message with best effort delivery.voidI2CPMessageProducer.sendMessage(I2PSessionImpl session, Destination dest, long nonce, byte[] payload, SessionTag tag, SessionKey key, Set<SessionTag> tags, SessionKey newKey, long expires) Package up and send the payload to the router for delivery.booleanI2PSessionImpl2.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent) Send a message with session key and tags.booleanI2PSessionImpl2.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, int proto, int fromport, int toport) Send an I2CP message.booleanI2PSessionImpl2.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expires) Unused? See the MuxedImpl override.booleanI2PSessionImpl2.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire, int proto, int fromport, int toport) Send an I2CP message.booleanI2PSessionImpl2.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expire, int proto, int fromport, int toport, int flags) Send an I2CP message.booleanI2PSessionImpl2.sendMessage(Destination dest, byte[] payload, SessionKey keyUsed, Set<SessionTag> tagsSent) Send a message with session key and tags.booleanI2PSessionMuxedImpl.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, int proto, int fromport, int toport) Send a message with session key and tags.booleanI2PSessionMuxedImpl.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expires) Send a message with session key and tags.booleanI2PSessionMuxedImpl.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expires, int proto, int fromPort, int toPort) Send a message with protocol and port information.booleanI2PSessionMuxedImpl.sendMessage(Destination dest, byte[] payload, int offset, int size, SessionKey keyUsed, Set<SessionTag> tagsSent, long expires, int proto, int fromPort, int toPort, int flags) Send a message with protocol, port, and flags.Uses of SessionKey in net.i2p.crypto
Fields in net.i2p.crypto with type parameters of type SessionKeyModifier and TypeFieldDescriptionprivate final ConcurrentMap<SessionKey, SecretKeySpec> CryptixAESEngine._keySpecReadsLock-free read side of theCryptixAESEngine._keySpecsmemo.private final Map<SessionKey, SecretKeySpec> CryptixAESEngine._keySpecsMemoizedSecretKeySpecperSessionKeyfor the system-AES path.Methods in net.i2p.crypto that return SessionKeyModifier and TypeMethodDescriptionSessionKeyManager.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(...)).SessionKeyManager.createSession(PublicKey target) Generate a new session key and associate it with the specified target.KeyGenerator.generateSessionKey()Generate a private 256 bit session key.KeyGenerator.generateSessionKey(byte[] salt, byte[] passphrase) PBE the passphrase with the salt.KeyGenerator.generateSessionKey(byte[] salt, byte[] passphrase, int rounds) PBE the passphrase with the salt using specified rounds.SessionKeyManager.getCurrentKey(PublicKey target) Retrieve the session key currently associated with encryption to the target, or null if a new session key should be generated.SessionKeyManager.getCurrentOrNewKey(PublicKey target) Retrieve the session key currently associated with encryption to the target.Methods in net.i2p.crypto with parameters of type SessionKeyModifier and TypeMethodDescriptionvoidHMAC256Generator.calculate(SessionKey key, byte[] data, int offset, int length, byte[] target, int targetOffset) Calculate the HMAC of the data with the given key.abstract voidHMACGenerator.calculate(SessionKey key, byte[] data, int offset, int length, byte[] target, int targetOffset) Calculate the HMAC of the data with the given key.SessionKeyManager.consumeNextAvailableTag(PublicKey target, SessionKey key) Retrieve the next available session tag for identifying the use of the given key when communicating with the target.voidSessionKeyManager.createSession(PublicKey target, SessionKey key) Associate a new session key with the specified target.voidAESEngine.decrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int length) Decrypt the data with the session key.voidAESEngine.decrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int ivOffset, int length) Decrypt the data with the session key.voidCryptixAESEngine.decrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int length) Decrypt the payload with the session key.voidCryptixAESEngine.decrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int ivOffset, int length) Decrypt the payload with the session key.voidAESEngine.decryptBlock(byte[] payload, int inIndex, SessionKey sessionKey, byte[] rv, int outIndex) This just copies payload to rv, see extension for the real thing.final voidCryptixAESEngine.decryptBlock(byte[] payload, int inIndex, SessionKey sessionKey, byte[] rv, int outIndex) Decrypt exactly 16 bytes of data with the session key provided.voidAESEngine.encrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int length) Encrypt the payload with the session key.voidAESEngine.encrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int ivOffset, int length) Encrypt payload with session key.voidCryptixAESEngine.encrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int length) Encrypt the payload with the session key.voidCryptixAESEngine.encrypt(byte[] payload, int payloadIndex, byte[] out, int outIndex, SessionKey sessionKey, byte[] iv, int ivOffset, int length) Encrypt the payload with the session key.voidAESEngine.encryptBlock(byte[] payload, int inIndex, SessionKey sessionKey, byte[] out, int outIndex) This just copies payload to out, see extension for the real thing.final voidCryptixAESEngine.encryptBlock(byte[] payload, int inIndex, SessionKey sessionKey, byte[] out, int outIndex) Encrypt exactly 16 bytes using the session key.voidSessionKeyManager.failTags(PublicKey target, SessionKey key, TagSetHandle ts) Fail tags for the given target, key, and tag set handle.intSessionKeyManager.getAvailableTags(PublicKey target, SessionKey key) Determine (approximately) how many available session tags for the current target have been confirmed and are available.longSessionKeyManager.getAvailableTimeLeft(PublicKey target, SessionKey key) Determine how long the available tags will be available for before expiring, in milliseconds.(package private) SecretKeySpecCryptixAESEngine.getKeySpec(SessionKey sessionKey) Get (or build and remember) theSecretKeySpecfor a session key.byte[]AESEngine.safeDecrypt(byte[] payload, SessionKey sessionKey, byte[] iv) SeeAESEngine.safeEncrypt(byte[], SessionKey, byte[], int)for description.byte[]AESEngine.safeEncrypt(byte[] payload, SessionKey sessionKey, byte[] iv, int paddedSize) Encrypt SHA-256 Hash of IV, 4 byte length, and payload, with random padding up to paddedSize, rounded up to next multiple of 16.booleanSessionKeyManager.shouldSendTags(PublicKey target, SessionKey key) Determine if tags should be sent to the target.booleanSessionKeyManager.shouldSendTags(PublicKey target, SessionKey key, int lowThreshold) Determine if tags should be sent to the target with the specified threshold.voidSessionKeyManager.tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts) Acknowledge tags for the given target, key, and tag set handle.SessionKeyManager.tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags) Take note of the fact that the given sessionTags associated with the key for encryption to the target have definitely been received at the target (aka call this method after receiving an ack to a message delivering them).voidSessionKeyManager.tagsReceived(SessionKey key, Set<SessionTag> sessionTags) Accept the given tags and associate them with the given key for decryption, with the default expiration.voidSessionKeyManager.tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire) Accept the given tags and associate them with the given key for decryption, with specified expiration.booleanHMAC256Generator.verify(SessionKey key, byte[] curData, int curOffset, int curLength, byte[] origMAC, int origMACOffset, int origMACLength) Verify the MAC inline, reducing some unnecessary memory churn.abstract booleanHMACGenerator.verify(SessionKey key, byte[] curData, int curOffset, int curLength, byte[] origMAC, int origMACOffset, int origMACLength) Verify the MAC inline, reducing some unnecessary memory churn.Uses of SessionKey in net.i2p.crypto.x25519
Methods in net.i2p.crypto.x25519 that return SessionKeyModifier and TypeMethodDescriptionstatic SessionKeyX25519DH.dh(PrivateKey priv, PublicKey pub) Curve25519 Diffie-Hellman: computes the shared secret for a private/public key pair.Uses of SessionKey in net.i2p.data
Fields in net.i2p.data declared as SessionKeyModifier and TypeFieldDescriptionstatic final SessionKeySessionKey.INVALID_KEYA key with all zeroes in the data.Methods in net.i2p.data with parameters of type SessionKeyModifier and TypeMethodDescriptionprivate voidLeaseSet.decrypt(SessionKey key) Decrypt the leases, except for the last one which is partially padding.private voidLeaseSet.encryp(SessionKey key) Encrypts the lease set in seven steps.voidEncryptedLeaseSet.encrypt(SessionKey skey) Throws IllegalStateException if not initialized.voidLeaseSet.encrypt(SessionKey key) Encrypt the gateway and tunnel ID of each lease, leaving the expire dates unchanged.voidLeaseSet2.encrypt(SessionKey key) Encrypt the gateway and tunnel ID of each lease, leaving the expire dates unchanged.Uses of SessionKey in net.i2p.data.i2np
Fields in net.i2p.data.i2np declared as SessionKeyModifier and TypeFieldDescriptionprivate SessionKeyBuildRequestRecord._chachaReplyKeyChaCha reply key for ECIES.private SessionKeyBuildRequestRecord._derivedIVKeyDerived IV key for short records.private SessionKeyBuildRequestRecord._derivedLayerKeyDerived layer key for short records.private SessionKeyDatabaseLookupMessage._replyKeyKey to encrypt the reply with.Methods in net.i2p.data.i2np that return SessionKeyModifier and TypeMethodDescriptionBuildRequestRecord.getChaChaReplyKey()Returns the ChaCha reply key.DeliveryInstructions.getEncryptionKey()For cloves only (not tunnels), default null Unused — always returns null, feature not implemented.DatabaseLookupMessage.getReplyKey()The included session key or null if unset.BuildRequestRecord.readIVKey()Reads the tunnel IV encryption key.BuildRequestRecord.readLayerKey()Reads the tunnel layer encryption key.BuildRequestRecord.readReplyKey()Reads the reply encryption key.Methods in net.i2p.data.i2np with parameters of type SessionKeyModifier and TypeMethodDescriptionstatic EncryptedBuildRecordBuildResponseRecord.create(I2PAppContext ctx, int status, SessionKey replyKey, byte[] replyIV, long responseMessageId) Creates a new AES-encrypted response record.static EncryptedBuildRecordBuildResponseRecord.create(I2PAppContext ctx, int status, SessionKey replyKey, byte[] replyAD, Properties options) Creates a new ChaCha/Poly-encrypted response record (long format).static ShortEncryptedBuildRecordBuildResponseRecord.createShort(I2PAppContext ctx, int status, SessionKey replyKey, byte[] replyAD, Properties options, int slot) Creates a new ChaCha/Poly-encrypted response record (short format).static booleanBuildResponseRecord.decrypt(EncryptedBuildRecord rec, SessionKey key, byte[] ad) Decrypts a standard ChaCha/Poly-encrypted record.static booleanBuildResponseRecord.decrypt(EncryptedBuildRecord rec, SessionKey key, byte[] ad, int nonce) Decrypts a short ChaCha/Poly-encrypted record.private static final booleanBuildResponseRecord.encryptAEADBlock(byte[] ad, byte[] data, SessionKey key) Encrypts a standard record using ChaCha/Poly.private static final booleanBuildResponseRecord.encryptAEADBlock(byte[] ad, byte[] data, SessionKey key, int nonce) Encrypts a short record using ChaCha/Poly.voidDatabaseLookupMessage.setReplySession(SessionKey encryptKey, SessionTag encryptTag) Only worthwhile if sending reply via tunnel.voidDatabaseLookupMessage.setReplySession(SessionKey encryptKey, RatchetSessionTag encryptTag) Sets the reply session for ratchet encryption; only once per message.Constructors in net.i2p.data.i2np with parameters of type SessionKeyModifierConstructorDescriptionBuildRequestRecord(I2PAppContext ctx, long receiveTunnelId, long nextTunnelId, Hash nextHop, long nextMsgId, SessionKey layerKey, SessionKey ivKey, SessionKey replyKey, byte[] iv, boolean isInGateway, boolean isOutEndpoint, Properties options) Creates a new ECIES long build request record.BuildRequestRecord(I2PAppContext ctx, long receiveTunnelId, Hash peer, long nextTunnelId, Hash nextHop, long nextMsgId, SessionKey layerKey, SessionKey ivKey, SessionKey replyKey, byte[] iv, boolean isInGateway, boolean isOutEndpoint) Creates a new ElGamal build request record.Uses of SessionKey in net.i2p.i2ptunnel.web
Fields in net.i2p.i2ptunnel.web with type parameters of type SessionKeyModifier and TypeFieldDescriptionprivate static final Map<Integer, SessionKey> IndexBean._formKeysForm keys, by session id.Uses of SessionKey in net.i2p.router
Fields in net.i2p.router declared as SessionKeyModifier and TypeFieldDescriptionprivate SessionKeyTunnelPoolSettings._randomKeyRandom key used for strict peer ordering.Methods in net.i2p.router that return SessionKeyModifier and TypeMethodDescriptionprivate static SessionKeyTunnelPoolSettings.generateRandomKey()Generates the random key for peer ordering.TunnelPoolSettings.getRandomKey()Random key used for peer ordering.PersistentKeyRing.put(Hash h, SessionKey sk) Store a session key, persisting it to the router config.Remove a session key, clearing it from the router config.Methods in net.i2p.router with parameters of type SessionKeyModifier and TypeMethodDescriptionPersistentKeyRing.put(Hash h, SessionKey sk) Store a session key, persisting it to the router config.Uses of SessionKey in net.i2p.router.crypto
Fields in net.i2p.router.crypto declared as SessionKeyModifier and TypeFieldDescriptionprivate SessionKeyTransientSessionKeyManager.OutboundSession._currentKeyKey for the most recently sent tag set.private final SessionKeyTransientSessionKeyManager.TagSet._keyKey the tags were encrypted with.Methods in net.i2p.router.crypto that return SessionKeyModifier and TypeMethodDescriptionTransientSessionKeyManager.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(...)).TransientSessionKeyManager.TagSet.getAssociatedKey()The session key the set belongs to.TransientSessionKeyManager.getCurrentKey(PublicKey target) Retrieve the session key currently associated with encryption to the target, or null if a new session key should be generated.TransientSessionKeyManager.OutboundSession.getCurrentKey()The session key in use now.TransientSessionKeyManager.getCurrentOrNewKey(PublicKey target) Retrieve the session key currently associated with encryption to the target.Methods in net.i2p.router.crypto that return types with arguments of type SessionKeyModifier and TypeMethodDescriptionprivate Map<SessionKey, Set<TransientSessionKeyManager.TagSet>> TransientSessionKeyManager.getInboundTagSetsBySessionKey()Return a map of session key to a set of inbound TagSets for that SessionKey.Methods in net.i2p.router.crypto with parameters of type SessionKeyModifier and TypeMethodDescriptionTransientSessionKeyManager.consumeNextAvailableTag(PublicKey target, SessionKey key) Retrieve the next available session tag for identifying the use of the given key when communicating with the target.TransientSessionKeyManager.createAndReturnSession(PublicKey target, SessionKey key) Same as above but for internal use, returns OutboundSession so we don't have to do a subsequentTransientSessionKeyManager.getSession(PublicKey).voidTransientSessionKeyManager.createSession(PublicKey target, SessionKey key) Associate a new session key with the specified target.(package private) byte[]ElGamalAESEngine.decryptAESBlock(byte[] encrypted, int offset, int encryptedLen, SessionKey key, byte[] iv, byte[] sentTag, Set<SessionTag> foundTags, SessionKey foundKey) Decrypt the AES data with the session key and IV.private byte[]ElGamalAESEngine.decryptExistingSession(byte[] data, SessionKey key, PrivateKey targetPrivateKey, Set<SessionTag> foundTags, SessionKey usedKey, SessionKey foundKey) Scenario 2: The data begins with 32 byte session tag, which also serves as the preIV.private byte[]ElGamalAESEngine.decryptNewSession(byte[] data, PrivateKey targetPrivateKey, Set<SessionTag> foundTags, SessionKey usedKey, SessionKey foundKey) Scenario 1: Begin with 222 bytes, ElG encrypted, containing:byte[]ElGamalAESEngine.encrypt(byte[] data, PublicKey target, SessionKey key, Set<SessionTag> tagsForDelivery, SessionTag currentTag, long paddedSize) Encrypt the data to the target using the given key and deliver the specified tags No new session key This is the one called from GarlicMessageBuilder and is the primary entry point.byte[]ElGamalAESEngine.encrypt(byte[] data, PublicKey target, SessionKey key, Set<SessionTag> tagsForDelivery, SessionTag currentTag, SessionKey newKey, long paddedSize) Encrypt the unencrypted data to the target.(package private) final byte[]ElGamalAESEngine.encryptAESBlock(byte[] data, SessionKey key, byte[] iv, Set<SessionTag> tagsForDelivery, SessionKey newKey, long paddedSize) For both scenarios, this method encrypts the AES area using the given key, iv and making sure the resulting data is at least as long as the paddedSize and also mod 16 bytes.private final byte[]ElGamalAESEngine.encryptAESBlock(byte[] data, SessionKey key, byte[] iv, Set<SessionTag> tagsForDelivery, SessionKey newKey, long paddedSize, int prefixBytes) Encrypt the AES area with the given key and IV, reserving the specified number of bytes at the beginning of the result for the session tag prefix.private byte[]ElGamalAESEngine.encryptExistingSession(byte[] data, SessionKey key, Set<SessionTag> tagsForDelivery, SessionTag currentTag, SessionKey newKey, long paddedSize) Scenario 2: Begin with 32 byte session tag, which also serves as the preIV.private byte[]ElGamalAESEngine.encryptNewSession(byte[] data, PublicKey target, SessionKey key, Set<SessionTag> tagsForDelivery, SessionKey newKey, long paddedSize) Scenario 1: Begin with 222 bytes, ElG encrypted, containing:voidTransientSessionKeyManager.failTags(PublicKey target, SessionKey key, TagSetHandle ts) Mark these tags as invalid, since the peer has failed to ack them in time.intTransientSessionKeyManager.getAvailableTags(PublicKey target, SessionKey key) Determine (approximately) how many available session tags for the current target have been confirmed and are available.longTransientSessionKeyManager.getAvailableTimeLeft(PublicKey target, SessionKey key) Determine how long the available tags will be available for before expiring, in milliseconds.TransientSessionKeyManager.getOrCreateSession(PublicKey target, SessionKey key) The session for a target with its current key brought up to date, or a new one built under key if there is none yet.voidTransientSessionKeyManager.OutboundSession.setCurrentKey(SessionKey key) Replaces the session key, dropping the old tags when it changes.booleanTransientSessionKeyManager.shouldSendTags(PublicKey target, SessionKey key, int lowThreshold) Whether to send a new tag set to the target.voidTransientSessionKeyManager.tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts) Mark these tags as acked, start to use them (if we haven't already) If the set was previously failed, it will be added back in.TransientSessionKeyManager.tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags) Take note of the fact that the given sessionTags associated with the key for encryption to the target have been sent.voidTransientSessionKeyManager.tagsReceived(SessionKey key, Set<SessionTag> sessionTags) Accept the given tags and associate them with the given key for decryption.voidTransientSessionKeyManager.tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire) Accept the given tags and associate them with the given key for decryption.Constructors in net.i2p.router.crypto with parameters of type SessionKeyModifierConstructorDescriptionOutboundSession(I2PAppContext ctx, Log log, PublicKey target, SessionKey key) Creates state for tracking one outbound ElGamal session to a single target.TagSet(Set<SessionTag> tags, SessionKey key, long date, int id) Creates a tag set with its key and expiry.Uses of SessionKey in net.i2p.router.crypto.ratchet
Subclasses of SessionKey in net.i2p.router.crypto.ratchetModifier and TypeClassDescription(package private) classSession key with nonce and optional handshake state for ratchet message encryption and decryption operations, supporting nonces up to 65535Fields in net.i2p.router.crypto.ratchet declared as SessionKeyModifier and TypeFieldDescriptionprivate SessionKeyRatchetSKM.OutboundSession._currentKeyKey used for the most recent messages.protected final SessionKeyRatchetTagSet._keyThe session key.private SessionKeyRatchetSKM.OutboundSession._nextIBRootKeyRoot key for the next inbound receive chain.final SessionKeySplitKeys.ckThe chain key.final SessionKeySplitKeys.k_abThe session key for direction {A to B}.final SessionKeySplitKeys.k_baThe session key for direction {B to A}.Methods in net.i2p.router.crypto.ratchet that return SessionKeyModifier and TypeMethodDescriptionMuxedPQSKM.consumeTag(SessionTag tag) Tries ECIES tag lookup first, falls back to PQ lookup.MuxedSKM.consumeTag(SessionTag tag) Tries ElGamal tag lookup first, falls back to ratchet lookup.RatchetSKM.consumeTag(SessionTag tag) Not supported for this key manager.MuxedPQSKM.createSession(PublicKey target) ElG only.MuxedSKM.createSession(PublicKey target) ElG only.RatchetTagSet.getAssociatedKey()The root key for the tag set.MuxedPQSKM.getCurrentKey(PublicKey target) ElG only.MuxedSKM.getCurrentKey(PublicKey target) ElG only.RatchetSKM.getCurrentKey(PublicKey target) Not supported for this key manager.RatchetSKM.OutboundSession.getCurrentKey()The session key stored at construction; never updated afterwards.MuxedPQSKM.getCurrentOrNewKey(PublicKey target) ElG only.MuxedSKM.getCurrentOrNewKey(PublicKey target) ElG only.RatchetSKM.getCurrentOrNewKey(PublicKey target) Not supported for this key manager.RatchetTagSet.getNextRootKey()Root key for the next DH ratchet.Methods in net.i2p.router.crypto.ratchet with parameters of type SessionKeyModifier and TypeMethodDescriptionMuxedPQSKM.consumeNextAvailableTag(PublicKey target, SessionKey key) ElG only.MuxedSKM.consumeNextAvailableTag(PublicKey target, SessionKey key) ElG only.RatchetSKM.consumeNextAvailableTag(PublicKey target, SessionKey key) Not supported for this key manager.voidMuxedPQSKM.createSession(PublicKey target, SessionKey key) ElG only.voidMuxedSKM.createSession(PublicKey target, SessionKey key) ElG only.voidRatchetSKM.createSession(PublicKey target, SessionKey key) Not supported for this key manager.private booleanECIESAEADEngine.decryptAEADBlock(byte[] ad, byte[] encrypted, int offset, int encryptedLen, SessionKey key, long n) With optional AD.byte[]ECIESAEADEngine.encrypt(CloveSet cloves, SessionKey key, RatchetSessionTag tag) Create an Existing Session Message to an anonymous target using the given session key and tag, for netdb DSM/DSRM replies.private final byte[]ECIESAEADEngine.encryptAEADBlock(byte[] ad, byte[] data, SessionKey key, long n) Encrypt the data with the given key and nonce.voidMuxedPQSKM.failTags(PublicKey target, SessionKey key, TagSetHandle ts) ElG only.voidMuxedSKM.failTags(PublicKey target, SessionKey key, TagSetHandle ts) ElG only.voidRatchetSKM.failTags(PublicKey target, SessionKey key, TagSetHandle ts) Not supported for this key manager.intMuxedPQSKM.getAvailableTags(PublicKey target, SessionKey key) Delegates to the appropriate key manager by encryption type.intMuxedSKM.getAvailableTags(PublicKey target, SessionKey key) Delegates to the appropriate key manager by encryption type.intRatchetSKM.getAvailableTags(PublicKey target, SessionKey key) Determine (approximately) how many available session tags for the current target have been confirmed and are available.longMuxedPQSKM.getAvailableTimeLeft(PublicKey target, SessionKey key) Delegates to the appropriate key manager by encryption type.longMuxedSKM.getAvailableTimeLeft(PublicKey target, SessionKey key) Delegates to the appropriate key manager by encryption type.longRatchetSKM.getAvailableTimeLeft(PublicKey target, SessionKey key) Determine how long the available tags will be available for before expiring, in milliseconds.booleanMuxedPQSKM.shouldSendTags(PublicKey target, SessionKey key) ElG only.booleanMuxedPQSKM.shouldSendTags(PublicKey target, SessionKey key, int lowThreshold) ElG only.booleanMuxedSKM.shouldSendTags(PublicKey target, SessionKey key) ElG only.booleanMuxedSKM.shouldSendTags(PublicKey target, SessionKey key, int lowThreshold) ElG only.booleanRatchetSKM.shouldSendTags(PublicKey target, SessionKey key, int lowThreshold) Whether to send more tags, always false here.voidMuxedPQSKM.tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts) ElG only.voidMuxedSKM.tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts) ElG only.voidRatchetSKM.tagsAcked(PublicKey target, SessionKey key, TagSetHandle ts) Not supported for this key manager.MuxedPQSKM.tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags) ElG only.MuxedSKM.tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags) ElG only.RatchetSKM.tagsDelivered(PublicKey target, SessionKey key, Set<SessionTag> sessionTags) Not supported for this key manager.voidMuxedPQSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags) ElG only.voidMuxedPQSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire) ElG only.voidMuxedPQSKM.tagsReceived(SessionKey key, RatchetSessionTag tag, long expire) EC only.voidMuxedSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags) ElG only.voidMuxedSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire) ElG only.voidMuxedSKM.tagsReceived(SessionKey key, RatchetSessionTag tag, long expire) EC only One time session.voidRatchetSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags) Not supported for this key manager.voidRatchetSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire) Not supported for this key manager.voidRatchetSKM.tagsReceived(SessionKey key, RatchetSessionTag tag, long expire) One time session.Constructors in net.i2p.router.crypto.ratchet with parameters of type SessionKeyModifierConstructorDescriptionOutboundSession(PublicKey target, Destination d, SessionKey key, HandshakeState state, ReplyCallback callback) Outbound session for the given target.RatchetTagSet(HKDF hkdf, HandshakeState state, SessionKey rootKey, SessionKey data, long date) Outbound NSR Tagset.RatchetTagSet(HKDF hkdf, SessionKey rootKey, SessionKey data, long date, int tagsetid, int keyid) Outbound ES Tagset.privateRatchetTagSet(HKDF hkdf, SessionTagListener lsnr, HandshakeState state, PublicKey remoteKey, SessionKey rootKey, SessionKey data, long date, long timeout, int tagsetid, int keyid, boolean isInbound, int minSize, int maxSize) Tag set for a ratchet session with the given keys and sizes.RatchetTagSet(HKDF hkdf, SessionTagListener lsnr, HandshakeState state, SessionKey rootKey, SessionKey data, long date, int minSize, int maxSize) Inbound NSR Tagset.RatchetTagSet(HKDF hkdf, SessionTagListener lsnr, PublicKey remoteKey, SessionKey rootKey, SessionKey data, long date, int tagsetid, int keyid, int minSize, int maxSize) Inbound ES Tagset.protectedRatchetTagSet(SessionTagListener lsnr, SessionKey rootKey, long date, long timeout) For SingleTagSet.SingleTagSet(SessionTagListener lsnr, SessionKey key, RatchetSessionTag tag, long date, long timeout) For outbound Existing Session.Uses of SessionKey in net.i2p.router.message
Fields in net.i2p.router.message declared as SessionKeyModifier and TypeFieldDescriptionprivate final SessionKeyOutboundClientMessageOneShotJob.SendSuccessJob._keyKey for decrypting the reply.private final SessionKeyOutboundClientMessageOneShotJob.SendTimeoutJob._keyKey for decrypting the reply.Methods in net.i2p.router.message with parameters of type SessionKeyModifier and TypeMethodDescriptionstatic GarlicMessageGarlicMessageBuilder.buildMessage(RouterContext ctx, GarlicConfig config, Set<SessionTag> wrappedTags, PublicKey target, SessionKey encryptKey, SessionTag encryptTag) ELGAMAL_2048 only.static GarlicMessageGarlicMessageBuilder.buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags, int numTagsToDeliver, int lowTagsThreshold, SessionKeyManager skm) ELGAMAL_2048 only.static GarlicMessageGarlicMessageBuilder.buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags, int numTagsToDeliver, SessionKeyManager skm) ELGAMAL_2048 only Called by OCMJH.static GarlicMessageGarlicMessageBuilder.buildMessage(RouterContext ctx, GarlicConfig config, SessionKey wrappedKey, Set<SessionTag> wrappedTags, SessionKeyManager skm) ELGAMAL_2048 only.static GarlicMessageGarlicMessageBuilder.buildMessage(RouterContext ctx, GarlicConfig config, SessionKey encryptKey, RatchetSessionTag encryptTag) Ratchet only.(package private) static GarlicMessageOutboundClientMessageJobHelper.createGarlicMessage(RouterContext ctx, long replyToken, long expiration, PublicKey recipientPK, PayloadGarlicConfig dataClove, Hash from, Destination dest, TunnelInfo replyTunnel, int tagsToSendOverride, int lowTagsOverride, SessionKey wrappedKey, Set<SessionTag> wrappedTags, boolean requireAck, LeaseSet bundledReplyLeaseSet, ReplyCallback callback) Build a garlic message that will be delivered to the router on which the target is located.Constructors in net.i2p.router.message with parameters of type SessionKeyModifierConstructorDescriptionSendSuccessJob(SessionKey key, TagSetHandle tags, LeaseSet ls, OutboundClientMessageOneShotJob.SendTimeoutJob timeout) Create a new success job that will be fired when the message encrypted with the given session key and bearing the specified tags are confirmed delivered.SendTimeoutJob(SessionKey key, TagSetHandle tags) Create a new timeout job that will be fired when the reply is not received.Uses of SessionKey in net.i2p.router.networkdb.kademlia
Fields in net.i2p.router.networkdb.kademlia declared as SessionKeyModifier and TypeFieldDescriptionfinal SessionKeyMessageWrapper.OneTimeSession.keyElG or ratchet.private SessionKeyMessageWrapper.WrappedMessage.sessionKeyThe session key used for wrapping.Methods in net.i2p.router.networkdb.kademlia with parameters of type SessionKeyModifier and TypeMethodDescriptionstatic GarlicMessageMessageWrapper.wrap(RouterContext ctx, I2NPMessage m, SessionKey encryptKey, SessionTag encryptTag) Garlic wrap a message from nobody, destined for an unknown router, to hide the contents from the IBGW.static GarlicMessageMessageWrapper.wrap(RouterContext ctx, I2NPMessage m, SessionKey encryptKey, RatchetSessionTag encryptTag) Garlic wrap a message from nobody, destined for an unknown router, to hide the contents from the IBGW.Constructors in net.i2p.router.networkdb.kademlia with parameters of type SessionKeyModifierConstructorDescriptionOneTimeSession(SessionKey key, SessionTag tag) Builds an ElGamal session, leaving the ratchet tag null.OneTimeSession(SessionKey key, RatchetSessionTag tag) Creates a new one-time session with a ratchet tag.(package private)WrappedMessage(GarlicMessage msg, SessionKeyManager skm, PublicKey sentTo, SessionKey sentKey, TagSetHandle tsh) Wrapped message.Uses of SessionKey in net.i2p.router.peermanager
Methods in net.i2p.router.peermanager with parameters of type SessionKeyModifier and TypeMethodDescriptionprivate voidProfileOrganizer.lockedSelectPeers(Map<Hash, PeerProfile> peers, int howMany, Set<Hash> toExclude, Set<Hash> matches, SessionKey randomKey, ProfileOrganizer.Slice subTierMode, int mask, MaskedIPSet ipSet, double buildSuccess, long rttCeiling) Collects up toProfileOrganizer.maxCandidateSample(int, int)candidates from a tier and hands them toProfileOrganizer.lockedPickLowestPriority(List, int, Set).voidProfileOrganizer.selectFastPeers(int howMany, Set<Hash> exclude, Set<Hash> matches, SessionKey randomKey, ProfileOrganizer.Slice subTierMode, int mask, MaskedIPSet ipSet) Select fast-tier peers deterministically sliced by a random key.Uses of SessionKey in net.i2p.router.transport.ntcp
Fields in net.i2p.router.transport.ntcp declared as SessionKeyModifier and TypeFieldDescriptionprivate final SessionKeyOutboundNTCP2State._bobHashHash of Bob's handshake.Uses of SessionKey in net.i2p.router.transport.udp
Fields in net.i2p.router.transport.udp declared as SessionKeyModifier and TypeFieldDescriptionprivate SessionKeyPeerTestState._aliceCipherKeyAlice's cipher key for the test.private SessionKeyPeerTestState._aliceIntroKeyAlice's introduction key.private SessionKeyPeerTestState._aliceMACKeyAlice's MAC key for the test.private SessionKeyPeerTestState._charlieIntroKeyCharlie's introduction key.private final SessionKeyOutboundEstablishState._introKeyIntroduction key.private SessionKeyUDPTransport._introKeyIntroduction key.Methods in net.i2p.router.transport.udp that return SessionKeyModifier and TypeMethodDescriptionPeerTestState.getAliceCipherKey()Return Alice's cipher key.PeerTestState.getAliceIntroKey()Return Alice's intro key.PeerTestState.getAliceMACKey()Return Alice's MAC key.PeerTestState.getCharlieIntroKey()Return Charlie's intro key.OutboundEstablishState.getIntroKey()Bob's introduction key, as published in the netdb.(package private) static SessionKeyPeerTestManager.getIntroKey(RouterAddress ra) Get an intro key out of an address.(package private) SessionKeyUDPTransport.getIntroKey()Introduction key that people should use to contact us, or null if SSU1 disabled.Methods in net.i2p.router.transport.udp with parameters of type SessionKeyModifier and TypeMethodDescriptionPacketBuilder2.buildHolePunch(InetAddress to, int port, SessionKey introKey, long sendID, long rcvID, byte[] signedData) Out-of-session, containing a RelayResponse block.PacketBuilder2.buildPeerTestFromAlice(InetAddress toIP, int toPort, SessionKey introKey, long sendID, long rcvID, byte[] signedData) Build a packet as Alice to Charlie.PacketBuilder2.buildPeerTestToAlice(InetAddress aliceIP, int alicePort, SessionKey introKey, boolean firstSend, long sendID, long rcvID, byte[] signedData) Build a packet as Charlie to Alice.voidPeerTestState.setAliceIntroKey(SessionKey key) Alice's intro key.voidPeerTestState.setAliceKeys(SessionKey ck, SessionKey mk) Alice's cipher and MAC keys.voidPeerTestState.setCharlieIntroKey(SessionKey key) Charlie's intro key.Constructors in net.i2p.router.transport.udp with parameters of type SessionKeyModifierConstructorDescriptionprotectedOutboundEstablishState(RouterContext ctx, RemoteHostId claimedAddress, RemoteHostId remoteHostId, RouterIdentity remotePeer, boolean needIntroduction, SessionKey introKey, UDPAddress addr) For SSU2.OutboundEstablishState2(RouterContext ctx, UDPTransport transport, RemoteHostId claimedAddress, RemoteHostId remoteHostId, RouterIdentity remotePeer, boolean needIntroduction, SessionKey introKey, RouterAddress ra, UDPAddress addr, int version) Prepare to start a new handshake with the given peer.Uses of SessionKey in net.i2p.router.tunnel
Fields in net.i2p.router.tunnel declared as SessionKeyModifier and TypeFieldDescriptionprivate final SessionKey[]TunnelCreatorConfig._AESReplyKeysAES reply keys, by hop.private SessionKey[]TunnelCreatorConfig._ChaReplyKeysChaCha20 reply keys, by hop.private SessionKeyHopConfig._ivKeyThe initialization vector key.private SessionKeyHopConfig._layerKeyThe layer key for the decryption.Methods in net.i2p.router.tunnel that return SessionKeyModifier and TypeMethodDescriptionTunnelCreatorConfig.getAESReplyKey(int hop) Key to encrypt the reply sent for the tunnel creation crypto.TunnelCreatorConfig.getChaChaReplyKey(int hop) The ECIES reply key for the given hop, or null.HopConfig.getIVKey()What key encrypts the preIV before passing it on?HopConfig.getLayerKey()What key encrypts the layer before passing it on?Methods in net.i2p.router.tunnel with parameters of type SessionKeyModifier and TypeMethodDescriptionvoidTunnelCreatorConfig.setAESReplyKeys(int hop, SessionKey key, byte[] iv) Key and IV to encrypt the reply sent for the tunnel creation crypto.voidTunnelCreatorConfig.setChaChaReplyKeys(int hop, SessionKey key, byte[] ad) The ECIES reply key and associated data for the given hop.voidHopConfig.setIVKey(SessionKey key) The key to encrypt the IV with before passing it on.voidHopConfig.setLayerKey(SessionKey key) The key to encrypt the layer with before passing it on.Uses of SessionKey in net.i2p.router.tunnel.pool
Methods in net.i2p.router.tunnel.pool with parameters of type SessionKeyModifier and TypeMethodDescriptionprotected voidTunnelPeerSelector.orderPeers(List<Hash> rv, SessionKey key) Order peers using the given key.private voidClientPeerSelector.refillFirstHop(ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches, boolean inStartup) Refill the first-hop candidate batch after a quality-loop ejection.private voidClientPeerSelector.selectFirstHop(int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches) Select the first hop, IBGW for inbound and the closest outbound peer otherwise, with a quality loop and pre-connect.private booleanClientPeerSelector.selectLastHop(TunnelPoolSettings settings, int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, Set<Hash> lastHopExclude, Set<Hash> rawExclude, ArraySet<Hash> matches) Select the last hop (hidden-inbound closest hop, hidden-outbound OBEP, or normal OBEP).private voidClientPeerSelector.selectMiddleHops(int length, ClientPeerSelector.SelectionParams params, SessionKey randomKey, ClientPeerSelector.SelectionExclusions ex, ArraySet<Hash> matches, List<Hash> rv) Select the middle hop(s) of a tunnel longer than 2 hops, subtiers 2-3, quality-ordered.Constructors in net.i2p.router.tunnel.pool with parameters of type SessionKeyModifierConstructorDescriptionprivateDerives the SipHash sort keys from a session key, holding no state of its own.Uses of SessionKey in net.i2p.util
Subclasses with type arguments of type SessionKey in net.i2p.utilModifier and TypeClassDescriptionclassThread-safe mapping from router hashes to session keys.