Class Base64url


  • public final class Base64url
    extends Object
    Makes use of the very fast and memory efficient Base64 class to encode and decode to and from BASE64 in full accordance with RFC 2045. And then replaces + and / for - and _ respectively and removes the padding character = to be in accordance with RFC 4648.
    • Method Detail

      • decode

        public static byte[] decode​(String content)
        Decodes the given Base64url encoded String into a byte array.
        Parameters:
        content - The Base64url encoded String to decode.
        Returns:
        The decoded byte[] array.
      • decodeToString

        public static String decodeToString​(String content)
        Decodes the given Base64url encoded string into a String.
        Parameters:
        content - The Base64url encoded String to decode.
        Returns:
        The decoded String.
      • encode

        public static String encode​(byte[] content)
        Encodes the given byte array into a Base64url encoded String.
        Parameters:
        content - The byte array to encode.
        Returns:
        The Base64url encoded byte array.
      • encode

        public static String encode​(String content)
        Encodes the given UTF-8 encoded String into a Base64url encoded String.
        Parameters:
        content - The String to encode.
        Returns:
        The Base64url encoded String.