using System;
using System.Collections.Generic;
using System.Text;
using DotNetOpenId;
namespace DotNetOpenId {
///
/// An enumeration that can specify how a given is used.
///
public enum AssociationRelyingPartyType {
///
/// The manages a shared secret between
/// Provider and Relying Party sites that allows the RP to verify
/// the signature on a message from an OP.
///
Smart,
///
/// The manages a secret known alone by
/// a Provider that allows the Provider to verify its own signatures
/// for "dumb" (stateless) relying parties.
///
Dumb
}
///
/// Stores s for lookup by their handle, keeping
/// associations separated by a given distinguishing factor (like which server the
/// association is with).
///
///
/// for consumers (to distinguish associations across servers) or
/// for providers (to distingish dumb and smart client associaitons).
///
public interface IAssociationStore {
///
/// Saves an for later recall.
///
void StoreAssociation(TKey distinguishingFactor, Association assoc);
///
/// Gets the best association (the one with the longest remaining life) for a given key.
/// Null if no unexpired s exist for the given key.
///
Association GetAssociation(TKey distinguishingFactor);
///
/// Gets the association for a given key and handle.
/// Null if no unexpired s exist for the given key and handle.
///
Association GetAssociation(TKey distinguishingFactor, string handle);
/// Removes a specified handle that may exist in the store.
/// True if the association existed in this store previous to this call.
///
/// No exception should be thrown if the association does not exist in the store
/// before this call.
///
bool RemoveAssociation(TKey distinguishingFactor, string handle);
///
/// Clears all expired associations from the store.
///
///
/// If another algorithm is in place to periodically clear out expired associations,
/// this method call may be ignored.
/// This should be done frequently enough to avoid a memory leak, but sparingly enough
/// to not be a performance drain.
///
void ClearExpiredAssociations();
}
}