UnboundID LDAP SDK for Java

Ping Identity

Product Information
Getting Started with the LDAP SDK

Base64 Processing

Base64 is a mechanism of encoding data in a form that can always be represented as plain text. It does this by converting three 8-bit values into four 6-bit values and representing that 6-bit data using a set of 64 characters (uppercase letters, lowercase letters, numeric digits, the plus sign and the forward slash). It is a safe and relatively compact way to represent binary data in a text form. It is used in LDIF processing if the data contains special characters that may not otherwise be safe to represent in LDIF form.

The com.unboundid.util.Base64 class provides a mechanism that can be used to encode data to and from base64. The decode(String data) method can be used to decode a string containing base64-encoded data to a byte array. The encode(byte[] data) and encode(byte[] data, StringBuilder buffer) methods can be used to base64-encode data from a byte array to a string representation.