Package com.helger.http.digestauth
Class DigestAuthClientCredentials
java.lang.Object
com.helger.http.digestauth.DigestAuthClientCredentials
Credentials for HTTP digest authentication
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intExpected response length for MD5 algorithms (32 hex chars).static final intExpected response length for SHA-256 algorithms (64 hex chars). -
Constructor Summary
ConstructorsConstructorDescriptionDigestAuthClientCredentials(@NonNull @Nonempty String sUserName, @NonNull @Nonempty String sRealm, @NonNull @Nonempty String sServerNonce, @NonNull @Nonempty String sDigestURI, @NonNull @Nonempty String sResponse, @Nullable String sAlgorithm, @Nullable String sClientNonce, @Nullable String sOpaque, @Nullable String sMessageQOP, @Nullable String sNonceCount) Constructor with all digest authentication parameters. -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable String@Nullable String@NonNull @Nonempty String@Nullable Stringint@Nullable String@NonNull @Nonempty StringgetRealm()@NonNull @Nonempty String@Nullable String@NonNull @Nonempty String@NonNull @Nonempty StringinthashCode()toString()
-
Field Details
-
EXPECTED_RESPONSE_LENGTH
public static final int EXPECTED_RESPONSE_LENGTHExpected response length for MD5 algorithms (32 hex chars).- See Also:
-
EXPECTED_SHA256_RESPONSE_LENGTH
public static final int EXPECTED_SHA256_RESPONSE_LENGTHExpected response length for SHA-256 algorithms (64 hex chars). @since 12.2.0- See Also:
-
EXPECTED_NONCE_COUNT_LENGTH
public static final int EXPECTED_NONCE_COUNT_LENGTH- See Also:
-
-
Constructor Details
-
DigestAuthClientCredentials
public DigestAuthClientCredentials(@Nonempty @NonNull @Nonempty String sUserName, @Nonempty @NonNull @Nonempty String sRealm, @Nonempty @NonNull @Nonempty String sServerNonce, @Nonempty @NonNull @Nonempty String sDigestURI, @Nonempty @NonNull @Nonempty String sResponse, @Nullable String sAlgorithm, @Nullable String sClientNonce, @Nullable String sOpaque, @Nullable String sMessageQOP, @Nullable String sNonceCount) Constructor with all digest authentication parameters.- Parameters:
sUserName- The user name. May neither benullnor empty.sRealm- The realm. May neither benullnor empty.sServerNonce- The server nonce. May neither benullnor empty.sDigestURI- The digest URI. May neither benullnor empty.sResponse- The response hash. May neither benullnor empty. Must be a 32-character lowercase hex string.sAlgorithm- The algorithm used. May benull.sClientNonce- The client nonce. May benull.sOpaque- The opaque value. May benull.sMessageQOP- The quality of protection. May benull.sNonceCount- The nonce count as an 8-character hex string. May benull.
-
-
Method Details
-
getUserName
- Returns:
- The user name. Neither
nullnor empty.
-
getRealm
- Returns:
- The realm. Neither
nullnor empty.
-
getServerNonce
- Returns:
- The nonce. Neither
nullnor empty.
-
getDigestURI
- Returns:
- The digest URI. Neither
nullnor empty.
-
getResponse
- Returns:
- The response hash value. May be
null.
-
getAlgorithm
- Returns:
- The algorithm used. May be
null.
-
getClientNonce
- Returns:
- The client nonce. May be
null.
-
getOpaque
- Returns:
- The opaque value. May be
null.
-
getMessageQOP
- Returns:
- The message quality of protection. May be
null.
-
getNonceCount
@CheckForSigned public int getNonceCount()- Returns:
- The nonce count value. Returns -1 if not set.
-
getRequestValue
- Returns:
- The complete Digest authentication request header value. Neither
nullnor empty.
-
equals
-
hashCode
public int hashCode() -
toString
-