Package net.i2p.data

Class Destination

  • All Implemented Interfaces:
    Serializable, DataStructure
    Direct Known Subclasses:
    VerifiedDestination

    public class Destination
    extends KeysAndCert
    Defines an end point in the I2P network. The Destination may move around in the network, but messages sent to the Destination will find it Note that the public (encryption) key is essentially unused, since "end-to-end" encryption was removed in 0.6. The public key in the LeaseSet is used instead. The first bytes of the public key are used for the IV for leaseset encryption, but that encryption is poorly designed and should be deprecated. As of 0.9.9 this data structure is immutable after the two keys and the certificate are set; attempts to change them will throw an IllegalStateException.
    Author:
    jrandom
    See Also:
    Serialized Form
    • Constructor Detail

      • Destination

        public Destination()
      • Destination

        public Destination​(String s)
                    throws DataFormatException
        alternative constructor which takes a base64 string representation
        Parameters:
        s - a Base64 representation of the destination, as (eg) is used in hosts.txt
        Throws:
        DataFormatException
    • Method Detail

      • writeBytes

        public int writeBytes​(byte[] target,
                              int offset)
        Deprecated, used only by Packet.java in streaming. Broken for sig types P521 and RSA before 0.9.15
        Returns:
        the written length (NOT the new offset)
      • size

        public int size()
      • toBase32

        public String toBase32()
        For convenience.
        Returns:
        "{52 chars}.b32.i2p" or null if fields not set.
        Since:
        0.9.14
      • clearCache

        public static void clearCache()
        Clear the cache.
        Since:
        0.9.9
      • hashCode

        public int hashCode()
        Description copied from class: KeysAndCert
        the signing key has enough randomness in it to use it by itself for speed
        Overrides:
        hashCode in class KeysAndCert