ca.bc.gov.webade.developer.security
Class PasswordService

java.lang.Object
  extended byca.bc.gov.webade.developer.security.PasswordService

public final class PasswordService
extends java.lang.Object

Password encryption service.

Author:
Vivid Solutions Inc

Method Summary
 boolean compare(java.lang.String plaintext, java.lang.String encripted)
          Compare a plain text string to an encrypted version of that string.
 java.lang.String encrypt(java.lang.String plaintext)
          Encrypt a plain text string.
static PasswordService getInstance()
          Get the Singleton instance of the PasswordService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encrypt

public java.lang.String encrypt(java.lang.String plaintext)
                         throws WebADEDeveloperException
Encrypt a plain text string.

Parameters:
plaintext - The string to encrypt.
Returns:
The encrypted string.
Throws:
WebADEDeveloperException - Thrown if any falure occurs during encryption.

compare

public boolean compare(java.lang.String plaintext,
                       java.lang.String encripted)
                throws WebADEDeveloperException
Compare a plain text string to an encrypted version of that string.

Parameters:
plaintext - Plain text string
encripted - Encripted string
Returns:
True if and only if the plain text string is the source of the encrypted string.
Throws:
WebADEDeveloperException - Thrown if any falure occurs during encryption.

getInstance

public static PasswordService getInstance()
Get the Singleton instance of the PasswordService.

Returns:
the PasswordService Singleton