• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
DigestScheme Class Reference
Inheritance diagram for DigestScheme:
RFC2617Scheme AuthSchemeBase AuthScheme

Description

Digest authentication scheme as defined in RFC 2617. Both MD5 (default) and MD5-sess are supported. Currently only qop=auth or no qop is supported. qop=auth-int is unsupported. If auth and auth-int are provided, auth is used.

Credential charset is configured via the credential charset parameter. Since the digest username is included as clear text in the generated Authentication header, the charset of the username must be compatible with the http element charset.

Author
Remy Maucherat
Rodney Waldhoff
Jeff Dever
Ortwin Glueck
Sean C. Sullivan
Adrian Sutton
Mike Bowler
Oleg Kalnichevski
Since
4.0

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

 DigestScheme ()
 Default constructor for the digest authetication scheme.
 
void processChallenge (final Header header) throws MalformedChallengeException
 Processes the Digest challenge. More...
 
boolean isComplete ()
 Tests if the Digest authentication process has been completed. More...
 
String getSchemeName ()
 Returns textual designation of the digest authentication scheme. More...
 
boolean isConnectionBased ()
 Returns false. More...
 
Header authenticate (final Credentials credentials, final HttpRequest request) throws AuthenticationException
 Produces a digest authorization string for the given set of com.good.gd.apache.http.auth.Credentials, method name and URI. More...
 
- Public Member Functions inherited from RFC2617Scheme
 RFC2617Scheme ()
 Default constructor for RFC2617 compliant authetication schemes.
 
String getParameter (final String name)
 Returns authentication parameter with the given name, if available. More...
 
String getRealm ()
 Returns authentication realm. More...
 
- Public Member Functions inherited from AuthSchemeBase
boolean isProxy ()
 Returns true if authenticating against a proxy, false otherwise. More...
 

Static Public Member Functions

static String createCnonce ()
 Creates a random cnonce value based on the current time. More...
 

Additional Inherited Members

- Protected Member Functions inherited from RFC2617Scheme
Map< String, String > getParameters ()
 Returns authentication parameters map. More...
 

Member Function Documentation

◆ processChallenge()

void processChallenge ( final Header  header) throws MalformedChallengeException
Parameters
headerthe challenge header
Exceptions
MalformedChallengeExceptionis thrown if the authentication challenge is malformed

Reimplemented from AuthSchemeBase.

◆ isComplete()

boolean isComplete ( )
Returns
true if Digest authorization has been processed, false otherwise.

Implements AuthScheme.

◆ getSchemeName()

String getSchemeName ( )
Returns
digest

Implements AuthScheme.

◆ isConnectionBased()

boolean isConnectionBased ( )

Digest authentication scheme is request based.

Returns
false.

Implements AuthScheme.

◆ authenticate()

Header authenticate ( final Credentials  credentials,
final HttpRequest  request 
) throws AuthenticationException
Parameters
credentialsA set of credentials to be used for athentication
requestThe request being authenticated
Exceptions
org.apache.http.auth.InvalidCredentialsExceptionif authentication credentials are not valid or not applicable for this authentication scheme
AuthenticationExceptionif authorization string cannot be generated due to an authentication failure
Returns
a digest authorization string

Implements AuthScheme.

◆ createCnonce()

static String createCnonce ( )
static
Returns
The cnonce value as String.
Exceptions
UnsupportedDigestAlgorithmExceptionif MD5 algorithm is not supported.