For the latest news and information visit
The GNU Crypto project

gnu.crypto.sasl.srp
Class PasswordFile

java.lang.Object
  extended bygnu.crypto.sasl.srp.PasswordFile

public class PasswordFile
extends java.lang.Object

The implementation of SRP-6 password files.

For SRP, there are three (3) files:

  1. The password configuration file: tpasswd.conf. It contains the pairs indexed by a number for each pair used for a user. By default, this file's pathname is constructed from the base password file pathname by prepending it with the ".conf" suffix.
  2. The base password file: tpasswd. It contains the related password entries for all the users with values computed using SRP's default message digest algorithm: SHA-1 (with 160-bit output block size).
  3. The extended password file: tpasswd2. Its name is ALWAYS constructed by adding the suffix "2" to the fully qualified pathname of the base password file. It contains, in addition to the same fields as the base password file, albeit with a different verifier value, an extra field identifying the message digest algorithm used to compute this (verifier) value.

This implementation assumes the following message digest algorithm codes:

Reference:

  1. SRP Protocol Design
    Thomas J. Wu.

Version:
$Revision: 1.2 $

Constructor Summary
PasswordFile()
           
PasswordFile(java.io.File pwFile)
           
PasswordFile(java.lang.String pwName)
           
PasswordFile(java.lang.String pwName, java.lang.String confName)
           
PasswordFile(java.lang.String pwName, java.lang.String pw2Name, java.lang.String confName)
           
 
Method Summary
 void add(java.lang.String user, java.lang.String passwd, byte[] salt, java.lang.String index)
           
 void changePasswd(java.lang.String user, java.lang.String passwd)
           
 boolean contains(java.lang.String user)
           
 boolean containsConfig(java.lang.String index)
           
 java.lang.String[] lookup(java.lang.String user, java.lang.String mdName)
          Returns the triplet: verifier, salt and configuration file index, of a designated user, and a designated message digest algorithm name, as an array of strings.
 java.lang.String[] lookupConfig(java.lang.String index)
           
 void savePasswd()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordFile

public PasswordFile()
             throws java.io.IOException

PasswordFile

public PasswordFile(java.io.File pwFile)
             throws java.io.IOException

PasswordFile

public PasswordFile(java.lang.String pwName)
             throws java.io.IOException

PasswordFile

public PasswordFile(java.lang.String pwName,
                    java.lang.String confName)
             throws java.io.IOException

PasswordFile

public PasswordFile(java.lang.String pwName,
                    java.lang.String pw2Name,
                    java.lang.String confName)
             throws java.io.IOException
Method Detail

containsConfig

public boolean containsConfig(java.lang.String index)
                       throws java.io.IOException
Throws:
java.io.IOException

lookupConfig

public java.lang.String[] lookupConfig(java.lang.String index)
                                throws java.io.IOException
Throws:
java.io.IOException

contains

public boolean contains(java.lang.String user)
                 throws java.io.IOException
Throws:
java.io.IOException

add

public void add(java.lang.String user,
                java.lang.String passwd,
                byte[] salt,
                java.lang.String index)
         throws java.io.IOException
Throws:
java.io.IOException

changePasswd

public void changePasswd(java.lang.String user,
                         java.lang.String passwd)
                  throws java.io.IOException
Throws:
java.io.IOException

savePasswd

public void savePasswd()
                throws java.io.IOException
Throws:
java.io.IOException

lookup

public java.lang.String[] lookup(java.lang.String user,
                                 java.lang.String mdName)
                          throws java.io.IOException

Returns the triplet: verifier, salt and configuration file index, of a designated user, and a designated message digest algorithm name, as an array of strings.

Parameters:
user - the username.
mdName - the canonical name of the SRP's message digest algorithm.
Returns:
a string array containing, in this order, the BASE-64 encodings of the verifier, the salt and the index in the password configuration file of the MPIs N and g of the designated user.
Throws:
java.io.IOException

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.