aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp/src/main/java/com/juick/components/s2s/util
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-05 11:47:09 +0300
committerGravatar Vitaly Takmazov2016-12-05 22:34:50 +0300
commit4d9b066060bd78243616cb6f1fbdf0d06b09cbe7 (patch)
tree615f5b0dc5bccfc2ae8d5263b3e5cb86a3cb7bd7 /juick-xmpp/src/main/java/com/juick/components/s2s/util
parent7e972fd8b43a645c18605024a3b992dd14b9dd19 (diff)
juick-xmpp: dialback refactoring
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick/components/s2s/util')
-rw-r--r--juick-xmpp/src/main/java/com/juick/components/s2s/util/DialbackUtils.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/util/DialbackUtils.java b/juick-xmpp/src/main/java/com/juick/components/s2s/util/DialbackUtils.java
new file mode 100644
index 00000000..3bb786e5
--- /dev/null
+++ b/juick-xmpp/src/main/java/com/juick/components/s2s/util/DialbackUtils.java
@@ -0,0 +1,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());
+ }
+}