Class TorUtils

java.lang.Object
org.bitcoinj.core.internal.TorUtils

public class TorUtils extends Object
Utilities for encoding and decoding Onion addresses.
  • Constructor Details

    • TorUtils

      public TorUtils()
  • Method Details

    • encodeOnionUrlV2

      public static String encodeOnionUrlV2(byte[] onionAddrBytes)
      Encode an Onion URL from a Tor V2 address.

      See address-spec.txt

      Parameters:
      onionAddrBytes - Tor V2 address to encode
      Returns:
      encoded Onion URL
    • encodeOnionUrlV3

      public static String encodeOnionUrlV3(byte[] onionAddrBytes)
      Encode an Onion URL from a Tor V3 address (pubkey).

      See address-spec.txt

      Parameters:
      onionAddrBytes - Tor V3 address to encode
      Returns:
      encoded Onion URL
    • decodeOnionUrl

      public static byte[] decodeOnionUrl(String onionUrl)
      Decode an Onion URL into a Tor V2 or V3 address.

      See address-spec.txt

      Parameters:
      onionUrl - Onion URL to decode
      Returns:
      decoded Tor address