DSASignature signedNonce =
signer.sign(Util.joinBytes(MessageLibrary.toBytes(serverName), nonce.nt(), nonce.nr(),
toBytes(command), Util.joinBytes(payload)));
byte[] sig = Util.joinBytes(signedNonce.getR(), signedNonce.getS());
AuthenticateRequest req =
AuthenticateRequest.newBuilder()
.setPublicKey(ByteString.copyFrom(signer.getPublicHash())).setSig(
ByteString.copyFrom(sig)).setNonce(ByteString.copyFrom(nonce.toToken()))
.setServerName(serverName).build();