Modifier and Type | Field and Description |
---|---|
static java.nio.charset.Charset |
CHARSET
UTF-8 is the required character set for all JOSE + JWT objects.
|
Constructor and Description |
---|
Base64(java.lang.String base64)
Creates a new Base64-encoded object.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decode()
Decodes this Base64 object to a byte array.
|
java.math.BigInteger |
decodeToBigInteger()
Decodes this Base64 object to an unsigned big integer.
|
java.lang.String |
decodeToString()
Decodes this Base64 object to a string.
|
static Base64 |
encode(java.math.BigInteger bigInt)
Base64-encodes the specified big integer, without the sign bit.
|
static Base64 |
encode(byte[] bytes)
Base64-encodes the specified byte array.
|
static Base64 |
encode(java.lang.String text)
Base64-encodes the specified string.
|
boolean |
equals(java.lang.Object object)
Overrides
Object.equals() . |
int |
hashCode()
Overrides
Object.hashCode() . |
java.lang.String |
toJSONString()
Returns a JSON string representation of this object.
|
java.lang.String |
toString()
Returns a Base64 string representation of this object.
|
public static final java.nio.charset.Charset CHARSET
public Base64(java.lang.String base64)
base64
- The Base64-encoded object value. The value is not
validated for having characters from a Base64
alphabet. Must not be null
.public byte[] decode()
public java.math.BigInteger decodeToBigInteger()
Same as new BigInteger(1, base64.decode())
.
public java.lang.String decodeToString()
public java.lang.String toJSONString()
toJSONString
in interface net.minidev.json.JSONAware
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
Object.hashCode()
.hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
Object.equals()
.equals
in class java.lang.Object
object
- The object to compare to.true
if the objects have the same value, otherwise
false
.public static Base64 encode(byte[] bytes)
bytes
- The byte array to encode. Must not be null
.public static Base64 encode(java.math.BigInteger bigInt)
bigInt
- The big integer to encode. Must not be null
.Copyright © 2014 Connect2id Ltd.. All Rights Reserved.