public class DigestAuthentication
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
algorithm |
protected byte[] |
body |
protected java.lang.String |
cnonce |
protected java.lang.String |
method |
protected java.lang.String |
nc |
protected java.lang.String |
nonce |
protected java.lang.String |
opaque |
protected java.lang.String |
passwd |
protected java.lang.String |
qop |
protected java.lang.String |
realm |
protected java.lang.String |
response |
protected java.lang.String |
uri |
protected java.lang.String |
username |
Modifier | Constructor and Description |
---|---|
protected |
DigestAuthentication()
Costructs a new DigestAuthentication.
|
|
DigestAuthentication(java.lang.String method,
AuthorizationHeader ah,
byte[] body,
java.lang.String passwd)
Costructs a new DigestAuthentication.
|
|
DigestAuthentication(java.lang.String method,
java.lang.String uri,
WwwAuthenticateHeader ah,
java.lang.String qop,
java.lang.String cnonce,
int nc,
byte[] body,
java.lang.String username,
java.lang.String passwd)
Costructs a new DigestAuthentication.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkResponse()
Whether the digest-response in the 'response' parameter in correct.
|
AuthorizationHeader |
getAuthorizationHeader()
Gets a new AuthorizationHeader based on current authentication attributes.
|
ProxyAuthorizationHeader |
getProxyAuthorizationHeader()
Gets a new ProxyAuthorizationHeader based on current authentication attributes.
|
java.lang.String |
getResponse()
Calculates the digest-response.
|
static void |
main(java.lang.String[] args)
Main method.
|
java.lang.String |
toString()
Gets a String representation of the object.
|
protected java.lang.String method
protected java.lang.String username
protected java.lang.String passwd
protected java.lang.String realm
protected java.lang.String nonce
protected java.lang.String opaque
protected java.lang.String algorithm
protected java.lang.String qop
protected java.lang.String uri
protected java.lang.String cnonce
protected java.lang.String nc
protected java.lang.String response
protected byte[] body
protected DigestAuthentication()
public DigestAuthentication(java.lang.String method, AuthorizationHeader ah, byte[] body, java.lang.String passwd)
public DigestAuthentication(java.lang.String method, java.lang.String uri, WwwAuthenticateHeader ah, java.lang.String qop, java.lang.String cnonce, int nc, byte[] body, java.lang.String username, java.lang.String passwd)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean checkResponse()
public AuthorizationHeader getAuthorizationHeader()
public ProxyAuthorizationHeader getProxyAuthorizationHeader()
public java.lang.String getResponse()
If the "qop" value is "auth" or "auth-int":
KD ( H(A1), unq(nonce) ":" nc ":" unq(cnonce) ":" unq(qop) ":" H(A2) )
If the "qop" directive is not present:
KD ( H(A1), unq(nonce) ":" H(A2) )
public static void main(java.lang.String[] args)