public final class EncodingUtils
extends java.lang.Object
EncodingUtils
that encapsulates common base64 calls and operations
in one spot.Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBase64(byte[] data)
Base64-decode the given string as byte[].
|
static byte[] |
decodeBase64(java.lang.String data)
Base64-decode the given string as byte[].
|
static java.lang.String |
encodeBase64(byte[] data)
Base64-encode the given byte[] as a string.
|
static byte[] |
encodeBase64ToByteArray(byte[] data)
Base64-encode the given byte[] as a byte[].
|
static java.lang.String |
hexEncode(byte[] data)
Hex encode the given byte[] as a string.
|
static byte[] |
signJws(java.security.Key key,
byte[] value)
Sign jws.
|
static java.lang.String |
urlDecode(java.lang.String value)
Url decode a value.
|
static java.lang.String |
urlEncode(java.lang.String value)
Url encode a value via UTF-8.
|
static java.lang.String |
urlEncode(java.lang.String value,
java.lang.String encoding)
Url encode a value.
|
static byte[] |
verifyJwsSignature(java.security.Key signingKey,
byte[] value)
Verify jws signature byte [ ].
|
public static java.lang.String hexEncode(byte[] data)
data
- the byte array to encodepublic static java.lang.String encodeBase64(byte[] data)
data
- the byte array to encodepublic static byte[] decodeBase64(java.lang.String data)
data
- the base64 stringpublic static byte[] decodeBase64(byte[] data)
data
- the base64 stringpublic static byte[] encodeBase64ToByteArray(byte[] data)
data
- the byte array to encodepublic static java.lang.String urlEncode(java.lang.String value)
value
- the value to encodepublic static java.lang.String urlEncode(java.lang.String value, java.lang.String encoding)
value
- the value to encodeencoding
- the encodingpublic static java.lang.String urlDecode(java.lang.String value)
value
- the value to decodepublic static byte[] verifyJwsSignature(java.security.Key signingKey, byte[] value)
value
- the valuesigningKey
- the signing keypublic static byte[] signJws(java.security.Key key, byte[] value)
key
- the keyvalue
- the value