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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataTableNewRowEvent.cs
- HtmlTableCell.cs
- DefaultValueTypeConverter.cs
- SkipQueryOptionExpression.cs
- BinaryObjectReader.cs
- XmlCharacterData.cs
- TypeGeneratedEventArgs.cs
- InvokePattern.cs
- ReaderWriterLockSlim.cs
- ButtonRenderer.cs
- Thickness.cs
- Processor.cs
- SrgsItemList.cs
- WebPartZone.cs
- Rule.cs
- ObjectAnimationBase.cs
- TagMapInfo.cs
- ValidationEventArgs.cs
- SplayTreeNode.cs
- AnnotationResourceChangedEventArgs.cs
- EntityContainerEmitter.cs
- VectorAnimationUsingKeyFrames.cs
- InkPresenter.cs
- UncommonField.cs
- Graphics.cs
- SystemIdentity.cs
- IISUnsafeMethods.cs
- DataGridViewColumnConverter.cs
- XmlTextReaderImpl.cs
- Int32Collection.cs
- HttpBufferlessInputStream.cs
- HostUtils.cs
- FormsAuthenticationTicket.cs
- TreeView.cs
- TextEffectCollection.cs
- TableAdapterManagerGenerator.cs
- BitmapMetadataEnumerator.cs
- ColumnResizeAdorner.cs
- columnmapkeybuilder.cs
- XmlSerializationGeneratedCode.cs
- ItemContainerPattern.cs
- EntityDataSourceStatementEditorForm.cs
- XmlSerializer.cs
- SafeRightsManagementPubHandle.cs
- DynamicValueConverter.cs
- IgnoreDataMemberAttribute.cs
- CLRBindingWorker.cs
- StorageScalarPropertyMapping.cs
- TypeUsageBuilder.cs
- BitmapMetadataBlob.cs
- TCPListener.cs
- XmlElementList.cs
- MemberAssignment.cs
- UserControlCodeDomTreeGenerator.cs
- SafeLibraryHandle.cs
- ValidationHelpers.cs
- AmbientProperties.cs
- OwnerDrawPropertyBag.cs
- ObjectSecurity.cs
- WindowsListViewItemCheckBox.cs
- TrustLevelCollection.cs
- XmlNamedNodeMap.cs
- DesignerCommandSet.cs
- ObjectDataProvider.cs
- DetailsViewPageEventArgs.cs
- SQLMoneyStorage.cs
- SlipBehavior.cs
- XMLSchema.cs
- FixedHyperLink.cs
- ModelPerspective.cs
- _SecureChannel.cs
- AnnotationAuthorChangedEventArgs.cs
- ExpressionCopier.cs
- TemplateNodeContextMenu.cs
- MasterPageBuildProvider.cs
- SerializeAbsoluteContext.cs
- PointAnimationBase.cs
- KeyNameIdentifierClause.cs
- WhitespaceRule.cs
- COM2PropertyDescriptor.cs
- StrokeSerializer.cs
- MetabaseServerConfig.cs
- WizardSideBarListControlItem.cs
- StrongNameMembershipCondition.cs
- UnitySerializationHolder.cs
- TabItemWrapperAutomationPeer.cs
- CustomPopupPlacement.cs
- ObfuscateAssemblyAttribute.cs
- AttributeCollection.cs
- BamlResourceContent.cs
- ClientBuildManager.cs
- TableRowCollection.cs
- XmlNodeList.cs
- PathData.cs
- Set.cs
- ImageInfo.cs
- ListViewCancelEventArgs.cs
- InheritedPropertyChangedEventArgs.cs
- TokenFactoryFactory.cs
- DragDropHelper.cs