//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId.Messages { using System; using System.Collections.Generic; using System.Linq; using System.Text; using DotNetOpenAuth.OpenId.Provider; /// /// An unencrypted association response as it is sent by the Provider. /// internal class AssociateUnencryptedResponseProvider : AssociateUnencryptedResponse, IAssociateSuccessfulResponseProvider { /// /// Initializes a new instance of the class. /// /// The version. /// The request. internal AssociateUnencryptedResponseProvider(Version version, AssociateUnencryptedRequest request) : base(version, request) { } /// /// Gets or sets the lifetime, in seconds, of this association. The Relying Party MUST NOT use the association after this time has passed. /// /// /// An integer, represented in base 10 ASCII. /// long IAssociateSuccessfulResponseProvider.ExpiresIn { get { return this.ExpiresIn; } set { this.ExpiresIn = value; } } /// /// Gets or sets the association handle is used as a key to refer to this association in subsequent messages. /// /// /// A string 255 characters or less in length. It MUST consist only of ASCII characters in the range 33-126 inclusive (printable non-whitespace characters). /// string IAssociateSuccessfulResponseProvider.AssociationHandle { get { return this.AssociationHandle; } set { this.AssociationHandle = value; } } /// /// Called to create the Association based on a request previously given by the Relying Party. /// /// The prior request for an association. /// The Provider's association store. /// The security settings of the Provider. /// /// The created association. /// /// /// The caller will update this message's /// and /// /// properties based on the returned by this method, but any other /// association type specific properties must be set by this method. /// The response message is updated to include the details of the created association by this method, /// but the resulting association is not added to the association store and must be done by the caller. /// public Association CreateAssociationAtProvider(AssociateRequest request, IProviderAssociationStore associationStore, ProviderSecuritySettings securitySettings) { Association association = HmacShaAssociationProvider.Create(Protocol, this.AssociationType, AssociationRelyingPartyType.Smart, associationStore, securitySettings); this.MacKey = association.SecretKey; return association; } } }