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
- AlphabeticalEnumConverter.cs
- ContextBase.cs
- StreamGeometry.cs
- Int32Storage.cs
- WebPartMovingEventArgs.cs
- ModelService.cs
- SchemaDeclBase.cs
- PenLineJoinValidation.cs
- ObjectMemberMapping.cs
- RegexCompiler.cs
- ApplicationHost.cs
- UserThread.cs
- WinFormsUtils.cs
- Interop.cs
- COM2ExtendedBrowsingHandler.cs
- NetStream.cs
- ConfigurationElementProperty.cs
- FrameworkTemplate.cs
- RealProxy.cs
- Keywords.cs
- ToolStripLocationCancelEventArgs.cs
- RuntimeResourceSet.cs
- SafeBitVector32.cs
- WorkflowDesignerColors.cs
- HuffCodec.cs
- Point4D.cs
- TextSelectionProcessor.cs
- MenuStrip.cs
- sqlinternaltransaction.cs
- XslAstAnalyzer.cs
- UnsafeNativeMethods.cs
- FaultContractAttribute.cs
- DownloadProgressEventArgs.cs
- DeclarationUpdate.cs
- CodeDirectoryCompiler.cs
- ReadOnlyCollectionBase.cs
- Opcode.cs
- InstanceDataCollection.cs
- DataGridState.cs
- StyleTypedPropertyAttribute.cs
- LabelEditEvent.cs
- HitTestFilterBehavior.cs
- BigInt.cs
- RequestBringIntoViewEventArgs.cs
- VoiceChangeEventArgs.cs
- ScriptHandlerFactory.cs
- SmiContextFactory.cs
- PathSegment.cs
- MsmqReceiveHelper.cs
- AssemblyResourceLoader.cs
- MsmqIntegrationBindingCollectionElement.cs
- bidPrivateBase.cs
- XmlDesigner.cs
- IDataContractSurrogate.cs
- HttpModulesSection.cs
- SqlMethodCallConverter.cs
- HttpContext.cs
- UserPersonalizationStateInfo.cs
- Geometry3D.cs
- Profiler.cs
- DataGridTextBox.cs
- FileInfo.cs
- PathNode.cs
- DockProviderWrapper.cs
- ReadOnlyHierarchicalDataSourceView.cs
- DataGridViewCheckBoxCell.cs
- SqlMultiplexer.cs
- DecoderNLS.cs
- InputScope.cs
- FileAuthorizationModule.cs
- Group.cs
- SqlCharStream.cs
- DataTableCollection.cs
- CodeAttributeDeclarationCollection.cs
- AxHost.cs
- CryptoConfig.cs
- ArrangedElementCollection.cs
- Set.cs
- RecordManager.cs
- ZoneLinkButton.cs
- LambdaCompiler.Lambda.cs
- ReturnEventArgs.cs
- SqlRowUpdatingEvent.cs
- PageAction.cs
- _NetRes.cs
- SoapAttributeAttribute.cs
- FieldToken.cs
- NumericUpDownAccelerationCollection.cs
- CodeAttributeArgument.cs
- RoleGroupCollection.cs
- WebUtil.cs
- ApplicationServiceManager.cs
- Dictionary.cs
- XmlNamespaceManager.cs
- FilterEventArgs.cs
- FixedLineResult.cs
- MonthChangedEventArgs.cs
- TextTreeExtractElementUndoUnit.cs
- ValidationSummary.cs
- EntityConnection.cs