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
- BitmapData.cs
- DriveInfo.cs
- DomainLiteralReader.cs
- TextServicesDisplayAttribute.cs
- CommonObjectSecurity.cs
- RijndaelManaged.cs
- ImageList.cs
- DynamicILGenerator.cs
- NamedPermissionSet.cs
- Internal.cs
- ChineseLunisolarCalendar.cs
- ScrollBarAutomationPeer.cs
- HttpPostedFile.cs
- SoapIgnoreAttribute.cs
- FrameAutomationPeer.cs
- GridViewPageEventArgs.cs
- FrugalList.cs
- CommonRemoteMemoryBlock.cs
- SendContent.cs
- unitconverter.cs
- DataGridHeaderBorder.cs
- RegexBoyerMoore.cs
- DataGrid.cs
- ProfileGroupSettings.cs
- SystemMulticastIPAddressInformation.cs
- ComponentDispatcherThread.cs
- SBCSCodePageEncoding.cs
- HttpContext.cs
- ComponentResourceManager.cs
- SubordinateTransaction.cs
- DataReceivedEventArgs.cs
- PersonalizableAttribute.cs
- InheritanceContextChangedEventManager.cs
- DateTimePicker.cs
- ValidatorCollection.cs
- TextTreeNode.cs
- IPGlobalProperties.cs
- ListMarkerSourceInfo.cs
- TextBoxLine.cs
- EditorPart.cs
- PersonalizationStateInfoCollection.cs
- IPipelineRuntime.cs
- ListBox.cs
- UnknownBitmapDecoder.cs
- TransactionalPackage.cs
- MarshalDirectiveException.cs
- ObfuscateAssemblyAttribute.cs
- NodeFunctions.cs
- NetworkStream.cs
- HttpCapabilitiesBase.cs
- WSHttpSecurityElement.cs
- ScriptIgnoreAttribute.cs
- DbParameterHelper.cs
- BindingExpressionBase.cs
- OpenFileDialog.cs
- QueryOutputWriter.cs
- RSAProtectedConfigurationProvider.cs
- XmlFormatExtensionPointAttribute.cs
- DependencyObject.cs
- RuleSetDialog.cs
- ConnectionsZone.cs
- ShapingWorkspace.cs
- ValidationSummaryDesigner.cs
- DataControlFieldCollection.cs
- FixedSOMContainer.cs
- Substitution.cs
- StickyNoteAnnotations.cs
- ListViewDeleteEventArgs.cs
- Encoder.cs
- Color.cs
- ThaiBuddhistCalendar.cs
- UInt16Storage.cs
- UseManagedPresentationBindingElement.cs
- SuppressMessageAttribute.cs
- ConsoleEntryPoint.cs
- WorkflowRuntimeServiceElementCollection.cs
- InputReport.cs
- SafeFileMapViewHandle.cs
- WebBrowserUriTypeConverter.cs
- XmlMessageFormatter.cs
- HtmlContainerControl.cs
- Membership.cs
- ShaderEffect.cs
- QilInvokeEarlyBound.cs
- OperationResponse.cs
- LinkUtilities.cs
- CodeTypeOfExpression.cs
- SafeEventLogWriteHandle.cs
- XPathNavigatorReader.cs
- ListViewInsertedEventArgs.cs
- ObjectDisposedException.cs
- VirtualDirectoryMapping.cs
- XmlName.cs
- XmlSchemaDatatype.cs
- BoundingRectTracker.cs
- CalendarDateRange.cs
- SecurityUniqueId.cs
- ContextMenuService.cs
- FormsAuthenticationUserCollection.cs
- DataGridLinkButton.cs