|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.primefaces.util.StringEncrypter
public class StringEncrypter
----------------------------------------------------------------------------- The following example implements a class for encrypting and decrypting strings using several Cipher algorithms. The class is created with a key and can be used repeatedly to encrypt and decrypt strings using that key. Some of the more popular algorithms are: Blowfish DES DESede PBEWithMD5AndDES PBEWithMD5AndTripleDES TripleDES
Constructor Summary | |
---|---|
StringEncrypter(SecretKey key,
String algorithm)
Constructor used to create this object. |
|
StringEncrypter(String passPhrase)
Constructor used to create this object. |
Method Summary | |
---|---|
String |
decrypt(String str)
Takes a encrypted String as an argument, decrypts and returns the decrypted String. |
String |
encrypt(String str)
Takes a single String as an argument and returns an Encrypted version of that String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringEncrypter(SecretKey key, String algorithm)
key
- Secret Key used to initialize both the encrypter and decrypter instances.algorithm
- Which algorithm to use for creating the encrypter and decrypter instances.public StringEncrypter(String passPhrase)
passPhrase
- Pass Phrase used to initialize both the encrypter and decrypter instances.Method Detail |
---|
public String encrypt(String str)
str
- String to be encrypted
String
Encrypted version of the provided Stringpublic String decrypt(String str)
str
- Encrypted String to be decrypted
String
Decrypted version of the provided String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |