Top Description Fields Constructors Methods
com.ongres.scram.common

public final Enum ScramAttributes

extends Enum<ScramAttributes>
implements CharAttribute
Class Inheritance
All Implemented Interfaces
com.ongres.scram.common.util.CharAttribute
Imports
com.ongres.scram.common.exception.ScramParseException, com.ongres.scram.common.util.CharAttribute, java.util.HashMap, .Map

SCRAM Attributes as defined in Section 5.1 of the RFC. Not all the available attributes may be available in this implementation.

Field Summary

Modifier and TypeField and Description
private final char
public static final ScramAttributes
AUTHZID

This is an optional attribute, and is part of the GS2 [RFC5801] bridge between the GSS-API and SASL.

public static final ScramAttributes
CHANNEL_BINDING

This REQUIRED attribute specifies the base64-encoded GS2 header and channel binding data.

public static final ScramAttributes
CLIENT_PROOF

This attribute specifies a base64-encoded ClientProof.

public static final ScramAttributes
ERROR

This attribute specifies an error that occurred during authentication exchange.

public static final ScramAttributes
ITERATION

This attribute specifies an iteration count for the selected hash function and user.

public static final ScramAttributes
NONCE

This attribute specifies a sequence of random printable ASCII characters excluding ',' (which forms the nonce used as input to the hash function).

private static final Map<Character, ScramAttributes>
public static final ScramAttributes
SALT

This attribute specifies the base64-encoded salt used by the server for this user.

public static final ScramAttributes
SERVER_SIGNATURE

This attribute specifies a base64-encoded ServerSignature.

public static final ScramAttributes
USERNAME

This attribute specifies the name of the user whose password is used for authentication (a.k.a. "authentication identity" [RFC4422]).

Constructor Summary

AccessConstructor and Description
private
ScramAttributes(char attributeChar)

Method Summary

Modifier and TypeMethod and Description
public static ScramAttributes

Returns:

The SCRAMAttribute that has that character.
byChar
(char
The character.
c
)

Find a SCRAMAttribute by its character.

public char
getChar()

Implements com.ongres.scram.common.util.CharAttribute.getChar.

Return the char used to represent this attribute
public static ScramAttributes
public static ScramAttributes[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

attributeCharback to summary
private final char attributeChar
AUTHZIDback to summary
public static final ScramAttributes AUTHZID

This is an optional attribute, and is part of the GS2 [RFC5801] bridge between the GSS-API and SASL. This attribute specifies an authorization identity. A client may include it in its first message to the server if it wants to authenticate as one user, but subsequently act as a different user. This is typically used by an administrator to perform some management task on behalf of another user, or by a proxy in some situations. If this attribute is omitted (as it normally would be), the authorization identity is assumed to be derived from the username specified with the (required) "n" attribute. The server always authenticates the user specified by the "n" attribute. If the "a" attribute specifies a different user, the server associates that identity with the connection after successful authentication and authorization checks. The syntax of this field is the same as that of the "n" field with respect to quoting of '=' and ','.

CHANNEL_BINDINGback to summary
public static final ScramAttributes CHANNEL_BINDING

This REQUIRED attribute specifies the base64-encoded GS2 header and channel binding data. The attribute data consist of:

  • the GS2 header from the client's first message (recall that the GS2 header contains a channel binding flag and an optional authzid). This header is going to include channel binding type prefix (see [RFC5056]), if and only if the client is using channel binding;
  • followed by the external channel's channel binding data, if and only if the client is using channel binding.
CLIENT_PROOFback to summary
public static final ScramAttributes CLIENT_PROOF

This attribute specifies a base64-encoded ClientProof.

ERRORback to summary
public static final ScramAttributes ERROR

This attribute specifies an error that occurred during authentication exchange. Can help diagnose the reason for the authentication exchange failure.

ITERATIONback to summary
public static final ScramAttributes ITERATION

This attribute specifies an iteration count for the selected hash function and user.

NONCEback to summary
public static final ScramAttributes NONCE

This attribute specifies a sequence of random printable ASCII characters excluding ',' (which forms the nonce used as input to the hash function). No quoting is applied to this string.

REVERSE_MAPPINGback to summary
private static final Map<Character, ScramAttributes> REVERSE_MAPPING
SALTback to summary
public static final ScramAttributes SALT

This attribute specifies the base64-encoded salt used by the server for this user.

SERVER_SIGNATUREback to summary
public static final ScramAttributes SERVER_SIGNATURE

This attribute specifies a base64-encoded ServerSignature.

USERNAMEback to summary
public static final ScramAttributes USERNAME

This attribute specifies the name of the user whose password is used for authentication (a.k.a. "authentication identity" [RFC4422]). If the "a" attribute is not specified (which would normally be the case), this username is also the identity that will be associated with the connection subsequent to authentication and authorization. The client SHOULD prepare the username using the "SASLprep" profile [RFC4013] of the "stringprep" algorithm [RFC3454] treating it as a query string (i.e., unassigned Unicode code points are allowed). The characters ',' or '=' in usernames are sent as '=2C' and '=3D' respectively.

Constructor Detail

ScramAttributesback to summary
private ScramAttributes(char attributeChar)

Method Detail

byCharback to summary
public static ScramAttributes byChar(char c) throws ScramParseException

Find a SCRAMAttribute by its character.

Parameters
c:char

The character.

Returns:ScramAttributes

The SCRAMAttribute that has that character.

Exceptions
ScramParseException:
If no SCRAMAttribute has this character.
getCharback to summary
public char getChar()

Implements com.ongres.scram.common.util.CharAttribute.getChar.

Doc from com.ongres.scram.common.util.CharAttribute.getChar.

Return the char used to represent this attribute

Returns:char

The character of the attribute

Annotations
@Override
valueOfback to summary
public static ScramAttributes valueOf(String name)
valuesback to summary
public static ScramAttributes[] values()