Package org.bitcoinj.crypto.utils
Class MessageVerifyUtils
java.lang.Object
org.bitcoinj.crypto.utils.MessageVerifyUtils
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
verifyMessage
(Address address, String message, String signatureBase64) Verifies messages signed with private keys of Bitcoin addresses.
-
Field Details
-
SIGNATURE_FAILED_ERROR_MESSAGE
- See Also:
-
-
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 signaturemessage
- message which has been signedsignatureBase64
- signature as base64 encoded string- Throws:
SignatureException
- if the signature does not match the message and the address
-