com.netscape.cms.authentication
Class Crypt

java.lang.Object
  extended by com.netscape.cms.authentication.Crypt

public class Crypt
extends java.lang.Object


Constructor Summary
Crypt()
          Create Crypt object with no passwd or salt set.
Crypt(java.lang.String salt)
          Create a Crypt object with specified salt.
Crypt(java.lang.String passwd, java.lang.String salt)
          Create a Crypt object with specified passwd and salt (often the already encypted passwd).
 
Method Summary
 java.lang.String getEncryptedPasswd()
          Retrieve the resulting encrypted string from the current passwd and salt settings.
 java.lang.String getPasswd()
          Retrieve the passwd string currently being encrypted.
 java.lang.String getSalt()
          Retrieve the salt string currently being used for encryption.
 void setPasswd(java.lang.String passwd)
          Set a new passwd string for encryption.
 void setSalt(java.lang.String salt)
          Set a new salt string for encryption.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Crypt

public Crypt()
Create Crypt object with no passwd or salt set. Must use setPasswd() and setSalt() before getEncryptedPasswd().


Crypt

public Crypt(java.lang.String salt)
Create a Crypt object with specified salt. Use setPasswd() before getEncryptedPasswd().

Parameters:
salt - the salt string for encryption

Crypt

public Crypt(java.lang.String passwd,
             java.lang.String salt)
Create a Crypt object with specified passwd and salt (often the already encypted passwd). Get the encrypted result with getEncryptedPasswd().

Parameters:
passwd - the passwd to encrypt
salt - the salt string for encryption
Method Detail

getPasswd

public java.lang.String getPasswd()
Retrieve the passwd string currently being encrypted.

Returns:
the current passwd string

getSalt

public java.lang.String getSalt()
Retrieve the salt string currently being used for encryption.

Returns:
the current salt string

getEncryptedPasswd

public java.lang.String getEncryptedPasswd()
Retrieve the resulting encrypted string from the current passwd and salt settings.

Returns:
the encrypted passwd

setPasswd

public void setPasswd(java.lang.String passwd)
Set a new passwd string for encryption. Use getEncryptedPasswd() to retrieve the new result.

Parameters:
passwd - the new passwd string

setSalt

public void setSalt(java.lang.String salt)
Set a new salt string for encryption. Use getEncryptedPasswd() to retrieve the new result.

Parameters:
salt - the new salt string