/** * Given an arbitrary message and an Ethereum message signature encoded in bytes, * returns the public key that was used to sign it. This can then be compared to the * expected public key to determine if the signature was correct. * * @param message The message. * @param signatureData The message signature components * @return the public key used to sign the message * @throws SignatureException If the public key could not be recovered or if there was a * signature format error. */ public static BigInteger signedPrefixedMessageToKey( byte[] message, SignatureData signatureData) throws SignatureException { return signedMessageHashToKey(getEthereumMessageHash(message), signatureData); }
/** * Given an arbitrary piece of text and an Ethereum message signature encoded in bytes, * returns the public key that was used to sign it. This can then be compared to the expected * public key to determine if the signature was correct. * * @param message RLP encoded message. * @param signatureData The message signature components * @return the public key used to sign the message * @throws SignatureException If the public key could not be recovered or if there was a * signature format error. */ public static BigInteger signedMessageToKey( byte[] message, SignatureData signatureData) throws SignatureException { return signedMessageHashToKey(Hash.sha3(message), signatureData); }
/** * Given an arbitrary piece of text and an Ethereum message signature encoded in bytes, * returns the public key that was used to sign it. This can then be compared to the expected * public key to determine if the signature was correct. * * @param message RLP encoded message. * @param signatureData The message signature components * @return the public key used to sign the message * @throws SignatureException If the public key could not be recovered or if there was a * signature format error. */ public static BigInteger signedMessageToKey( byte[] message, SignatureData signatureData) throws SignatureException { return signedMessageHashToKey(Hash.sha3(message), signatureData); }
/** * Given an arbitrary message and an Ethereum message signature encoded in bytes, * returns the public key that was used to sign it. This can then be compared to the * expected public key to determine if the signature was correct. * * @param message The message. * @param signatureData The message signature components * @return the public key used to sign the message * @throws SignatureException If the public key could not be recovered or if there was a * signature format error. */ public static BigInteger signedPrefixedMessageToKey( byte[] message, SignatureData signatureData) throws SignatureException { return signedMessageHashToKey(getEthereumMessageHash(message), signatureData); }