org.apache.openejb.resource.jdbc
Interface PasswordCipher

All Known Implementing Classes:
PlainTextPasswordCipher, StaticDESPasswordCipher

public interface PasswordCipher

Implementations of PasswordCipher allow to encode and decode passwords used to connect to a database.

Several implementations may exist, as several encryption algorithms may be supported. One-way encryption algorithm (hash) can't be used as we need to give a plain password to the database. encrypt(String) method is not mandatory as we don't need to encode a password, but it's useful to get the encrypted value for a given plain text password. In the case you have implemented both methods, you can use the PasswordCodec command line tool to encode/decode a password.


Method Summary
 String decrypt(char[] encryptedPassword)
          Decodes an encoded password and returns a plain text password.
 char[] encrypt(String plainPassword)
          Encodes a given plain text password and returns the encoded password.
 

Method Detail

encrypt

char[] encrypt(String plainPassword)
Encodes a given plain text password and returns the encoded password.

Parameters:
plainPassword - The password to encode. May not be null, nor empty.
Returns:
The encoded password.

decrypt

String decrypt(char[] encryptedPassword)
Decodes an encoded password and returns a plain text password.

Parameters:
encryptedPassword - The ciphered password to decode. May not be null, nor empty.
Returns:
The plain text password.


Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.