|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.security.Base64Encoder
BASE64 encoder implementation. Provides encoding methods, using the BASE64 encoding rules, as defined in the MIME specification, rfc1521. This class is a modified version based on code obtained from the w3 consortium website, which is subject to their generic copyright notice:
| Constructor Summary | |
Base64Encoder()
|
|
| Method Summary | |
static java.lang.String |
encode(byte[] bytes)
Encode the given byte array and return the result as a string. |
static void |
encode(byte[] input,
java.io.OutputStream out)
Encode the supplied byte array and write the encoded data to the OutputStream out. |
static void |
encode(java.io.InputStream in,
java.io.OutputStream out)
Encodes data from supplied input to output. |
static java.lang.String |
encode(java.lang.String input)
Encode the given string,and return the encoded version as a string. |
static void |
main(java.lang.String[] args)
Run with one argument, prints the encoded version of it. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Base64Encoder()
| Method Detail |
public static void encode(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
in - The input stream to be encoded.out - The output stream, to write encoded data to.
java.io.IOException
public static void encode(byte[] input,
java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
public static java.lang.String encode(java.lang.String input)
throws java.io.IOException
java.io.IOException
public static java.lang.String encode(byte[] bytes)
throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
throws java.lang.Exception
Alternatively, use the openssl utility, for example:
echo -n "password" | openssl dgst -sha1 -binary | openssl base64
java.lang.Exception
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||