public final class ChallengeResponse extends ChallengeMessage
ChallengeRequest
sent by the origin server to the client.QUALITY_AUTHENTICATION, QUALITY_AUTHENTICATION_INTEGRITY
Constructor and Description |
---|
ChallengeResponse(ChallengeRequest challengeRequest,
Response response,
java.lang.String identifier,
char[] secret)
Constructor.
|
ChallengeResponse(ChallengeRequest challengeRequest,
Response response,
java.lang.String identifier,
char[] secret,
java.lang.String secretAlgorithm)
Constructor.
|
ChallengeResponse(ChallengeRequest challengeRequest,
Response response,
java.lang.String identifier,
java.lang.String secret)
Constructor.
|
ChallengeResponse(ChallengeScheme scheme)
Constructor with no credentials.
|
ChallengeResponse(ChallengeScheme scheme,
Series<Parameter> parameters,
java.lang.String identifier,
char[] secret,
java.lang.String secretAlgorithm,
java.lang.String realm,
java.lang.String quality,
Reference digestRef,
java.lang.String digestAlgorithm,
java.lang.String opaque,
java.lang.String clientNonce,
java.lang.String serverNonce,
int serverNounceCount,
long timeIssued)
Constructor.
|
ChallengeResponse(ChallengeScheme scheme,
java.lang.String identifier,
char[] secret)
Constructor.
|
ChallengeResponse(ChallengeScheme scheme,
java.lang.String identifier,
char[] secret,
Series<Parameter> parameters)
Constructor.
|
ChallengeResponse(ChallengeScheme scheme,
java.lang.String identifier,
Series<Parameter> parameters)
Constructor.
|
ChallengeResponse(ChallengeScheme scheme,
java.lang.String identifier,
java.lang.String secret)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getClientNonce()
Returns the client nonce.
|
Reference |
getDigestRef()
Returns the
Request.getResourceRef() value duplicated here in
case a proxy changed it. |
java.lang.String |
getIdentifier()
Returns the user identifier, such as a login name or an access key.
|
java.security.Principal |
getPrincipal()
Gets the principal associated to the identifier property.
|
java.lang.String |
getQuality()
Returns the chosen quality of protection.
|
char[] |
getSecret()
Returns the user secret, such as a password or a secret key.
|
java.lang.String |
getSecretAlgorithm()
Returns the digest algorithm name optionally applied on the user secret.
|
int |
getServerNounceCount()
Returns the server nonce count.
|
java.lang.String |
getServerNounceCountAsHex()
Returns the server nonce count as an hexadecimal string of eight
characters.
|
long |
getTimeIssued()
Returns the time when the response was issued, as returned by
System.currentTimeMillis() . |
int |
hashCode() |
void |
setClientNonce(java.lang.String clientNonce)
Sets the client nonce.
|
void |
setDigestRef(Reference digestRef)
Sets the digest URI reference.
|
void |
setIdentifier(java.lang.String identifier)
Sets the user identifier, such as a login name or an access key.
|
void |
setQuality(java.lang.String quality)
Sets the chosen quality of protection.
|
void |
setSecret(char[] secret)
Sets the user secret, such as a password or a secret key.
|
void |
setSecret(java.lang.String secret)
Sets the user secret, such as a password or a secret key.
|
void |
setSecretAlgorithm(java.lang.String secretDigestAlgorithm)
Sets the digest algorithm name optionally applied on the user secret.
|
void |
setServerNounceCount(int serverNounceCount)
Sets the server nonce count.
|
void |
setTimeIssued(long timeIssued)
Sets the time when the response was issued, as returned by
System.currentTimeMillis() . |
getDigestAlgorithm, getOpaque, getParameters, getRawValue, getRealm, getScheme, getServerNonce, setDigestAlgorithm, setOpaque, setParameters, setRawValue, setRealm, setScheme, setServerNonce
public ChallengeResponse(ChallengeRequest challengeRequest, Response response, java.lang.String identifier, char[] secret)
challengeRequest
- The challenge request sent by the origin server.response
- The latest server response.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key, with no
digest applied.public ChallengeResponse(ChallengeRequest challengeRequest, Response response, java.lang.String identifier, char[] secret, java.lang.String secretAlgorithm)
challengeRequest
- The challenge request sent by the origin server.response
- The latest server response.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret used to compute the secret, with an optional
digest applied.secretAlgorithm
- The digest algorithm of the user secret (see Digest
class).public ChallengeResponse(ChallengeRequest challengeRequest, Response response, java.lang.String identifier, java.lang.String secret)
challengeRequest
- The challenge request sent by the origin server.response
- The latest server response.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key.public ChallengeResponse(ChallengeScheme scheme)
scheme
- The challenge scheme.public ChallengeResponse(ChallengeScheme scheme, Series<Parameter> parameters, java.lang.String identifier, char[] secret, java.lang.String secretAlgorithm, java.lang.String realm, java.lang.String quality, Reference digestRef, java.lang.String digestAlgorithm, java.lang.String opaque, java.lang.String clientNonce, java.lang.String serverNonce, int serverNounceCount, long timeIssued)
scheme
- The challenge scheme.parameters
- The additional scheme parameters.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key.secretAlgorithm
- The digest algorithm name optionally applied on the user
secret.realm
- The authentication realm.quality
- The chosen quality of protection.digestRef
- The Request.getResourceRef()
value duplicated here in
case a proxy changed it.digestAlgorithm
- The digest algorithm.opaque
- An opaque string of data which should be returned by the
client unchanged.clientNonce
- The client nonce value.serverNonce
- The server nonce.serverNounceCount
- The server nonce count.timeIssued
- The time when the response was issued, as returned by System.currentTimeMillis()
.public ChallengeResponse(ChallengeScheme scheme, java.lang.String identifier, char[] secret)
scheme
- The challenge scheme.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key.public ChallengeResponse(ChallengeScheme scheme, java.lang.String identifier, char[] secret, Series<Parameter> parameters)
scheme
- The challenge scheme.identifier
- The user identifier, such as a login name or an access key.parameters
- The additional scheme parameters.public ChallengeResponse(ChallengeScheme scheme, java.lang.String identifier, Series<Parameter> parameters)
scheme
- The challenge scheme.identifier
- The user identifier, such as a login name or an access key.parameters
- The additional scheme parameters.public ChallengeResponse(ChallengeScheme scheme, java.lang.String identifier, java.lang.String secret)
scheme
- The challenge scheme.identifier
- The user identifier, such as a login name or an access key.secret
- The user secret, such as a password or a secret key.public boolean equals(java.lang.Object obj)
equals
in class ChallengeMessage
public java.lang.String getClientNonce()
public Reference getDigestRef()
Request.getResourceRef()
value duplicated here in
case a proxy changed it.public java.lang.String getIdentifier()
public java.security.Principal getPrincipal()
public java.lang.String getQuality()
public char[] getSecret()
String(char[])
for security
reasons.public java.lang.String getSecretAlgorithm()
public int getServerNounceCount()
public java.lang.String getServerNounceCountAsHex()
public long getTimeIssued()
System.currentTimeMillis()
.public int hashCode()
hashCode
in class ChallengeMessage
public void setClientNonce(java.lang.String clientNonce)
clientNonce
- The client nonce.public void setDigestRef(Reference digestRef)
digestRef
- The digest URI reference.public void setIdentifier(java.lang.String identifier)
identifier
- The user identifier, such as a login name or an access key.public void setQuality(java.lang.String quality)
quality
- The chosen quality of protection.public void setSecret(char[] secret)
secret
- The user secret, such as a password or a secret key.public void setSecret(java.lang.String secret)
secret
- The user secret, such as a password or a secret key.public void setSecretAlgorithm(java.lang.String secretDigestAlgorithm)
secretDigestAlgorithm
- The digest algorithm name optionally applied on the user
secret.public void setServerNounceCount(int serverNounceCount)
serverNounceCount
- The server nonce count.public void setTimeIssued(long timeIssued)
System.currentTimeMillis()
.timeIssued
- The time when the response was issued.Copyright © 2005-2024 Restlet.