Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.configuration
Class Rot13PasswordEncoder

    java.lang.Object
      org.apache.cayenne.configuration.Rot13PasswordEncoder

All Implemented Interfaces:
  PasswordEncoding

    public class Rot13PasswordEncoder

extends Object
implements PasswordEncoding

The ROT-13 password encoder passes the text of the database password through a simple Caesar cipher to obscure the password text. The ROT-13 cipher only processes letters -- numbers and symbols are left untouched. ROT-13 is also a symmetrical cipher and therefore provides no real encryption since applying the cipher to the encrypted text produces the original source text. See the Wikipedia entry on ROT13 for more information on this topic.

Since:
  3.0

Field Summary

Fields inherited from interface org.apache.cayenne.configuration.PasswordEncoding
`standardEncoders`

Constructor Summary
`Rot13PasswordEncoder()`

Method Summary
`String` | `decodePassword(String encodedPassword, String key)` Decodes an encoded database password.
`String` | `encodePassword(String normalPassword, String key)` Encodes a normal/plain database password.
`static void` | `main(String[] args)` Small test program to run text through the ROT-13 cipher.
`String` | `rotate(String value)` Applies a ROT-13 Caesar cipher to the supplied value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Rot13PasswordEncoder

    public Rot13PasswordEncoder()

Method Detail

### decodePassword

    public String decodePassword(String encodedPassword,
                                 String key)

  Description copied from interface: `PasswordEncoding`
  Decodes an encoded database password.

  Specified by:
    `decodePassword` in 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 plassword.

### encodePassword

    public String encodePassword(String normalPassword,
                                 String key)

  Description copied from interface: `PasswordEncoding`
  Encodes a normal/plain database password.

  Specified by:
    `encodePassword` in 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.

### rotate

    public String rotate(String value)

  Applies a ROT-13 Caesar cipher to the supplied value. Each letter in the supplied value is substituted with a new value rotated by 13 places in the alphabet. See ROT13 for more information.

  A Unix command to perform a ROT-13 cipher is:

       tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]"

  Parameters:
    `value` - The text to be rotated.
  Returns:
    The rotated text.

### main

    public static void main(String[] args)

  Small test program to run text through the ROT-13 cipher. This program can also be run by hand to encode/decode values manually. The values passed on the command line are printed to standard out.

  Parameters:
    `args` - The array of text values (on the command-line) to be run through the ROT-13 cipher.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2010 Apache Cayenne. All Rights Reserved.