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
- LostFocusEventManager.cs
- ControlValuePropertyAttribute.cs
- ObjectIDGenerator.cs
- SqlParameterizer.cs
- ModifierKeysConverter.cs
- MdImport.cs
- Trigger.cs
- Site.cs
- MethodToken.cs
- OutputCacheModule.cs
- CompoundFileIOPermission.cs
- SchemaAttDef.cs
- WebPartEditorApplyVerb.cs
- WeakReadOnlyCollection.cs
- ResourcesBuildProvider.cs
- WeakRefEnumerator.cs
- WebServiceMethodData.cs
- ContentHostHelper.cs
- IndentTextWriter.cs
- SequenceDesigner.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- DataPointer.cs
- InfoCardSymmetricAlgorithm.cs
- UnaryNode.cs
- Encoding.cs
- ProviderException.cs
- DateTimeOffset.cs
- TransactionChannelFaultConverter.cs
- ForwardPositionQuery.cs
- CommandDevice.cs
- UnmanagedMarshal.cs
- Bookmark.cs
- SoapIncludeAttribute.cs
- SynchronizedInputPattern.cs
- OLEDB_Util.cs
- StringUtil.cs
- SqlFacetAttribute.cs
- AppSecurityManager.cs
- DataMember.cs
- ThreadExceptionEvent.cs
- ToolStripKeyboardHandlingService.cs
- AttributeQuery.cs
- ToolboxItemSnapLineBehavior.cs
- EventItfInfo.cs
- RemotingConfiguration.cs
- ThreadPool.cs
- MemberDescriptor.cs
- XsltLoader.cs
- Util.cs
- RecognizerStateChangedEventArgs.cs
- EmptyEnumerable.cs
- TableParaClient.cs
- CustomPopupPlacement.cs
- TabletCollection.cs
- HtmlInputText.cs
- FormParameter.cs
- RequestCachePolicy.cs
- RepeaterDataBoundAdapter.cs
- GeneralTransform2DTo3D.cs
- AssemblyBuilderData.cs
- InternalMappingException.cs
- ModelTreeEnumerator.cs
- NullableBoolConverter.cs
- AbstractSvcMapFileLoader.cs
- RulePatternOps.cs
- XmlMapping.cs
- HtmlInputFile.cs
- DeferredTextReference.cs
- ClipboardProcessor.cs
- SizeAnimationClockResource.cs
- PropertyRef.cs
- EmptyCollection.cs
- ClientOptions.cs
- X509Certificate.cs
- BaseProcessor.cs
- OracleEncoding.cs
- TextDpi.cs
- XmlWrappingReader.cs
- QueryExtender.cs
- XmlEnumAttribute.cs
- XpsFilter.cs
- ReflectPropertyDescriptor.cs
- ThreadAttributes.cs
- NotSupportedException.cs
- DataObjectEventArgs.cs
- ExceptionUtil.cs
- XmlSerializerImportOptions.cs
- AttributeQuery.cs
- XhtmlTextWriter.cs
- ExceptionUtil.cs
- LineUtil.cs
- ToolStripMenuItem.cs
- HtmlInputCheckBox.cs
- LineServices.cs
- TemplateControlCodeDomTreeGenerator.cs
- MethodToken.cs
- IsolatedStoragePermission.cs
- PenThread.cs
- ObjectResult.cs
- ImageConverter.cs