|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.sec.Crypter
public class Crypter
The Crypter class provides crypt function and some useful random stuff.
Constructor Summary | |
---|---|
Crypter()
|
Method Summary | |
---|---|
static java.lang.String |
crypt(byte[] salt,
byte[] original)
crypt function. |
static java.lang.String |
crypt(byte[] salt,
java.lang.String original)
crypt function |
static java.lang.String |
crypt(java.lang.String salt,
java.lang.String original)
crypt function. |
static java.lang.String |
getRandomPassword()
Creates a random password with 8 characters. |
static java.lang.String |
getRandomPassword(int length)
Creates a random password with a certain number of characters. |
static java.lang.String |
getRandomSalt()
Creates a random salt String. |
static void |
initDes()
Initialze unit - may be invoked directly by user. |
static boolean |
selfTest(boolean show)
This method test crypt. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Crypter()
Method Detail |
---|
public static boolean selfTest(boolean show)
show
- if it is true, print test results to err stream
public static java.lang.String crypt(byte[] salt, byte[] original)
salt
- two byte array with salt.original
- array, maximum 8 bytes, string to encryptpublic static java.lang.String crypt(java.lang.String salt, java.lang.String original)
salt
- String, maximum length is 2 with salt.original
- String, maximum 8 bytes, string to encryptpublic static java.lang.String crypt(byte[] salt, java.lang.String original)
salt
- Two bytes array with saltoriginal
- String, maximum 8 characters, string to encryptpublic static void initDes()
public static java.lang.String getRandomPassword()
public static java.lang.String getRandomPassword(int length)
length
- Length of the password to generate.
public static java.lang.String getRandomSalt()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |