public class Base64Encoder
extends java.lang.Object
Constructor and Description |
---|
Base64Encoder(java.lang.String name,
int key) |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] input) |
byte[] |
decrypt(byte[] input)
returns decrypted Base64 decoded bytes
|
static java.lang.String |
decrypt(java.lang.String key,
java.lang.String encrypted)
returns base64 decoded value of an encrypted string with the given prefix
|
static byte[] |
encode(byte[] input) |
byte[] |
encrypt(byte[] input)
returns encrypted Base64 encoded bytes
|
static java.lang.String |
encrypt(java.lang.String key,
java.lang.String value)
returns encrypted Base64 encoded string with a given prefix of the key
|
java.lang.String |
getName() |
static java.lang.String |
scramble(java.lang.String header,
java.lang.String encoded)
verifies the given header on a base64 encoded string and scrambles
it with a random shuffling.
|
static java.lang.String |
unscramble(java.lang.String header,
java.lang.String scrambled)
unscrambles a scrambled string and verifies the given header on the
end result.
|
public byte[] encrypt(byte[] input)
public byte[] decrypt(byte[] input)
public static byte[] encode(byte[] input)
public static byte[] decode(byte[] input)
public static java.lang.String encrypt(java.lang.String key, java.lang.String value) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String decrypt(java.lang.String key, java.lang.String encrypted) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String scramble(java.lang.String header, java.lang.String encoded) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public static java.lang.String unscramble(java.lang.String header, java.lang.String scrambled) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public java.lang.String getName()