|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.util.HttpDigestAuthentication
public class HttpDigestAuthentication
An authentication object for http digest authentication.
Constructor Summary | |
---|---|
HttpDigestAuthentication(java.lang.String user,
java.lang.String pass,
java.lang.String authUri)
Create the digest authentication object with a username, password, and uri. |
Method Summary | |
---|---|
static java.lang.String |
calculateHa1(java.lang.String username,
java.lang.String password,
java.lang.String realm)
Calculate ha1 given a username, realm, and password. |
static java.lang.String |
calculateHa2(java.lang.String uri)
Calculate ha2 given a uri. |
static java.lang.String |
calculateResponse(java.lang.String ha1,
java.lang.String ha2,
java.lang.String nonce,
java.lang.String qop,
java.lang.String cnonce,
java.lang.String nc)
Calculate the response given ha1 and ha2. |
static java.lang.String |
extractDigestProp(java.lang.String str,
java.lang.String prop)
Extract a specific property from a string of property value pairs separated by '=' |
protected java.lang.String |
generateAuthResponseString()
Generate an authentication response of digest properties and values. |
protected java.lang.String |
generateAuthResponseString(java.lang.Long seed)
Generate an authentication response of digest properties and values, given a seed to generate a client nonce. |
boolean |
getRetryWithAuth()
Return whether or not to retry requests with authentication information. |
boolean |
handleAuthentication(HttpConnectionAdapter c)
Set the authentication property in the given HTTP connection. |
protected boolean |
processAuthInfo(java.lang.String info)
Process the given authentication information. |
boolean |
processHttpError(HttpConnectionAdapter c)
Check the given connection for a 401 HTTP error and process any authentication information that is present. |
void |
setPassword(java.lang.String value)
Set the password for the authentication. |
void |
setUri(java.lang.String value)
Set the URI to authenticate against. |
void |
setUsername(java.lang.String value)
Set the username of the client being authenticated. |
static java.lang.String |
toHex(byte[] hash)
Convert a hash to a hexadecimal number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpDigestAuthentication(java.lang.String user, java.lang.String pass, java.lang.String authUri)
username
- The username of the client being authenticatedpassword
- The password for the client being authenticateduri
- The uri to authenticate againstMethod Detail |
---|
public static java.lang.String extractDigestProp(java.lang.String str, java.lang.String prop)
str
- The string of propertiesprop
- The property to extract
public static final java.lang.String toHex(byte[] hash)
hash
- The byte array hash to convert
protected java.lang.String generateAuthResponseString()
protected java.lang.String generateAuthResponseString(java.lang.Long seed)
protected boolean processAuthInfo(java.lang.String info)
info
- The authentication string of digest properties and values
public boolean handleAuthentication(HttpConnectionAdapter c) throws java.io.IOException
handleAuthentication
in interface HttpAuthentication
c
- The connection on which the authentication information is being set
java.io.IOException
public boolean processHttpError(HttpConnectionAdapter c) throws java.io.IOException
processHttpError
in interface HttpAuthentication
c
- The connection to check for and process HTTP errors.
java.io.IOException
public static java.lang.String calculateHa1(java.lang.String username, java.lang.String password, java.lang.String realm)
username
- The username of the user being authenticatedrealm
- The authentication realmpassword
- The password of the user being authenticated
public static java.lang.String calculateHa2(java.lang.String uri)
uri
- The uri to authenticate against.
public static java.lang.String calculateResponse(java.lang.String ha1, java.lang.String ha2, java.lang.String nonce, java.lang.String qop, java.lang.String cnonce, java.lang.String nc)
ha1
- A calculated ha1 valueha2
- A calculated ha2 valuecnonce
- The client noncenc
- The nonce count
public boolean getRetryWithAuth()
getRetryWithAuth
in interface HttpAuthentication
public void setUsername(java.lang.String value)
setUsername
in interface HttpAuthentication
value
- The username to authenticate withpublic void setPassword(java.lang.String value)
setPassword
in interface HttpAuthentication
value
- The password to authenticate withpublic void setUri(java.lang.String value)
setUri
in interface HttpAuthentication
value
- The URI to authenticate against
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |