
Static Public Member Functions | |
| static byte[] | base64Decode (String s) throws IOException |
| static String | base64Encode (byte[] byteArray) |
| static String | base64EncryptedString (String clearText, Key secretKey) |
| static String | base64EncryptedString (String clearText) |
| static String | base64HashedString (String v) |
| static byte[] | base64urlDecode (String s) throws IOException |
| static String | base64urlEncode (byte[] byteArray) |
| static String | blowfishDecode (String encryptedText) |
| static String | blowfishEncode (String clearText) |
| static String | bytesToString (byte[] bytes) |
| static ERXCrypterInterface | crypterForAlgorithm (String algorithm) |
| static NSMutableDictionary < String, String > | decodedFormValuesDictionary (NSDictionary< String, NSArray< String >> dict) |
| static String | decryptedBase64String (String encryptedText, Key secretKey) |
| static String | decryptedBase64String (String encryptedText) |
| static ERXCrypterInterface | defaultCrypter () |
| static void | main (String[] args) |
| static void | setCrypterForAlgorithm (ERXCrypterInterface crypter, String algorithm) |
| static void | setSecretKeyPath (String secretKeyPath) |
| static void | setSecretKeyPathFramework (String secretKeyPathFramework) |
| static String | shaEncode (String text) |
Static Public Attributes | |
| static final String | AES = "AES" |
| static final String | BLOWFISH = "Blowfish" |
| static final String | DES = "DES" |
| static final Logger | log = Logger.getLogger(ERXCrypto.class) |
Static Private Member Functions | |
| static synchronized NSMutableDictionary< String, ERXCrypterInterface > | crypters () |
Static Private Attributes | |
| static NSMutableDictionary < String, ERXCrypterInterface > | _crypters |
| static byte [] base64Decode | ( | String | s | ) | throws IOException [static] |
Base64 decodes the passed in String
| static String base64Encode | ( | byte[] | byteArray | ) | [static] |
Base64 encodes the passed in byte[]
Uses the SHA hash algorithm found in the Sun JCE to hash the passed in String. This String is then base64 encoded and returned.
| static byte [] base64urlDecode | ( | String | s | ) | throws IOException [static] |
Base64url decodes the passed in String
| static String base64urlEncode | ( | byte[] | byteArray | ) | [static] |
Base64url encodes the passed in byte[]
| static String bytesToString | ( | byte[] | bytes | ) | [static] |
ERXStringUtilities.byteArrayToHexString instead. | static ERXCrypterInterface crypterForAlgorithm | ( | String | algorithm | ) | [static] |
Returns the crypter for the given algorithm. By default, DES and Blowfish are available ("DES", "Blowfish", etc).
| algorithm | the algorithm to lookup |
| IllegalArgumentException | if there is no crypter for the given algorithm |
| static synchronized NSMutableDictionary<String, ERXCrypterInterface> crypters | ( | ) | [static, private] |
| static NSMutableDictionary<String, String> decodedFormValuesDictionary | ( | NSDictionary< String, NSArray< String >> | dict | ) | [static] |
Decodes all of the values from a given dictionary using the default crypter.
| dict | dictionary of key value pairs where the values are encoded strings |
| static ERXCrypterInterface defaultCrypter | ( | ) | [static] |
Returns the default crypter. By default this is Blowfish, but you can override the choice by setting er.extensions.ERXCrypto.default.
| static void main | ( | String[] | args | ) | [static] |
Run this with ERXMainRunner passing in the plaintext you want to encrypt using the default crypter. This is useful if you are using encrypted properties and you need a quick way to know what to set the property value to.
| args | the plaintext to encrypt |
| static void setCrypterForAlgorithm | ( | ERXCrypterInterface | crypter, | |
| String | algorithm | |||
| ) | [static] |
Sets the crypter for the given algorithm.
| crypter | the crypter to use | |
| algorithm | the algorithm name |
| static void setSecretKeyPath | ( | String | secretKeyPath | ) | [static] |
| static void setSecretKeyPathFramework | ( | String | secretKeyPathFramework | ) | [static] |
Sha encodes a given string. The resulting string is safe to use in urls and cookies. From the digest of the string it is nearly impossible to determine what the original string was. Running the same string through the Sha digest multiple times will always produce the same hash.
| text | to be put through the sha digest |
NSMutableDictionary<String, ERXCrypterInterface> _crypters [static, private] |
1.5.8