Package net.i2p.data

Class PrivateKey

All Implemented Interfaces:
Destroyable, DataStructure

public class PrivateKey
extends SimpleDataStructure
implements Destroyable
Defines the PrivateKey as defined by the I2P data structure spec. A private key is 256byte Integer. The private key represents only the exponent, not the primes, which are constant and defined in the crypto spec. As of release 0.9.38, keys of arbitrary length and type are supported. See EncType.
Author:
jrandom
  • Field Details

  • Constructor Details

    • PrivateKey

      public PrivateKey()
    • PrivateKey

      public PrivateKey​(EncType type)
      Parameters:
      type - non-null
      Since:
      0.9.38
    • PrivateKey

      public PrivateKey​(byte[] data)
    • PrivateKey

      public PrivateKey​(EncType type, byte[] data)
      Parameters:
      type - non-null
      data - must be non-null
      Since:
      0.9.38
    • PrivateKey

      public PrivateKey​(EncType type, byte[] data, PublicKey pubKey)
      Parameters:
      type - non-null
      data - must be non-null
      pubKey - corresponding pubKey to be cached
      Since:
      0.9.44
    • PrivateKey

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