public class AssociationResponse extends Message
Handles OpenID 2.0 and OpenID 1.x messages.
AssociationSessionType
Modifier and Type | Field and Description |
---|---|
protected static List |
optionalFields |
protected static List |
requiredFields |
_destinationUrl, MODE_CANCEL, MODE_IDRES, MODE_SETUP_NEEDED, OPENID2_NS
Modifier | Constructor and Description |
---|---|
protected |
AssociationResponse(AssociationRequest assocReq,
Association assoc)
Constructs an AssociationResponse for a given association request.
|
protected |
AssociationResponse(ParameterList params)
Constructs an AssociationResponse message from a parameter list.
|
Modifier and Type | Method and Description |
---|---|
static AssociationResponse |
createAssociationResponse(AssociationRequest assocReq,
Association assoc) |
static AssociationResponse |
createAssociationResponse(ParameterList params) |
Association |
getAssociation(DiffieHellmanSession dhSess)
Generates an Association object from an Association Response.
|
List |
getRequiredFields() |
AssociationSessionType |
getType()
Gets the association / session type of the association response.
|
boolean |
isVersion2()
Returns true for OpenID 2.0 messages, false otherwise.
|
void |
setAssocHandle(String handle)
Sets the handle of the association.
|
void |
setExpire(Long seconds)
Sets the lifetime, in seconds, of the association.
|
void |
setMacKey(String key)
Sets the unecrtypted MAC key of the association.
|
void |
setMacKeyEnc(String key)
Sets the encrypted MAC key of the association.
|
void |
setPublicKey(String key)
Sets the OP's (server's) public key for the association.
|
void |
setType(AssociationSessionType type)
Sets the association / session type for the association response.
|
void |
validate()
Checks if the message is a valid OpenID Association Response..
|
addExtension, addExtension, addExtensionFactory, createMessage, createMessage, getDestinationUrl, getExtension, getExtensionAlias, getExtensionFactory, getExtensions, getParameter, getParameterMap, getParameters, getParameterValue, hasExtension, hasExtensionFactory, hasParameter, keyValueFormEncoding, set, wwwFormEncoding
protected static final List requiredFields
protected static final List optionalFields
protected AssociationResponse(AssociationRequest assocReq, Association assoc) throws AssociationException
assocReq
- The association request that needs to be responded.assoc
- The association which will be used to sign
authentication responses.AssociationException
protected AssociationResponse(ParameterList params)
Useful for processing incoming messages.
public static AssociationResponse createAssociationResponse(AssociationRequest assocReq, Association assoc) throws MessageException, AssociationException
MessageException
AssociationException
public static AssociationResponse createAssociationResponse(ParameterList params) throws MessageException
MessageException
public List getRequiredFields()
getRequiredFields
in class Message
public boolean isVersion2()
public void setType(AssociationSessionType type)
public AssociationSessionType getType() throws AssociationException
AssociationException
public void setAssocHandle(String handle)
public void setExpire(Long seconds)
public void setMacKey(String key)
Should be called only for association responses using no-encryption sessions.
key
- The unencrypted MAC key.public void setPublicKey(String key)
key
- The server's public key for the association.public void setMacKeyEnc(String key)
Should be called only for association responses using Diffie-Hellman sessions.
key
- The encrypted MAC key.public void validate() throws MessageException
validate
in class Message
MessageException
- if message validation failed.public Association getAssociation(DiffieHellmanSession dhSess) throws AssociationException
dhSess
- The Diffie-Helman session containing the private key
used to encrypt / decrypt the MAC key exchange.
Should be null for no-encryption sessions.AssociationException
Copyright © 2013 Sxip. All rights reserved.