Package net.i2p.data

Class PublicKey

  • All Implemented Interfaces:
    Serializable, DataStructure

    public class PublicKey
    extends SimpleDataStructure
    Defines the PublicKey as defined by the I2P data structure spec. A public key is 256byte Integer. The public key represents only the exponent, not the primes, which are constant and defined in the crypto spec.
    Author:
    jrandom
    See Also:
    Serialized Form
    • Constructor Detail

      • PublicKey

        public PublicKey()
      • PublicKey

        public PublicKey​(byte[] data)
        Parameters:
        data - must be non-null
      • PublicKey

        public PublicKey​(String base64Data)
                  throws DataFormatException
        constructs from base64
        Parameters:
        base64Data - a string of base64 data (the output of .toBase64() called on a prior instance of PublicKey
        Throws:
        DataFormatException
    • Method Detail

      • create

        public static PublicKey create​(byte[] data,
                                       int off)
        Pull from cache or return new. Deprecated - used only by deprecated Destination.readBytes(data, off)
        Throws:
        ArrayIndexOutOfBoundsException - if not enough bytes, FIXME should throw DataFormatException
        Since:
        0.8.3
      • clearCache

        public static void clearCache()
        Since:
        0.9.17