java.lang.Object
net.i2p.router.news.BlocklistEntries

public class BlocklistEntriesextends Object
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 Type
    Field
    Description
    private static final String
    Section name for the router's own entries.
    final List<String>
    List of entries to block.
    static final int
    Maximum number of entries allowed in a blocklist.
    static final long
    Maximum future timestamp allowed for blocklist validation (2 days).
    final List<String>
    List of entries to unblock.
    Signature in type:base64 format.
    Signer certificate name.
    Updated timestamp as ISO 3339 date string.
    long
    Updated timestamp as milliseconds since epoch.
    private boolean
    Whether the blocklist signature has been verified.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlocklistEntries(int capacity)
    Creates a new BlocklistEntries with the specified capacity.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if the blocklist signature has been verified.
    static void
    main(String[] args)
    BlocklistEntries [-p keystorepw] input.txt keystore.ks you@mail.i2p File format: One entry per line, # starts a comment, ! starts an unblock entry.
    boolean
    Verify the blocklist signature.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • entries

      public final List<String> entries
      List of entries to block. Each entry is an IPv4/IPv6 address or base64 router hash.
    • removes

      public final List<String> removes
      List of entries to unblock.
    • signer

      public String signer
      Signer certificate name.
    • sig

      public String sig
      Signature in type:base64 format.
    • supdated

      public String supdated
      Updated timestamp as ISO 3339 date string.
    • updated

      public long updated
      Updated timestamp as milliseconds since epoch.
    • verified

      private boolean verified
      Whether the blocklist signature has been verified.
    • MAX_ENTRIES

      public static final int MAX_ENTRIES
      Maximum number of entries allowed in a blocklist.
      See Also:
    • CONTENT_ROUTER

      private static final String CONTENT_ROUTER
      Section name for the router's own entries.
      See Also:
    • MAX_FUTURE

      public static final long MAX_FUTURE
      Maximum 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

      public boolean verify(I2PAppContext ctx)
      Verify the blocklist signature.
      Parameters:
      ctx - the application context
      Returns:
      true if signature is valid, false otherwise
    • main

      public static void main(String[] args)
      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