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
- ContextMenuStrip.cs
- NavigationPropertySingletonExpression.cs
- ConfigurationValidatorAttribute.cs
- DocumentGridContextMenu.cs
- NullableFloatMinMaxAggregationOperator.cs
- UInt64.cs
- PauseStoryboard.cs
- EncoderFallback.cs
- WebPartDisplayModeCollection.cs
- WeakEventManager.cs
- TimeSpanOrInfiniteConverter.cs
- TimeoutValidationAttribute.cs
- SpecialFolderEnumConverter.cs
- TransactionState.cs
- StreamReader.cs
- SignerInfo.cs
- MSAAWinEventWrap.cs
- SequentialOutput.cs
- UIPermission.cs
- AssemblyAssociatedContentFileAttribute.cs
- Zone.cs
- UTF7Encoding.cs
- WebPartZone.cs
- ItemCollection.cs
- MetabaseSettingsIis7.cs
- ColorMatrix.cs
- PerfCounters.cs
- ByteAnimationUsingKeyFrames.cs
- TableRowGroupCollection.cs
- InternalControlCollection.cs
- QueryCacheEntry.cs
- MD5.cs
- OutputScopeManager.cs
- SHA256.cs
- XmlCharCheckingReader.cs
- ForceCopyBuildProvider.cs
- RemotingException.cs
- CustomPopupPlacement.cs
- ImageClickEventArgs.cs
- FileLevelControlBuilderAttribute.cs
- TextBoxBase.cs
- PropertyItem.cs
- OneOf.cs
- ObjectSecurity.cs
- Control.cs
- EnumValidator.cs
- X509CertificateEndpointIdentity.cs
- BinaryFormatter.cs
- HttpServerVarsCollection.cs
- EventLogPermissionAttribute.cs
- IgnoreSectionHandler.cs
- WebPartMovingEventArgs.cs
- SchemaImporter.cs
- TypeSource.cs
- DataKeyPropertyAttribute.cs
- StringKeyFrameCollection.cs
- PasswordDeriveBytes.cs
- WebHostScriptMappingsInstallComponent.cs
- DataTableNewRowEvent.cs
- RoleManagerModule.cs
- SyncMethodInvoker.cs
- ArrayTypeMismatchException.cs
- SqlDataSourceSelectingEventArgs.cs
- DataGridViewComboBoxCell.cs
- PropertyChangedEventArgs.cs
- EventLogStatus.cs
- FilePrompt.cs
- VisualTarget.cs
- ClickablePoint.cs
- Setter.cs
- DataErrorValidationRule.cs
- BidPrivateBase.cs
- InkPresenterAutomationPeer.cs
- TextClipboardData.cs
- BezierSegment.cs
- x509store.cs
- XmlLinkedNode.cs
- DbDataAdapter.cs
- FixedElement.cs
- ServiceAppDomainAssociationProvider.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- SpeechEvent.cs
- AccessorTable.cs
- DispatcherObject.cs
- MenuItemBindingCollection.cs
- ModelItemExtensions.cs
- ResourcePool.cs
- BindingSource.cs
- Matrix3D.cs
- BitmapEffectRenderDataResource.cs
- DefinitionBase.cs
- SecurityMessageProperty.cs
- Interop.cs
- DataGridViewAccessibleObject.cs
- RelatedPropertyManager.cs
- StreamResourceInfo.cs
- FocusWithinProperty.cs
- VectorAnimationBase.cs
- figurelengthconverter.cs
- GeneralTransform3DTo2DTo3D.cs