package org.bitcoinj.core;

import com.google.common.base.Charsets;
import org.bitcoinj.crypto.KeyCrypterException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by HashEngineering on 2/8/2015.
 */
public class MessageSigner {
    private static final Logger log = LoggerFactory.getLogger(MessageSigner.class);

    public static ECKey getKeysFromSecret(String strSecret, StringBuilder errorMessage)
    {
        byte [] bytes;
        try {
            bytes = Base58.decode(strSecret);
        }
        catch (AddressFormatException x)
        {
            return null;
        }
        ECKey key = ECKey.fromPrivate(bytes);
        return key;
    }

    public static MasternodeSignature signMessage(String message, ECKey key) throws KeyCrypterException {
        byte dataToHash [] = (Utils.BITCOIN_SIGNED_MESSAGE_HEADER_BYTES+message).getBytes(Charsets.UTF_8);
        return HashSigner.signHash(Sha256Hash.twiceOf(dataToHash), key);
    }

    public static boolean verifyMessage(PublicKey pubkey, MasternodeSignature vchSig, String message,
                                        StringBuilder errorMessage) {
        return MessageSigner.verifyMessage(pubkey.getId(), vchSig, message, errorMessage);
    }

    public static boolean verifyMessage(byte [] pubkeyId, MasternodeSignature vchSig, String message,
                                        StringBuilder errorMessage) {
        byte [] dataToHash = Utils.formatMessageForSigning(message);
        return HashSigner.verifyHash(Sha256Hash.twiceOf(dataToHash), pubkeyId, vchSig, errorMessage);
    }
}

@@ -208,16 +208,17 @@
  on 
-2/
+4/1
 8/201
-5
+8
 .%0A *
@@ -383,19 +383,16 @@
 String s
-trS
 ecret, S
@@ -436,80 +436,103 @@
     
-byte %5B%5D bytes;%0A        try %7B%0A            bytes = Base58.decode(strSecret
+try %7B%0A            return DumpedPrivateKey.fromBase58(Context.get().getParams(), secret).getKey(
 );%0A 
@@ -607,39 +607,85 @@
     
-return null;%0A     
+errorMessage.append(%22Decoding secret failed: %22 + x.getMessage());%0A
    
-%7D%0A
         
 ECKe
@@ -684,65 +684,31 @@
     
-ECKey key = ECKey.fromPrivate(bytes);%0A        return key;
+ return null;%0A        %7D
 %0A   

Use DumpedPrivateKey to properly parse the secret string