tigase.util
Class Algorithms

java.lang.Object
  extended by tigase.util.Algorithms

public class Algorithms
extends Object

Describe class Algorithms here. Created: Wed May 4 13:24:03 2005

Version:
$Rev: 644 $
Author:
Artur Hefczyc

Method Summary
static void $main(String[] args)
          Describe main method here.
static String bytesToHex(byte[] buff)
           
static byte[] digest(String id, String secret, String alg)
           
static String hexDigest(String id, String secret, String alg)
          This method encodes data using digest algorithm described in JEP-0078 documentation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hexDigest

public static final String hexDigest(String id,
                                     String secret,
                                     String alg)
                              throws NoSuchAlgorithmException
This method encodes data using digest algorithm described in JEP-0078 documentation. As a result you have String containing digest data which can be compared with data sent by the user to authenticate him.

Parameters:
id - a String value of some ID value like session ID to concatenate with secret word.
secret - a String value of a secret word shared between entites.
alg - a String value of algorithm name to use for generating diffest message.
Returns:
a String value digest message as defined.
Throws:
NoSuchAlgorithmException - if an error occurs during encoding digest message.

digest

public static final byte[] digest(String id,
                                  String secret,
                                  String alg)
                           throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

bytesToHex

public static final String bytesToHex(byte[] buff)

$main

public static void $main(String[] args)
                  throws Exception
Describe main method here.

Parameters:
args - a String[] value
Throws:
Exception


Copyright © 2012 Tigase. All Rights Reserved.