de.innovationgate.utils
public class Base64 extends java.lang.Object implements PasswordOptionEncoder
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
base64Table
The translation table
|
static java.lang.String |
base64TableWeb
WebBase64Table view RFC3548 for details
|
static java.lang.String |
ENCODING_KEY |
Constructor and Description |
---|
Base64() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(java.lang.String buffer)
Decodes the given string buffer
This method version uses the "traditional" set of base64 characters that are not all URL-safe,
containing alphanumeric characters plus characters "/" and "+".
|
java.lang.String |
decodePassword(java.lang.String password)
Decodes a password with the implemented encoding scheme
|
static byte[] |
decodeWeb(java.lang.String buffer)
Decodes the given base64 string to bytes.
|
static java.lang.String |
encode(byte[] buffer)
Encodes bytes to a base64 String.
|
java.lang.String |
encodePassword(java.lang.String password)
Encode a password with the implemented encoding scheme
|
static java.lang.String |
encodeWeb(byte[] buffer)
encodes the given buffer and returns an URLEncoded Base64 String
This method version uses an "URL-safe" set of base64 characters.
|
java.lang.String |
getEncodingKey()
Returns the encoding key by which the used password encoding on stored options should be determined
|
public static final java.lang.String base64Table
public static final java.lang.String base64TableWeb
public static final java.lang.String ENCODING_KEY
public static byte[] decode(java.lang.String buffer) throws java.io.IOException
buffer
- the string to be decodedjava.io.IOException
- if the buffer
contains invalid datapublic static byte[] decodeWeb(java.lang.String buffer) throws java.io.IOException
buffer
- the string to be decodedjava.io.IOException
java.io.IOException
- if the buffer
contains invalid datapublic static java.lang.String encode(byte[] buffer)
buffer
- public static java.lang.String encodeWeb(byte[] buffer)
buffer
- java.io.UnsupportedEncodingException
public java.lang.String decodePassword(java.lang.String password) throws PasswordEncodingException
PasswordOptionEncoder
decodePassword
in interface PasswordOptionEncoder
PasswordEncodingException
public java.lang.String encodePassword(java.lang.String password) throws PasswordEncodingException
PasswordOptionEncoder
encodePassword
in interface PasswordOptionEncoder
PasswordEncodingException
public java.lang.String getEncodingKey()
PasswordOptionEncoder
getEncodingKey
in interface PasswordOptionEncoder