Top Description Constructors Methods
com.ongres.scram.common

public Class ScramStringFormatting

extends Object
Class Inheritance
Static Imports
com.ongres.scram.common.util.Preconditions.checkNotEmpty, .Preconditions.checkNotNull

Class with static methods that provide support for converting to/from salNames.
See Also
[RFC5802] Section 7: Formal Syntax

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static byte[]
public static String
base64Encode(byte[] value)

public static String
public static String

Returns:

The saslName, unescaped
fromSaslName
(String
The saslName
value
)

Given a saslName, return a non-escaped String.

public static String

Returns:

The saslName, with caracter escaped (if any)
toSaslName
(String
The value to convert so saslName
value
)

Given a value-safe-char (normalized UTF-8 String), return one where characters ',' and '=' are represented by '=2C' or '=3D', respectively.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ScramStringFormattingback to summary
public ScramStringFormatting()

Method Detail

base64Decodeback to summary
public static byte[] base64Decode(String value) throws IllegalArgumentException
base64Encodeback to summary
public static String base64Encode(byte[] value) throws IllegalArgumentException
base64Encodeback to summary
public static String base64Encode(String value) throws IllegalArgumentException
fromSaslNameback to summary
public static String fromSaslName(String value) throws IllegalArgumentException

Given a saslName, return a non-escaped String.

Parameters
value:String

The saslName

Returns:String

The saslName, unescaped

Exceptions
IllegalArgumentException:
If a ',' character is present, or a '=' not followed by either '2C' or '3D'
toSaslNameback to summary
public static String toSaslName(String value)

Given a value-safe-char (normalized UTF-8 String), return one where characters ',' and '=' are represented by '=2C' or '=3D', respectively.

Parameters
value:String

The value to convert so saslName

Returns:String

The saslName, with caracter escaped (if any)