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
- ConnectionPointGlyph.cs
- SqlMethodAttribute.cs
- SystemWebSectionGroup.cs
- SeekStoryboard.cs
- WorkItem.cs
- BamlBinaryWriter.cs
- Aggregates.cs
- ToolStripSeparator.cs
- CommandBinding.cs
- SelectionRange.cs
- DrawingImage.cs
- BaseCAMarshaler.cs
- DbExpressionVisitor_TResultType.cs
- PopupRoot.cs
- DeferredBinaryDeserializerExtension.cs
- AdapterDictionary.cs
- Size.cs
- MobileErrorInfo.cs
- MulticastNotSupportedException.cs
- ObjectStateEntry.cs
- ThemeDictionaryExtension.cs
- ExtensionSimplifierMarkupObject.cs
- returneventsaver.cs
- NamespaceList.cs
- FlowDocumentReaderAutomationPeer.cs
- PassportPrincipal.cs
- XsdCachingReader.cs
- _NegotiateClient.cs
- AuthenticationManager.cs
- ReaderOutput.cs
- EmbeddedMailObject.cs
- SQLInt64Storage.cs
- HttpModulesSection.cs
- ReverseInheritProperty.cs
- XamlReaderConstants.cs
- BrowsableAttribute.cs
- DatePicker.cs
- ObjectDisposedException.cs
- HtmlValidatorAdapter.cs
- Utility.cs
- WaitHandleCannotBeOpenedException.cs
- StreamingContext.cs
- BinaryFormatter.cs
- Misc.cs
- TextEditorTables.cs
- cache.cs
- GridViewDeletedEventArgs.cs
- HwndMouseInputProvider.cs
- ConstantProjectedSlot.cs
- BitmapDecoder.cs
- ForEachAction.cs
- WindowsHyperlink.cs
- NumericPagerField.cs
- OrthographicCamera.cs
- SimplePropertyEntry.cs
- PrtTicket_Base.cs
- DataGrid.cs
- XmlSchemaChoice.cs
- KeyPullup.cs
- ArrayHelper.cs
- BindingList.cs
- Vector3DCollection.cs
- DictionaryEntry.cs
- MultiAsyncResult.cs
- TextElementEnumerator.cs
- Identifier.cs
- WebBrowserHelper.cs
- TextBoxRenderer.cs
- connectionpool.cs
- DescendantBaseQuery.cs
- AuthStoreRoleProvider.cs
- ProviderBase.cs
- ObjectSet.cs
- DirectionalAction.cs
- SiteMapNode.cs
- IIS7WorkerRequest.cs
- WinCategoryAttribute.cs
- EllipseGeometry.cs
- NumberSubstitution.cs
- DBConnection.cs
- CodeTypeMemberCollection.cs
- Misc.cs
- XPathEmptyIterator.cs
- CompileXomlTask.cs
- LinkArea.cs
- MediaElementAutomationPeer.cs
- OleStrCAMarshaler.cs
- XPathNodeIterator.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- EdmItemError.cs
- BitmapCacheBrush.cs
- ThaiBuddhistCalendar.cs
- Material.cs
- Translator.cs
- TransformProviderWrapper.cs
- CompositeControl.cs
- AmbientLight.cs
- PageAdapter.cs
- AttributeSetAction.cs
- OracleParameter.cs