public class Base64Url extends Object
The difference to normal base64 is that base64url replaces '+' by '-' and '/' by '_' in order to make the encoded string usable in URLs and file names without any escaping.
This class is an adjusted version of org.apache.commons.codec.binary.Base64
. Thanks to the Apache
Software Foundation!
Constructor and Description |
---|
Base64Url() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBase64(byte[] base64Data)
Decodes Base64 data into octects
|
static byte[] |
decodeBase64FromString(String base64String) |
static byte[] |
encodeBase64(byte[] binaryData)
Encodes binary data using the base64url algorithm.
|
static String |
encodeBase64ToString(byte[] binaryData) |
static boolean |
isArrayByteBase64(byte[] arrayOctect)
Tests a given byte array to see if it contains
only valid characters within the Base64 alphabet.
|
public Base64Url()
public static boolean isArrayByteBase64(byte[] arrayOctect)
arrayOctect
- byte array to testpublic static String encodeBase64ToString(byte[] binaryData)
public static byte[] encodeBase64(byte[] binaryData)
binaryData
- Array containing binary data to encode.public static byte[] decodeBase64FromString(String base64String)
public static byte[] decodeBase64(byte[] base64Data)
base64Data
- Byte array containing Base64 dataCopyright © 2013–2019. All rights reserved.