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
- UserControlDesigner.cs
- CustomLineCap.cs
- ApplicationException.cs
- DictionaryCustomTypeDescriptor.cs
- EncoderNLS.cs
- DoubleIndependentAnimationStorage.cs
- BuilderPropertyEntry.cs
- CodeAccessPermission.cs
- KeySplineConverter.cs
- TextComposition.cs
- CompositionDesigner.cs
- TextProperties.cs
- IconConverter.cs
- DataRelationCollection.cs
- X509Certificate.cs
- StagingAreaInputItem.cs
- SafeArrayTypeMismatchException.cs
- ManagedFilter.cs
- AssemblySettingAttributes.cs
- OletxDependentTransaction.cs
- BezierSegment.cs
- ThemeInfoAttribute.cs
- DTCTransactionManager.cs
- RootProfilePropertySettingsCollection.cs
- NodeInfo.cs
- SoapAttributeAttribute.cs
- XmlArrayItemAttributes.cs
- TriggerBase.cs
- GetParentChain.cs
- ClientBuildManagerCallback.cs
- FormViewPageEventArgs.cs
- VectorCollectionValueSerializer.cs
- Debug.cs
- SafeHandles.cs
- UnsafeNativeMethods.cs
- RowCache.cs
- EncryptedReference.cs
- localization.cs
- GridViewColumnHeaderAutomationPeer.cs
- SessionState.cs
- ClusterRegistryConfigurationProvider.cs
- CalloutQueueItem.cs
- XmlSchemaSequence.cs
- LazyTextWriterCreator.cs
- PhysicalFontFamily.cs
- ChoiceConverter.cs
- PreviewPageInfo.cs
- FixedSOMElement.cs
- ExceptionWrapper.cs
- BindingExpression.cs
- ZipIOExtraFieldZip64Element.cs
- HandlerBase.cs
- VirtualDirectoryMappingCollection.cs
- SerializationStore.cs
- RegexParser.cs
- DeferredSelectedIndexReference.cs
- SQLInt16.cs
- PointF.cs
- AssemblyBuilder.cs
- MetadataSerializer.cs
- OpenFileDialog.cs
- DataGridBoundColumn.cs
- StaticExtension.cs
- InvokeSchedule.cs
- GestureRecognizer.cs
- FunctionDescription.cs
- DrawingServices.cs
- SafeViewOfFileHandle.cs
- FrameSecurityDescriptor.cs
- UrlMappingCollection.cs
- LoadedOrUnloadedOperation.cs
- WizardPanel.cs
- StorageMappingItemCollection.cs
- ValidationVisibilityAttribute.cs
- ConfigurationCollectionAttribute.cs
- ConfigurationConverterBase.cs
- SqlCacheDependencyDatabaseCollection.cs
- SelectionUIHandler.cs
- Overlapped.cs
- PropertyTabAttribute.cs
- WebDisplayNameAttribute.cs
- DecoderFallback.cs
- LifetimeServices.cs
- AmbientProperties.cs
- _ProxyRegBlob.cs
- SignatureHelper.cs
- FtpCachePolicyElement.cs
- EventTrigger.cs
- TemplateControlCodeDomTreeGenerator.cs
- SizeAnimationClockResource.cs
- ListViewTableRow.cs
- HostExecutionContextManager.cs
- HideDisabledControlAdapter.cs
- ItemCheckedEvent.cs
- RunInstallerAttribute.cs
- XmlResolver.cs
- TransportBindingElement.cs
- OleDbDataReader.cs
- DateTimeConverter2.cs
- latinshape.cs