class PassportTransactionFormatter {

    public byte[] signRawTransaction(PublicKey pubkey, byte[][] parts, PassportConnection pcon) throws Exception {
        byte[] rawTransaction = Bytes.concat(parts[0], parts[1], parts[2], parts[3], parts[4], parts[5],
                parts[6], parts[7], parts[8], parts[9], parts[10], parts[11], parts[12]);

        // Double hash transaction
        byte[] step14 = Sha256Hash.hash(Sha256Hash.hash(rawTransaction));

        // Generate signature and get publickey
        byte[] multiSignature = new byte[320];
        byte[] hashPart;

        for (int i = 0; i < 4; i++) {
            hashPart = Arrays.copyOfRange(step14, i * 8, i * 8 + 8);
            System.arraycopy(pcon.signData(hashPart), 0, multiSignature, i * 80, 80);
        }

        byte[] signatureLength = Util.hexStringToByteArray("fd97014d4101");
        byte[] hashCodeType = Util.hexStringToByteArray("01");
        byte[] publicKeyASN = pubkey.getEncoded();

        byte[] publicKey = new byte[81];
        System.arraycopy(publicKeyASN, publicKeyASN.length-81, publicKey, 0, 81);

        byte[] publickeyLength = Util.hexStringToByteArray("4c51");

        // Set signature and pubkey in format
        byte[] step16 = Bytes.concat(signatureLength, multiSignature, hashCodeType, publickeyLength, publicKey);

        // Update transaction with signature and remove hash code type
        byte[] step19 = Bytes.concat(parts[0], parts[1], parts[2], parts[3], step16, parts[6],
                parts[7], parts[8], parts[9], parts[10], parts[11], parts[12]);

        return step19;
    }

    public  PassportTransactionFormatter(TransactionOutput utxo, Address destination);

}