|
Project Wonder 5.0 | |||||||||||
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.
Properties | |
er.extensions.ERXCrypto.default | the name of the default crypter
algorithm (default = "Blowfish") |
er.extensions.ERXCrypto.crypters | comma-separated list of crypter
algorithms (i.e. "DES,Blowfish") |
er.extensions.ERXCrypto.crypter.[Algorithm] | crypter class name,
should be one for each algorithm in crypters list (i.e.
er.extensions.ERXCrypto.crypter.DES) |
Field Summary | |
---|---|
static java.lang.String |
AES
The constant for the AES encryption algorithm. |
static java.lang.String |
BLOWFISH
The constant for the Blowfish encryption algorithm. |
static java.lang.String |
DES
The constant for the DES encryption algorithm. |
static org.apache.log4j.Logger |
log
logging support |
Constructor Summary | |
---|---|
ERXCrypto()
|
Method Summary | |
---|---|
static byte[] |
base64Decode(java.lang.String s)
Base64 decodes the passed in String |
static java.lang.String |
base64Encode(byte[] byteArray)
Base64 encodes the passed in byte[] |
static java.lang.String |
base64EncryptedString(java.lang.String clearText)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static java.lang.String |
base64EncryptedString(java.lang.String clearText,
java.security.Key secretKey)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static java.lang.String |
base64HashedString(java.lang.String v)
Uses the SHA hash algorithm found in the Sun JCE to hash the passed in String. |
static byte[] |
base64urlDecode(java.lang.String s)
Base64url decodes the passed in String |
static java.lang.String |
base64urlEncode(byte[] byteArray)
Base64url encodes the passed in byte[] |
static java.lang.String |
blowfishDecode(java.lang.String encryptedText)
Deprecated. use ERXBlowfishCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.BLOWFISH) |
static java.lang.String |
blowfishEncode(java.lang.String clearText)
Deprecated. use ERXBlowfishCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.BLOWFISH) |
static java.lang.String |
bytesToString(byte[] bytes)
Deprecated. use ERXStringUtilities.byteArrayToHexString
instead. |
static ERXCrypterInterface |
crypterForAlgorithm(java.lang.String algorithm)
Returns the crypter for the given algorithm. |
static com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> |
decodedFormValuesDictionary(com.webobjects.foundation.NSDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> dict)
Decodes all of the values from a given dictionary using the default crypter. |
static java.lang.String |
decryptedBase64String(java.lang.String encryptedText)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static java.lang.String |
decryptedBase64String(java.lang.String encryptedText,
java.security.Key secretKey)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static ERXCrypterInterface |
defaultCrypter()
Returns the default crypter. |
static void |
main(java.lang.String[] args)
Run this with ERXMainRunner passing in the plaintext you want to encrypt using the default crypter. |
static void |
setCrypterForAlgorithm(ERXCrypterInterface crypter,
java.lang.String algorithm)
Sets the crypter for the given algorithm. |
static void |
setSecretKeyPath(java.lang.String secretKeyPath)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static void |
setSecretKeyPathFramework(java.lang.String secretKeyPathFramework)
Deprecated. use ERXDESCrypter and/or ERXCrypto.crypterForAlgorithm(ERXCrypto.DES) |
static java.lang.String |
shaEncode(java.lang.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 org.apache.log4j.Logger log
public static final java.lang.String DES
public static final java.lang.String BLOWFISH
public static final java.lang.String AES
Constructor Detail |
---|
public ERXCrypto()
Method Detail |
---|
public static ERXCrypterInterface defaultCrypter()
public static void setCrypterForAlgorithm(ERXCrypterInterface crypter, java.lang.String algorithm)
crypter
- the crypter to usealgorithm
- the algorithm namepublic static ERXCrypterInterface crypterForAlgorithm(java.lang.String algorithm)
algorithm
- the algorithm to lookup
java.lang.IllegalArgumentException
- if there is no crypter for the given algorithmpublic static com.webobjects.foundation.NSMutableDictionary<java.lang.String,java.lang.String> decodedFormValuesDictionary(com.webobjects.foundation.NSDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> dict)
dict
- dictionary of key value pairs where the values are encoded
strings
public static java.lang.String base64HashedString(java.lang.String v)
public static java.lang.String shaEncode(java.lang.String text)
text
- to be put through the sha digest
public static java.lang.String base64Encode(byte[] byteArray)
public static java.lang.String base64urlEncode(byte[] byteArray)
public static byte[] base64Decode(java.lang.String s) throws java.io.IOException
java.io.IOException
public static byte[] base64urlDecode(java.lang.String s) throws java.io.IOException
java.io.IOException
@Deprecated public static java.lang.String bytesToString(byte[] bytes)
ERXStringUtilities.byteArrayToHexString
instead.
@Deprecated public static java.lang.String base64EncryptedString(java.lang.String clearText)
@Deprecated public static java.lang.String base64EncryptedString(java.lang.String clearText, java.security.Key secretKey)
@Deprecated public static java.lang.String decryptedBase64String(java.lang.String encryptedText)
@Deprecated public static java.lang.String decryptedBase64String(java.lang.String encryptedText, java.security.Key secretKey)
@Deprecated public static java.lang.String blowfishEncode(java.lang.String clearText)
@Deprecated public static java.lang.String blowfishDecode(java.lang.String encryptedText)
@Deprecated public static void setSecretKeyPathFramework(java.lang.String secretKeyPathFramework)
@Deprecated public static void setSecretKeyPath(java.lang.String secretKeyPath)
public static void main(java.lang.String[] args)
args
- the plaintext to encrypt
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |