|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.xmlsec.util.Base64
public class Base64
Implements base-64 encoding as per RFC 1421 (PEM) and RFC 2045 (MIME). If Base64
is set to use line breaks, then a newline ('\n'
) will be inserted after every 76 characters of the encoded output (MIME).
On input, whitespace characters ('\r', '\n', '\t', ' ') are ignored.
Nested Class Summary | |
---|---|
static class |
Base64.DecodeInputStream Decodes a base64 Reader and returns that as in InputStream. |
static class |
Base64.EncodeOutputStream Encodes an OutputStream into a String. |
Constructor Summary | |
---|---|
Base64() Creates a new Base64 instance, that will insert line separators in encoded output. |
|
Base64(boolean useLineBreaks) Creates a new Base64 instance. |
Method Summary | |
---|---|
byte[] |
decode(java.lang.String s) Returns the decoded form of the given Base-64 encoded string. |
java.lang.String |
encode(byte[] data) Returns the Base-64 encoding of the given byte array. |
static byte[] |
fromBase64(java.lang.String s) Returns the decoded form of the given Base-64 encoded string. |
boolean |
getUseLineBreaks() Returns true if this Base64 will insert line separators into encoded output. |
void |
setUseLineBreaks(boolean useLineBreaks) Used to indicate whether line separators are to be inserted in the encoded output. |
static java.lang.String |
toBase64(byte[] data, boolean useLineBreaks) Returns the Base-64 encoding of the given byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Base64()
Base64
instance, that will insert line separators in encoded output.
setUseLineBreaks(boolean)
public Base64(boolean useLineBreaks)
Base64
instance.
useLineBreaks
- If true
, will insert line separators in the encoded output.setUseLineBreaks(boolean)
Method Detail |
---|
public static java.lang.String toBase64(byte[] data, boolean useLineBreaks)
data
- The data to be encoded.useLineBreaks
- If true
, will insert line separators in the encoded output.public static byte[] fromBase64(java.lang.String s)
s
- The string to be decoded.public void setUseLineBreaks(boolean useLineBreaks)
true
, then the value of the system property line.separator
is used for this purpose.public boolean getUseLineBreaks()
true
if this Base64
will insert line separators into encoded output.setUseLineBreaks(boolean)
public java.lang.String encode(byte[] data)
data
- The data to be encoded.public byte[] decode(java.lang.String s)
Line breaks will be ignored, provided they are of the form CR
, LF
, or CRLF
, and do not occur twice in a row or in the middle of a four-character block.
s
- The string to be decoded.
|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |