gov.lanl.Utility
Class IdentitySHA

java.lang.Object
  |
  +--gov.lanl.Utility.IdentitySHA

public class IdentitySHA
extends java.lang.Object

 

Constructor Summary
IdentitySHA()
          public constructor
 
Method Summary
 boolean checkDigest(java.lang.String digest, java.lang.String identity)
          Check Digest against identity
 boolean checkShortDigest(java.lang.String digest, byte[] salt, java.lang.String identity)
           
 java.lang.String createDigest(byte[] salt, java.lang.String identity)
          Create Digest for each input identity
 java.lang.String createHL7Digest(byte[] salt, java.lang.String identity, int length)
          Create short version of a digest by taking the first {length} bytes of the hash.
 java.lang.String createShortDigest(byte[] salt, java.lang.String identity, int length)
          Create short version of a digest by taking the first {length} bytes of the hash.
static void main(java.lang.String[] args)
          Main program for command line use and testing
 void setVerbose(boolean verbose)
          set the verbose flag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentitySHA

public IdentitySHA()
public constructor

Method Detail

createHL7Digest

public java.lang.String createHL7Digest(byte[] salt,
                                        java.lang.String identity,
                                        int length)
Create short version of a digest by taking the first {length} bytes of the hash.

Parameters:
salt - Base for the encryption
identity - Value to be encrypted
length - Length of extract to keep
Returns:
Digest string

createShortDigest

public java.lang.String createShortDigest(byte[] salt,
                                          java.lang.String identity,
                                          int length)
Create short version of a digest by taking the first {length} bytes of the hash.

Parameters:
salt - Base for the encryption
identity - Value to be encrypted
length - Length of extract to keep
Returns:
Digest string

createDigest

public java.lang.String createDigest(byte[] salt,
                                     java.lang.String identity)
Create Digest for each input identity

Parameters:
salt - to set the base for the encryption
identity - to be encrypted

checkShortDigest

public boolean checkShortDigest(java.lang.String digest,
                                byte[] salt,
                                java.lang.String identity)

checkDigest

public boolean checkDigest(java.lang.String digest,
                           java.lang.String identity)
Check Digest against identity

Parameters:
digest - is digest to be checked against
identity - to be checked

setVerbose

public void setVerbose(boolean verbose)
set the verbose flag


main

public static void main(java.lang.String[] args)
Main program for command line use and testing