java.lang.Object
net.i2p.router.news.BlocklistEntries
Data structure and management for I2P router blocklist entries.
Represents a signed blocklist containing router identifiers to be blocked or unblocked, with support for cryptographic signature verification and timestamp validation.
Provides methods for loading, verifying, and managing blocklist entries with security checks to prevent expired or invalid blocklists. Includes command-line tool for creating signed blocklist files from input text.
All String fields may be null to accommodate optional metadata elements in blocklist feeds.
Field Summary
Modifier and TypeFieldDescriptionprivate static final StringSection name for the router's own entries.List of entries to block.static final intMaximum number of entries allowed in a blocklist.static final longMaximum future timestamp allowed for blocklist validation (2 days).List of entries to unblock.Signature in type:base64 format.Signer certificate name.Updated timestamp as ISO 3339 date string.longUpdated timestamp as milliseconds since epoch.private booleanWhether the blocklist signature has been verified.Constructor Summary
ConstructorsConstructorDescriptionBlocklistEntries(int capacity) Creates a new BlocklistEntries with the specified capacity.Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the blocklist signature has been verified.static voidBlocklistEntries [-p keystorepw] input.txt keystore.ks you@mail.i2p File format: One entry per line, # starts a comment, ! starts an unblock entry.booleanverify(I2PAppContext ctx) Verify the blocklist signature.
Field Details
entries
removes
signer
Signer certificate name.sig
Signature in type:base64 format.supdated
Updated timestamp as ISO 3339 date string.updated
public long updatedUpdated timestamp as milliseconds since epoch.verified
private boolean verifiedWhether the blocklist signature has been verified.MAX_ENTRIES
public static final int MAX_ENTRIESMaximum number of entries allowed in a blocklist.- See Also:
CONTENT_ROUTER
Section name for the router's own entries.- See Also:
MAX_FUTURE
public static final long MAX_FUTUREMaximum future timestamp allowed for blocklist validation (2 days).- See Also:
Constructor Details
BlocklistEntries
public BlocklistEntries(int capacity) Creates a new BlocklistEntries with the specified capacity.- Parameters:
capacity- the initial capacity for the entries list
Method Details
isVerified
public boolean isVerified()Check if the blocklist signature has been verified.- Returns:
- true if verified, false otherwise
verify
Verify the blocklist signature.- Parameters:
ctx- the application context- Returns:
- true if signature is valid, false otherwise
main
BlocklistEntries [-p keystorepw] input.txt keystore.ks you@mail.i2p File format: One entry per line, # starts a comment, ! starts an unblock entry. Single IPv4 or IPv6 address only (no mask allowed), or 44-char base 64 router hash. See MAX_ENTRIES above.- Parameters:
args- command line arguments