Class PlainPasswordFile

java.lang.Object
com.netscape.cmsutil.password.PlainPasswordFile
All Implemented Interfaces:
IPasswordStore

public class PlainPasswordFile extends Object implements IPasswordStore
  • Constructor Details

    • PlainPasswordFile

      public PlainPasswordFile()
  • Method Details

    • init

      public void init(String pwdPath) throws IOException
      Initialization method to read passwords(key and element pairs) from a file.

      Every property occupies one line of the input stream. Each line is terminated by a line terminator ( \n or \r or \r\n). Lines are processed until end of file is reached.

      A line that contains only whitespace or whose first non-whitespace character is an ASCII # is ignored (thus, # indicates comment line).

      Every line other than a blank line or a comment line describes one property to be added to the table. The characters before the delimiter = forms the key and the characters after the = is assigned as value to the key.

      As an example, each of the following lines specify the key "Truth" and the associated element value "Beauty":

       Truth = Beauty
       Truth= Beauty
       Truth                    =Beauty
       

      Note that the space appearing before/after = is ignored. However, the space appearing in between are stored.

      Example:

       Welcome Message  = Hello World
       
      assigns value Hello World to key Welcome Message

      If the line doesn't have the delimiter =, the method throws an IOException

      Specified by:
      init in interface IPasswordStore
      Parameters:
      pwdPath - the input file path.
      Throws:
      IOException - if an error occurred when reading from the input stream.
    • getPassword

      public String getPassword(String tag, int iteration)
      Specified by:
      getPassword in interface IPasswordStore
    • getTags

      public Enumeration<String> getTags()
      Specified by:
      getTags in interface IPasswordStore
    • putPassword

      public Object putPassword(String tag, String password)
      Specified by:
      putPassword in interface IPasswordStore
    • commit

      public void commit() throws IOException, ClassCastException, NullPointerException
      Specified by:
      commit in interface IPasswordStore
      Throws:
      IOException
      ClassCastException
      NullPointerException
    • getId

      public String getId()
    • setId

      public void setId(String id)
      Specified by:
      setId in interface IPasswordStore
    • getSize

      public int getSize()