Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / SecurityToken.cs / 1305376 / SecurityToken.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Collections.ObjectModel; public abstract class SecurityToken { public abstract string Id { get; } public abstract ReadOnlyCollectionSecurityKeys { get; } public abstract DateTime ValidFrom { get; } public abstract DateTime ValidTo { get; } public virtual bool CanCreateKeyIdentifierClause () where T : SecurityKeyIdentifierClause { return ((typeof(T) == typeof(LocalIdKeyIdentifierClause)) && CanCreateLocalKeyIdentifierClause()); } public virtual T CreateKeyIdentifierClause () where T : SecurityKeyIdentifierClause { if ((typeof(T) == typeof(LocalIdKeyIdentifierClause)) && CanCreateLocalKeyIdentifierClause()) return new LocalIdKeyIdentifierClause(this.Id, this.GetType()) as T; throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException( SR.GetString(SR.TokenDoesNotSupportKeyIdentifierClauseCreation, GetType().Name, typeof(T).Name))); } public virtual bool MatchesKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause) { LocalIdKeyIdentifierClause localKeyIdentifierClause = keyIdentifierClause as LocalIdKeyIdentifierClause; if (localKeyIdentifierClause != null) return localKeyIdentifierClause.Matches(this.Id, this.GetType()); return false; } public virtual SecurityKey ResolveKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause) { if (this.SecurityKeys.Count != 0 && MatchesKeyIdentifierClause(keyIdentifierClause)) return this.SecurityKeys[0]; return null; } bool CanCreateLocalKeyIdentifierClause() { return (this.Id != null); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Collections.ObjectModel; public abstract class SecurityToken { public abstract string Id { get; } public abstract ReadOnlyCollection SecurityKeys { get; } public abstract DateTime ValidFrom { get; } public abstract DateTime ValidTo { get; } public virtual bool CanCreateKeyIdentifierClause () where T : SecurityKeyIdentifierClause { return ((typeof(T) == typeof(LocalIdKeyIdentifierClause)) && CanCreateLocalKeyIdentifierClause()); } public virtual T CreateKeyIdentifierClause () where T : SecurityKeyIdentifierClause { if ((typeof(T) == typeof(LocalIdKeyIdentifierClause)) && CanCreateLocalKeyIdentifierClause()) return new LocalIdKeyIdentifierClause(this.Id, this.GetType()) as T; throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException( SR.GetString(SR.TokenDoesNotSupportKeyIdentifierClauseCreation, GetType().Name, typeof(T).Name))); } public virtual bool MatchesKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause) { LocalIdKeyIdentifierClause localKeyIdentifierClause = keyIdentifierClause as LocalIdKeyIdentifierClause; if (localKeyIdentifierClause != null) return localKeyIdentifierClause.Matches(this.Id, this.GetType()); return false; } public virtual SecurityKey ResolveKeyIdentifierClause(SecurityKeyIdentifierClause keyIdentifierClause) { if (this.SecurityKeys.Count != 0 && MatchesKeyIdentifierClause(keyIdentifierClause)) return this.SecurityKeys[0]; return null; } bool CanCreateLocalKeyIdentifierClause() { return (this.Id != null); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ActivityDesigner.cs
- PersonalizationState.cs
- IMembershipProvider.cs
- CreateWorkflowOwnerCommand.cs
- DesignerActionListCollection.cs
- ConfigXmlElement.cs
- PropertyStore.cs
- MatrixStack.cs
- AutomationAttributeInfo.cs
- CodeFieldReferenceExpression.cs
- CodeConstructor.cs
- TableAutomationPeer.cs
- IpcChannel.cs
- ResourceIDHelper.cs
- WindowsToolbar.cs
- OptimalTextSource.cs
- WebRequestModulesSection.cs
- ConstraintCollection.cs
- SortDescription.cs
- XmlSchemaProviderAttribute.cs
- RectConverter.cs
- _DigestClient.cs
- EntityFunctions.cs
- SmiEventStream.cs
- XPathNavigatorReader.cs
- Metadata.cs
- CompareValidator.cs
- ProgressiveCrcCalculatingStream.cs
- Win32MouseDevice.cs
- TraceHandlerErrorFormatter.cs
- SemanticBasicElement.cs
- BooleanExpr.cs
- ResourceProperty.cs
- StateBag.cs
- WpfKnownMember.cs
- EventProxy.cs
- ColumnWidthChangingEvent.cs
- ExpandSegmentCollection.cs
- DateTime.cs
- Typeface.cs
- StateItem.cs
- TreeNodeCollection.cs
- OutputCacheProfileCollection.cs
- CacheChildrenQuery.cs
- TransformGroup.cs
- ObjectParameter.cs
- UntypedNullExpression.cs
- SqlExpressionNullability.cs
- UserControlBuildProvider.cs
- MD5HashHelper.cs
- UserPreferenceChangingEventArgs.cs
- SecurityException.cs
- RepeaterItem.cs
- BrowserCapabilitiesCompiler.cs
- DesignerActionPropertyItem.cs
- ConstNode.cs
- StrokeCollectionConverter.cs
- VisualTarget.cs
- StrongName.cs
- SchemaNamespaceManager.cs
- StoryFragments.cs
- RequestCachePolicyConverter.cs
- RelativeSource.cs
- PermissionSet.cs
- PrintPreviewDialog.cs
- ActionFrame.cs
- StoreItemCollection.Loader.cs
- WeakReferenceEnumerator.cs
- DataGridViewEditingControlShowingEventArgs.cs
- XMLDiffLoader.cs
- FileDialogCustomPlaces.cs
- TraceSwitch.cs
- ObjectQuery_EntitySqlExtensions.cs
- DataSourceCache.cs
- WmlListAdapter.cs
- DeploymentSection.cs
- XmlSerializableReader.cs
- InstanceDataCollection.cs
- StateDesigner.Helpers.cs
- LocalFileSettingsProvider.cs
- GridViewColumn.cs
- ValidationError.cs
- ReverseQueryOperator.cs
- ResizeBehavior.cs
- DesignerObjectListAdapter.cs
- XmlComplianceUtil.cs
- GroupBox.cs
- hresults.cs
- ProxyWebPart.cs
- HttpListenerElement.cs
- CodeStatementCollection.cs
- ArgumentElement.cs
- DynamicDiscoSearcher.cs
- PersonalizationProviderHelper.cs
- KnownIds.cs
- RNGCryptoServiceProvider.cs
- ScrollItemPatternIdentifiers.cs
- ContextMenuStrip.cs
- ExtendedPropertyDescriptor.cs
- IndentTextWriter.cs