Packages that use SessionTag
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.
Low-level messages sent between routers - the Invisible Internet Network Protocol (I2NP).
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.
Tunnel pool management: pool lifecycle, peer selection, build scheduling and failure handling for client and exploratory tunnels.
Uses of SessionTag in net.i2p.client
Method parameters in net.i2p.client with type arguments of type SessionTagModifier 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 SessionTag in net.i2p.client.impl
Methods in net.i2p.client.impl with parameters of type SessionTagModifier and TypeMethodDescriptionvoidI2CPMessageProducer.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.Method parameters in net.i2p.client.impl with type arguments of type SessionTagModifier 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 SessionTag in net.i2p.crypto
Methods in net.i2p.crypto that return SessionTagModifier and TypeMethodDescriptionSessionKeyManager.consumeNextAvailableTag(PublicKey target, SessionKey key) Retrieve the next available session tag for identifying the use of the given key when communicating with the target.Methods in net.i2p.crypto with parameters of type SessionTagModifier 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(...)).Method parameters in net.i2p.crypto with type arguments of type SessionTagModifier and TypeMethodDescriptionSessionKeyManager.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.Uses of SessionTag in net.i2p.data.i2np
Fields in net.i2p.data.i2np declared as SessionTagModifier and TypeFieldDescriptionprivate SessionTagDatabaseLookupMessage._replyTagTag identifying the reply.Methods in net.i2p.data.i2np that return SessionTagModifier and TypeMethodDescriptionDatabaseLookupMessage.getReplyTag()The included session tag or null if unset.Methods in net.i2p.data.i2np with parameters of type SessionTagModifier and TypeMethodDescriptionvoidDatabaseLookupMessage.setReplySession(SessionKey encryptKey, SessionTag encryptTag) Only worthwhile if sending reply via tunnel.Uses of SessionTag in net.i2p.router.crypto
Fields in net.i2p.router.crypto with type parameters of type SessionTagModifier and TypeFieldDescriptionprivate final Map<SessionTag, TransientSessionKeyManager.TagSet> TransientSessionKeyManager._inboundTagSetsMap allowing us to go from a SessionTag to the containing TagSet.private final Set<SessionTag> TransientSessionKeyManager.TagSet._sessionTagsThe tags in this set.Methods in net.i2p.router.crypto that return SessionTagModifier and TypeMethodDescriptionTransientSessionKeyManager.OutboundSession.consumeNext()Consumes the next available tag and advances.TransientSessionKeyManager.TagSet.consumeNext()For outbound only.TransientSessionKeyManager.consumeNextAvailableTag(PublicKey target, SessionKey key) Retrieve the next available session tag for identifying the use of the given key when communicating with the target.Methods in net.i2p.router.crypto that return types with arguments of type SessionTagModifier and TypeMethodDescriptionTransientSessionKeyManager.TagSet.getTags()The tags still available.Methods in net.i2p.router.crypto with parameters of type SessionTagModifier and TypeMethodDescriptionvoidTransientSessionKeyManager.TagSet.consume(SessionTag tag) Marks the tag as used.TransientSessionKeyManager.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(...)).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.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.Method parameters in net.i2p.router.crypto with type arguments of type SessionTagModifier and TypeMethodDescription(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: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.Constructor parameters in net.i2p.router.crypto with type arguments of type SessionTagModifierConstructorDescriptionTagSet(Set<SessionTag> tags, SessionKey key, long date, int id) Creates a tag set with its key and expiry.Uses of SessionTag in net.i2p.router.crypto.ratchet
Methods in net.i2p.router.crypto.ratchet that return SessionTagModifier 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.Methods in net.i2p.router.crypto.ratchet with parameters of type SessionTagModifier 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.Method parameters in net.i2p.router.crypto.ratchet with type arguments of type SessionTagModifier and TypeMethodDescriptionMuxedPQSKM.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.voidMuxedSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags) ElG only.voidMuxedSKM.tagsReceived(SessionKey key, Set<SessionTag> sessionTags, long expire) ElG only.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.Uses of SessionTag in net.i2p.router.message
Methods in net.i2p.router.message with parameters of type SessionTagModifier and TypeMethodDescriptionstatic GarlicMessageGarlicMessageBuilder.buildMessage(RouterContext ctx, GarlicConfig config, Set<SessionTag> wrappedTags, PublicKey target, SessionKey encryptKey, SessionTag encryptTag) ELGAMAL_2048 only.Method parameters in net.i2p.router.message with type arguments of type SessionTagModifier 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.(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.Uses of SessionTag in net.i2p.router.networkdb.kademlia
Fields in net.i2p.router.networkdb.kademlia declared as SessionTagMethods in net.i2p.router.networkdb.kademlia with parameters of type SessionTagModifier 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.Constructors in net.i2p.router.networkdb.kademlia with parameters of type SessionTagModifierConstructorDescriptionOneTimeSession(SessionKey key, SessionTag tag) Builds an ElGamal session, leaving the ratchet tag null.Uses of SessionTag in net.i2p.router.tunnel.pool
Fields in net.i2p.router.tunnel.pool declared as SessionTagModifier and TypeFieldDescriptionprivate SessionTagTestJob._encryptTagSession tag for the ElGamal test message.