Package org.apache.ws.security.util
Class Base64
java.lang.Object
org.apache.ws.security.util.Base64
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Decodes Base64 data into octectsstatic String
encode
(byte[] binaryData) Encode a byte array and fold lines at the standard 76th character.static String
encode
(byte[] binaryData, int length, boolean wrap) Encode a byte array in Base64 format and return an optionally wrapped line.protected static boolean
isPad
(byte octect) protected static boolean
isWhiteSpace
(byte octect) static void
protected static int
removeWhiteSpace
(byte[] data) remove WhiteSpace from MIME containing encoded Base64 data.
-
Field Details
-
BASE64DEFAULTLENGTH
public static final int BASE64DEFAULTLENGTHField BASE64DEFAULTLENGTH- See Also:
-
-
Method Details
-
encode
Encode a byte array and fold lines at the standard 76th character.- Parameters:
binaryData
-byte[]
to be base64 encoded
- Returns:
- the
String
with encoded data
-
isWhiteSpace
protected static boolean isWhiteSpace(byte octect) -
isPad
protected static boolean isPad(byte octect) -
encode
Encode a byte array in Base64 format and return an optionally wrapped line.- Parameters:
binaryData
-byte[]
data to be encodedlength
-int
length of wrapped lines; No wrapping if less than 4.
- Returns:
- a
String
with encoded data
-
decode
Decodes Base64 data into octects- Parameters:
encoded
- String containing Base64 data- Returns:
- Array containing decoded data.
- Throws:
WSSecurityException
-
removeWhiteSpace
protected static int removeWhiteSpace(byte[] data) remove WhiteSpace from MIME containing encoded Base64 data.- Parameters:
data
- the byte array of base64 data (with WS)- Returns:
- the new length
-
main
- Parameters:
args
-
-