org.apache.cxf.rs.security.oauth2.saml
Class Base64UrlUtility

java.lang.Object
  extended by org.apache.cxf.rs.security.oauth2.saml.Base64UrlUtility

public final class Base64UrlUtility
extends Object


Method Summary
static void decode(char[] id, int o, int l, OutputStream ostream)
           
static byte[] decode(String id)
           
static void decode(String id, OutputStream ostream)
           
static byte[] decodeChunk(char[] id, int o, int l)
          The decode_chunk routine decodes a chunk of data into its native encoding.
static String encode(byte[] id)
           
static void encode(byte[] id, int o, int l, Writer writer)
           
static String encode(String value)
           
static void encode(String value, Writer writer)
           
static char[] encodeChunk(byte[] id, int o, int l)
           
static void encodeChunk(byte[] id, int o, int l, OutputStream ostream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

decodeChunk

public static byte[] decodeChunk(char[] id,
                                 int o,
                                 int l)
                          throws org.apache.cxf.common.util.Base64Exception
The decode_chunk routine decodes a chunk of data into its native encoding. base64 encodes each 3 octets of data into 4 characters from a limited 64 character set. The 3 octets are joined to form 24 bits which are then split into 4 x 6bit values. Each 6 bit value is then used as an index into the 64 character table of base64 chars. If the total data length is not a 3 octet multiple the '=' char is used as padding for the final 4 char group, either 1 octet + '==' or 2 octets + '='.

Parameters:
id - The input data to be processed
o - The offset from which to begin processing
l - The length (bound) at which processing is to end
Returns:
The decoded data
Throws:
org.apache.cxf.common.util.Base64Exception - Thrown is processing fails due to formatting exceptions in the encoded data

decode

public static byte[] decode(String id)
                     throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception

decode

public static void decode(char[] id,
                          int o,
                          int l,
                          OutputStream ostream)
                   throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception

decode

public static void decode(String id,
                          OutputStream ostream)
                   throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception

encode

public static String encode(byte[] id)

encodeChunk

public static char[] encodeChunk(byte[] id,
                                 int o,
                                 int l)

encodeChunk

public static void encodeChunk(byte[] id,
                               int o,
                               int l,
                               OutputStream ostream)
                        throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception

encode

public static String encode(String value)
                     throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception

encode

public static void encode(String value,
                          Writer writer)
                   throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception

encode

public static void encode(byte[] id,
                          int o,
                          int l,
                          Writer writer)
                   throws org.apache.cxf.common.util.Base64Exception
Throws:
org.apache.cxf.common.util.Base64Exception


Apache CXF