java.lang.Object
net.i2p.data.PrivateKeyFile
net.i2p.data.router.RouterPrivateKeyFile

public class RouterPrivateKeyFileextends PrivateKeyFile
Handles router private key files, extending PrivateKeyFile to provide RouterIdentity access instead of Destination. Maintains the same file format as the parent class while adding router-specific functionality.
  • Constructor Details

    • RouterPrivateKeyFile

      public RouterPrivateKeyFile(File file)
      Constructor with the router private key file path.
      Parameters:
      file - the router private key file to read the identity from
  • Method Details

    • getRouterIdentity

      public RouterIdentity getRouterIdentity() throws IOException, DataFormatException
      Read it in from the file. Also sets the local privKey and signingPrivKey.
      Returns:
      the router identity
      Throws:
      IOException - if the file cannot be opened or its bytes cannot be read
      DataFormatException - if the identity or either key declares an unknown type, or a key cannot be decoded