com.nimbusds.jose.util
Class Base64URL

java.lang.Object
  extended by com.nimbusds.jose.util.Base64URL
All Implemented Interfaces:
net.minidev.json.JSONAware

@Immutable
public class Base64URL
extends java.lang.Object
implements net.minidev.json.JSONAware

Base64URL-encoded object.

Related specifications:

Version:
$version$ (2013-01-15)
Author:
Vladimir Dzhuvinov

Constructor Summary
Base64URL(java.lang.String base64URL)
          Creates a new Base64URL-encoded object.
 
Method Summary
 byte[] decode()
          Decodes this Base64URL object to a byte array.
 java.lang.String decodeToString()
          Decodes this Base64URL object to a string.
static Base64URL encode(byte[] bytes)
          Base64URL-encode the specified byte array.
static Base64URL encode(java.lang.String text)
          Base64URL-encode 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 Base64URL string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Base64URL

public Base64URL(java.lang.String base64URL)
Creates a new Base64URL-encoded object.

Parameters:
base64URL - The Base64URL-encoded object value. The value is not validated for having characters from a Base64URL alphabet. Must not be null.
Method Detail

decode

public byte[] decode()
Decodes this Base64URL object to a byte array.

Returns:
The resulting byte array.

decodeToString

public java.lang.String decodeToString()
Decodes this Base64URL object to a string.

Returns:
The resulting string, in the UTF-8 character set.

toJSONString

public java.lang.String toJSONString()
Returns a JSON string representation of this object.

Specified by:
toJSONString in interface net.minidev.json.JSONAware
Returns:
The JSON string representation of this object.

toString

public java.lang.String toString()
Returns a Base64URL string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The Base64URL string representation.

hashCode

public int hashCode()
Overrides Object.hashCode().

Overrides:
hashCode in class java.lang.Object
Returns:
The object hash code.

equals

public boolean equals(java.lang.Object object)
Overrides Object.equals().

Overrides:
equals in class java.lang.Object
Parameters:
object - The object to compare to.
Returns:
true if the objects have the same value, otherwise false.

encode

public static Base64URL encode(java.lang.String text)
Base64URL-encode the specified string.

Parameters:
text - The string to encode. Must be in the UTF-8 character set and not null.
Returns:
The resulting Base64URL object.

encode

public static Base64URL encode(byte[] bytes)
Base64URL-encode the specified byte array.

Parameters:
bytes - The byte array to encode. Must not be null.
Returns:
The resulting Base64URL object.


Copyright © 2013 NimbusDS. All Rights Reserved.