org.apache.james.security
Class DigestUtil

java.lang.Object
  |
  +--org.apache.james.security.DigestUtil

public class DigestUtil
extends java.lang.Object

Class to compute and verify digests of files and strings

Author:
Charles Benett Last changed by: $Author: charlesb $ on $Date: 2001/06/11 09:29:30 $ $Revision: 1.1 $

Constructor Summary
DigestUtil()
           
 
Method Summary
static void digestFile(java.lang.String filename, java.lang.String algorithm)
          Calculate digest of given file with given algorithm.
static java.lang.String digestString(java.lang.String pass, java.lang.String algorithm)
          Calculate digest of given String using given algorithm.
static void main(java.lang.String[] args)
          Command line interface.
static void printUsage()
          For CLI only
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DigestUtil

public DigestUtil()
Method Detail

main

public static void main(java.lang.String[] args)
Command line interface. Use -help for arguments

printUsage

public static void printUsage()
For CLI only

digestFile

public static void digestFile(java.lang.String filename,
                              java.lang.String algorithm)
Calculate digest of given file with given algorithm. Writes digest to file named filename.algorithm
Parameters:
filename - the String name of the file to be hashed
algorithm - the algorithm to be used

digestString

public static java.lang.String digestString(java.lang.String pass,
                                            java.lang.String algorithm)
                                     throws java.security.NoSuchAlgorithmException
Calculate digest of given String using given algorithm. Encode digest in MIME-like base64
Parameters:
pass - the String to be hashed
algorithm - the algorithm to be used


"Copyright © 2001 Apache Jakarta Project. All Rights Reserved."