net.larsan.urd.service.user
Class CRAM_MD5_Indirection

java.lang.Object
  |
  +--net.larsan.norna.service.user.Indirection
        |
        +--net.larsan.urd.service.user.CRAM_MD5_Indirection

public class CRAM_MD5_Indirection
extends Indirection

A CRAM MD5 (rfc 2195) indirection. This indirection taks one option, namely the 'TEXT' option which should be set to the non-secret text of the MD HMAC.

The input credentials given to this indirection should be in their HEX encoded form.

The ID of this indirection is "CRAM-MD5"

An example of use:

      CRAM_MD5_Inndirection ind = new CRAM_MD5_Indirection();
      Map map = new HashMap();
      map.put("TEXT", "Hi There");
      ind.setOptions(map);
      char[] pass = // .. convert hex key "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b"
      char[] input = "9294727a3638bb1c13f48ef8158bfc9d".toCharArray();
      ind.matches(pass, input);
 
This indirection only works on passwords and texts in ASCII.

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Field Summary
 
Fields inherited from class net.larsan.norna.service.user.Indirection
credentials, options
 
Constructor Summary
CRAM_MD5_Indirection()
           
 
Method Summary
 java.lang.String getID()
          Get indirection id.
 boolean matches(char[] pass)
          Check if a given credential input matches a password according to the current indirection.
 void setOptions(java.util.Map map)
          Set options for this indirection to use.
 
Methods inherited from class net.larsan.norna.service.user.Indirection
clearCredentials, setCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRAM_MD5_Indirection

public CRAM_MD5_Indirection()
Method Detail

setOptions

public void setOptions(java.util.Map map)
Description copied from class: Indirection
Set options for this indirection to use.

Overrides:
setOptions in class Indirection
Parameters:
map - Indirection options

matches

public boolean matches(char[] pass)
Description copied from class: Indirection
Check if a given credential input matches a password according to the current indirection.

Specified by:
matches in class Indirection
Parameters:
pass - Clear-text password
Returns:
true If the password indirectly matches the credentials

getID

public java.lang.String getID()
Description copied from class: Indirection
Get indirection id.

Specified by:
getID in class Indirection
Returns:
The Indirection id.