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
- EntityDataSourceContextDisposingEventArgs.cs
- TextTreeText.cs
- PeerPresenceInfo.cs
- InputProcessorProfilesLoader.cs
- AdapterSwitches.cs
- MessageSmuggler.cs
- SafeIUnknown.cs
- DataGridViewCellCollection.cs
- AuthenticationConfig.cs
- BlockCollection.cs
- FixedFlowMap.cs
- OlePropertyStructs.cs
- ValidatedMobileControlConverter.cs
- ObjectManager.cs
- LocalizableAttribute.cs
- CompositeActivityTypeDescriptorProvider.cs
- UserPersonalizationStateInfo.cs
- ErasingStroke.cs
- ConsoleKeyInfo.cs
- RelationshipWrapper.cs
- GridPatternIdentifiers.cs
- Imaging.cs
- PrivateFontCollection.cs
- AspNetHostingPermission.cs
- ErrorProvider.cs
- NameValueConfigurationCollection.cs
- NativeRightsManagementAPIsStructures.cs
- XmlSchema.cs
- XmlCountingReader.cs
- ConfigurationPropertyCollection.cs
- PermissionListSet.cs
- MessagingActivityHelper.cs
- SelectionEditor.cs
- RadioButton.cs
- XPathAncestorIterator.cs
- COM2ComponentEditor.cs
- Compensate.cs
- DbRetry.cs
- HttpStreamMessageEncoderFactory.cs
- CodeSubDirectory.cs
- QilInvokeLateBound.cs
- StrokeNodeEnumerator.cs
- ProjectionPath.cs
- PrintEvent.cs
- AssemblyHash.cs
- PropertyReferenceSerializer.cs
- TemplateBindingExpressionConverter.cs
- SEHException.cs
- ObjectStorage.cs
- ADMembershipUser.cs
- ReliabilityContractAttribute.cs
- LingerOption.cs
- AbstractSvcMapFileLoader.cs
- DispatchChannelSink.cs
- MergablePropertyAttribute.cs
- ReaderOutput.cs
- XmlDataSourceView.cs
- LeafCellTreeNode.cs
- ProofTokenCryptoHandle.cs
- MiniAssembly.cs
- EntityDataSourceStatementEditor.cs
- Metadata.cs
- RawAppCommandInputReport.cs
- TemplateBindingExtension.cs
- StatusBarAutomationPeer.cs
- ObservableCollectionDefaultValueFactory.cs
- ObjectItemLoadingSessionData.cs
- SmtpAuthenticationManager.cs
- MergeFailedEvent.cs
- ZipIOExtraFieldZip64Element.cs
- QueryUtil.cs
- LabelDesigner.cs
- WindowProviderWrapper.cs
- RepeaterItem.cs
- SafeHandles.cs
- PropagationProtocolsTracing.cs
- FormView.cs
- SignedXml.cs
- EmptyStringExpandableObjectConverter.cs
- MsmqIntegrationSecurityElement.cs
- MsmqIntegrationReceiveParameters.cs
- SafeFileMappingHandle.cs
- SecurityContext.cs
- WebPartDisplayMode.cs
- Lease.cs
- BidirectionalDictionary.cs
- ScriptResourceHandler.cs
- IntranetCredentialPolicy.cs
- SafeIUnknown.cs
- WebControl.cs
- IdentifierService.cs
- DefaultValueAttribute.cs
- ProtocolsConfigurationEntry.cs
- ApplicationActivator.cs
- ObjectNotFoundException.cs
- CompositeCollectionView.cs
- Border.cs
- ToolStripItemRenderEventArgs.cs
- NameNode.cs
- InvalidEnumArgumentException.cs