Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- OrderedHashRepartitionStream.cs
- SchemaContext.cs
- LinkDesigner.cs
- DataGridViewComboBoxColumnDesigner.cs
- UriExt.cs
- UpdatableGenericsFeature.cs
- UrlMapping.cs
- SearchExpression.cs
- Triangle.cs
- AssociationType.cs
- Guid.cs
- SelectionBorderGlyph.cs
- Propagator.cs
- ChannelListenerBase.cs
- Int32CAMarshaler.cs
- UrlPropertyAttribute.cs
- ObjectDataSourceView.cs
- Profiler.cs
- X509SecurityTokenAuthenticator.cs
- SourceChangedEventArgs.cs
- JsonFormatWriterGenerator.cs
- BulletedList.cs
- RecognizeCompletedEventArgs.cs
- ExpandedWrapper.cs
- DatePickerDateValidationErrorEventArgs.cs
- HwndAppCommandInputProvider.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- WindowsTokenRoleProvider.cs
- XmlSchemaSequence.cs
- ValidationVisibilityAttribute.cs
- SerializationAttributes.cs
- regiisutil.cs
- webeventbuffer.cs
- ListViewItemEventArgs.cs
- DragStartedEventArgs.cs
- ProgressiveCrcCalculatingStream.cs
- ComponentChangingEvent.cs
- WorkflowServiceHost.cs
- TemplateBindingExtensionConverter.cs
- GroupBoxRenderer.cs
- ToolStrip.cs
- DelimitedListTraceListener.cs
- PropertyTab.cs
- SerializationException.cs
- CircleHotSpot.cs
- UnorderedHashRepartitionStream.cs
- XmlLanguageConverter.cs
- InstanceContextManager.cs
- GeneralTransformGroup.cs
- TextServicesProperty.cs
- DataGridViewCellStyleConverter.cs
- SendSecurityHeader.cs
- IntPtr.cs
- EntitySqlQueryBuilder.cs
- X509Utils.cs
- BoundColumn.cs
- ExportFileRequest.cs
- IndexedDataBuffer.cs
- PageCatalogPartDesigner.cs
- Point.cs
- BitmapFrameDecode.cs
- AnonymousIdentificationModule.cs
- ContentAlignmentEditor.cs
- NGCPageContentCollectionSerializerAsync.cs
- StylusTip.cs
- ImageDrawing.cs
- DbgUtil.cs
- TreeNodeSelectionProcessor.cs
- TypeRefElement.cs
- DataPagerCommandEventArgs.cs
- HelpProvider.cs
- ConfigurationErrorsException.cs
- Tuple.cs
- TextParagraphView.cs
- ValidatorCompatibilityHelper.cs
- DataGridViewCellConverter.cs
- HTTPNotFoundHandler.cs
- CultureMapper.cs
- MergeFailedEvent.cs
- MobileResource.cs
- WebBrowser.cs
- StylusPointPropertyInfo.cs
- RoleGroupCollection.cs
- BitmapEffectGroup.cs
- Perspective.cs
- Point4D.cs
- TypeDependencyAttribute.cs
- ContextStack.cs
- ErrorsHelper.cs
- SqlClientFactory.cs
- ObjectDataSourceSelectingEventArgs.cs
- Decoder.cs
- DesignerActionKeyboardBehavior.cs
- MultiBinding.cs
- basenumberconverter.cs
- XmlSchemaFacet.cs
- TemplateControl.cs
- DataServiceQueryProvider.cs
- SchemaCreator.cs
- Pair.cs