|
Project Wonder 5.0.0.8654 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecter.extensions.crypting.ERXCrypto
public class ERXCrypto
Provides a wrapper around common encryption and decryption operations. ERXCrypto provides built-in support for DES and Blowfish crypters. You can use the "er.extensions.ERXCrypto.crypters" property to override or provide your own. If you only want DES and/or Blowfish, you don't need to set crypters yourself.
| Field Summary | |
|---|---|
static String |
BLOWFISH
The constant for the Blowfish encryption algorithm. |
static String |
DES
The constant for the DES encryption algorithm. |
static Logger |
log
logging support |
| Constructor Summary | |
|---|---|
ERXCrypto()
|
|
| Method Summary | |
|---|---|
static byte[] |
base64Decode(String s)
Base64 decodes the passed in String |
static String |
base64Encode(byte[] byteArray)
Base64 encodes the passed in byte[] |
static String |
base64EncryptedString(String clearText)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static String |
base64EncryptedString(String clearText,
Key secretKey)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static String |
base64HashedString(String v)
Uses the SHA hash algorithm found in the Sun JCE to hash the passed in String. |
static String |
blowfishDecode(String encryptedText)
Deprecated. use ERXBlowfishCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.BLOWFISH) |
static String |
blowfishEncode(String clearText)
Deprecated. use ERXBlowfishCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.BLOWFISH) |
static String |
bytesToString(byte[] bytes)
Deprecated. use ERXStringUtilities.byteArrayToHexString
instead. |
static ERXCrypterInterface |
crypterForAlgorithm(String algorithm)
Returns the crypter for the given algorithm. |
static NSMutableDictionary<String,String> |
decodedFormValuesDictionary(NSDictionary<String,NSArray<String>> dict)
Decodes all of the values from a given dictionary using the default crypter. |
static String |
decryptedBase64String(String encryptedText)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static String |
decryptedBase64String(String encryptedText,
Key secretKey)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static ERXCrypterInterface |
defaultCrypter()
Returns the default crypter. |
static void |
main(String[] args)
Run this with ERXMainRunner passing in the plaintext you want to encrypt using the default crypter. |
static void |
setCrypterForAlgorithm(ERXCrypterInterface crypter,
String algorithm)
Sets the crypter for the given algorithm. |
static void |
setSecretKeyPath(String secretKeyPath)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static void |
setSecretKeyPathFramework(String secretKeyPathFramework)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static String |
shaEncode(String text)
Sha encodes a given string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger log
public static final String DES
public static final String BLOWFISH
| Constructor Detail |
|---|
public ERXCrypto()
| Method Detail |
|---|
public static ERXCrypterInterface defaultCrypter()
public static void setCrypterForAlgorithm(ERXCrypterInterface crypter,
String algorithm)
crypter - the crypter to usealgorithm - the algorithm namepublic static ERXCrypterInterface crypterForAlgorithm(String algorithm)
algorithm - the algorithm to lookup
IllegalArgumentException - if there is no crypter for the given algorithmpublic static NSMutableDictionary<String,String> decodedFormValuesDictionary(NSDictionary<String,NSArray<String>> dict)
dict - dictionary of key value pairs where the values are encoded
strings
public static String base64HashedString(String v)
public static String shaEncode(String text)
text - to be put through the sha digest
public static String base64Encode(byte[] byteArray)
public static byte[] base64Decode(String s)
throws IOException
IOException@Deprecated public static String bytesToString(byte[] bytes)
ERXStringUtilities.byteArrayToHexString
instead.
@Deprecated public static String base64EncryptedString(String clearText)
@Deprecated
public static String base64EncryptedString(String clearText,
Key secretKey)
@Deprecated public static String decryptedBase64String(String encryptedText)
@Deprecated
public static String decryptedBase64String(String encryptedText,
Key secretKey)
@Deprecated public static String blowfishEncode(String clearText)
@Deprecated public static String blowfishDecode(String encryptedText)
@Deprecated public static void setSecretKeyPathFramework(String secretKeyPathFramework)
@Deprecated public static void setSecretKeyPath(String secretKeyPath)
public static void main(String[] args)
args - the plaintext to encrypt
|
Last updated: Thu, Nov 20, 2008 04:36 AM EST | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||