Class MessageVerifyUtils

java.lang.Object
org.bitcoinj.crypto.utils.MessageVerifyUtils

public class MessageVerifyUtils extends Object
Small utility class for verifying signatures of text messages created with Bitcoin addresses (more precisely: with the private key of Bitcoin addresses). Supports verifying of signatures created with:
  • P2PKH addresses (old legacy 1… addresses)
  • P2WPKH addresses (native segwit v0 addresses, aka bc1q… addresses)
  • P2SH-P2WPKH addresses (segwit wrapped into P2SH, aka legacy segwit addresses, like 3…)
  • Field Details

  • Method Details

    • verifyMessage

      public static void verifyMessage(Address address, String message, String signatureBase64) throws SignatureException
      Verifies messages signed with private keys of Bitcoin addresses.
      Parameters:
      address - bitcoin address used to create the signature
      message - message which has been signed
      signatureBase64 - signature as base64 encoded string
      Throws:
      SignatureException - if the signature does not match the message and the address