Код: Выделить всё
public String sign(String date, String from, String to, String subject, String message_id, String body) {
String bh = new String(hashString(body));
StringBuilder signed = new StringBuilder();
signed.append(date);
signed.append(from);
signed.append(to);
signed.append(subject);
signed.append(message_id);
String preHeader = key +"v=" + v + "; a=" + a + "; c=" + c + "; d=" + d + "; s=" + s + "; t=" + t + "; x=" + x + "; h=" + h + "; bh=" + bh + "; b=";
signed.append(preHeader);
String signature = Base64.getEncoder().encodeToString(digestSHA256RS(secretKey,signed.toString().getBytes()));
return preHeader + signature+"\r\n";
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... is-failing