aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp/src/main/java/com/juick/components/s2s/util/DialbackUtils.java
blob: 3bb786e559d01601761b360e6c2151bbf1ddd553 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package com.juick.components.s2s.util;

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.codec.digest.HmacUtils;

/**
 * Created by vitalyster on 05.12.2016.
 */
public class DialbackUtils {
    public static String generateDialbackKey(String secret, String to, String from, String id) {
        return HmacUtils.hmacSha256Hex(DigestUtils.sha256(secret),
                (to + " " + from + " " + id).getBytes());
    }
}