edu.internet2.middleware.shibboleth.common.util
Class Base32

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.util.Base32

public class Base32
extends Object

Base32 - encodes and decodes 'Canonical' Base32


Field Summary
private static String base32Chars
           
private static byte[] base32Lookup
           
private static String errorCanonicalEnd
           
private static String errorCanonicalLength
           
private static String errorInvalidChar
           
 
Constructor Summary
Base32()
           
 
Method Summary
static byte[] decode(String base32)
          Decode a Base32 string into an array of binary bytes.
static String encode(byte[] bytes)
          Encode an array of binary bytes into a Base32 string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base32Chars

private static final String base32Chars
See Also:
Constant Field Values

base32Lookup

private static final byte[] base32Lookup

errorCanonicalLength

private static final String errorCanonicalLength
See Also:
Constant Field Values

errorCanonicalEnd

private static final String errorCanonicalEnd
See Also:
Constant Field Values

errorInvalidChar

private static final String errorInvalidChar
See Also:
Constant Field Values
Constructor Detail

Base32

public Base32()
Method Detail

encode

public static String encode(byte[] bytes)
Encode an array of binary bytes into a Base32 string. Should not fail (the only possible exception is that the returned string cannot be allocated in memory)


decode

public static byte[] decode(String base32)
                     throws IllegalArgumentException
Decode a Base32 string into an array of binary bytes. May fail if the parameter is a non canonical Base32 string (the only other possible exception is that the returned array cannot be allocated in memory)

Throws:
IllegalArgumentException


Copyright © 1999-2012. All Rights Reserved.