Package org.apache.cayenne.configuration
Class Rot47PasswordEncoder
java.lang.Object
org.apache.cayenne.configuration.Rot47PasswordEncoder
- All Implemented Interfaces:
- PasswordEncoding
public class Rot47PasswordEncoder extends Object implements PasswordEncoding
The ROT-47 password encoder passes the text of the database password through a simple
 Caesar cipher to obscure the password text. The ROT-47 cipher is similar to the ROT-13
 cipher, but processes numbers and symbols as well. See the Wikipedia entry on ROT13 for more information on this
 topic.
- Since:
- 3.0
- 
Field SummaryFields inherited from interface org.apache.cayenne.configuration.PasswordEncodingstandardEncoders
- 
Constructor SummaryConstructors Constructor Description Rot47PasswordEncoder()
- 
Method SummaryModifier and Type Method Description StringdecodePassword(String encodedPassword, String key)Decodes an encoded database password.StringencodePassword(String normalPassword, String key)Encodes a normal/plain database password.Stringrotate(String value)Applies a ROT-47 Caesar cipher to the supplied value.
- 
Constructor Details- 
Rot47PasswordEncoderpublic Rot47PasswordEncoder()
 
- 
- 
Method Details- 
decodePasswordDescription copied from interface:PasswordEncodingDecodes an encoded database password.- Specified by:
- decodePasswordin interface- PasswordEncoding
- Parameters:
- encodedPassword- - The encoded password to be decoded
- key- - An optional data element which can be used to unlock the password. Some encoders may require the key.
- Returns:
- The decoded normal/plain password.
 
- 
encodePasswordDescription copied from interface:PasswordEncodingEncodes a normal/plain database password.- Specified by:
- encodePasswordin interface- PasswordEncoding
- Parameters:
- normalPassword- - The normal/plain password to be encoded
- key- - An optional data element which can be used to lock the password. Some encoders may require the key.
- Returns:
- The encoded password.
 
- 
rotateApplies a ROT-47 Caesar cipher to the supplied value. Each letter in the supplied value is substituted with a new value rotated by 47 places. See ROT13 for more information (there is a subsection for ROT-47).A Unix command to perform a ROT-47 cipher is: tr '!-~' 'P-~!-O' - Parameters:
- value- The text to be rotated.
- Returns:
- The rotated text.
 
 
-