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
- ZipFileInfoCollection.cs
- TemplatePartAttribute.cs
- MembershipUser.cs
- DynamicField.cs
- EntityWithKeyStrategy.cs
- COM2PropertyPageUITypeConverter.cs
- IEnumerable.cs
- CacheEntry.cs
- ListCollectionView.cs
- ExceptionRoutedEventArgs.cs
- SuppressIldasmAttribute.cs
- Container.cs
- AutoSizeToolBoxItem.cs
- UrlMappingCollection.cs
- HelloOperationAsyncResult.cs
- PageThemeParser.cs
- ChildTable.cs
- RuntimeWrappedException.cs
- Set.cs
- NativeMethods.cs
- WebPartTransformer.cs
- TrackBarRenderer.cs
- SafeProcessHandle.cs
- COM2ExtendedTypeConverter.cs
- Animatable.cs
- TimeSpanMinutesConverter.cs
- ReferenceService.cs
- _UriSyntax.cs
- CachedFontFamily.cs
- ComplexTypeEmitter.cs
- PerformanceCounterTraceRecord.cs
- BufferedGraphics.cs
- HttpCapabilitiesEvaluator.cs
- ConfigurationElement.cs
- ViewValidator.cs
- DataGridColumnHeaderCollection.cs
- XmlNodeReader.cs
- Exception.cs
- Int16Converter.cs
- Request.cs
- ConfigurationLocation.cs
- PrimaryKeyTypeConverter.cs
- DataIdProcessor.cs
- FrameworkElementFactoryMarkupObject.cs
- CodeObject.cs
- QilName.cs
- RegexWorker.cs
- ToolboxComponentsCreatedEventArgs.cs
- Msec.cs
- OdbcStatementHandle.cs
- ItemChangedEventArgs.cs
- ZipIOFileItemStream.cs
- DbProviderFactoriesConfigurationHandler.cs
- FixedTextSelectionProcessor.cs
- Converter.cs
- SocketException.cs
- SoapExtensionTypeElementCollection.cs
- DbConnectionStringBuilder.cs
- BamlTreeMap.cs
- ServiceModelConfigurationElementCollection.cs
- ClientBuildManagerCallback.cs
- TransactionTraceIdentifier.cs
- SourceFileBuildProvider.cs
- DataListItem.cs
- CompilerState.cs
- TextEditorThreadLocalStore.cs
- ClonableStack.cs
- TrackingMemoryStreamFactory.cs
- ClientSession.cs
- MsmqIntegrationChannelListener.cs
- ButtonAutomationPeer.cs
- DataServiceHostFactory.cs
- IPipelineRuntime.cs
- ThreadExceptionEvent.cs
- SerialErrors.cs
- CheckoutException.cs
- RootAction.cs
- DateTimeUtil.cs
- UnicastIPAddressInformationCollection.cs
- CacheEntry.cs
- WhitespaceSignificantCollectionAttribute.cs
- SqlLiftWhereClauses.cs
- AttachedAnnotation.cs
- CommandLibraryHelper.cs
- BamlRecords.cs
- EventMappingSettings.cs
- UserControlParser.cs
- Duration.cs
- hwndwrapper.cs
- BeginStoryboard.cs
- ScriptServiceAttribute.cs
- IisHelper.cs
- DataTableClearEvent.cs
- ClientOptions.cs
- SqlXml.cs
- StringUtil.cs
- HttpWrapper.cs
- AssemblyName.cs
- SortedDictionary.cs
- SessionPageStateSection.cs