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
- TimeoutValidationAttribute.cs
- FontWeightConverter.cs
- Lease.cs
- WasHttpModulesInstallComponent.cs
- HtmlLinkAdapter.cs
- TableParagraph.cs
- GridViewEditEventArgs.cs
- TreeViewHitTestInfo.cs
- HitTestWithGeometryDrawingContextWalker.cs
- FrameworkElementAutomationPeer.cs
- FunctionQuery.cs
- HtmlForm.cs
- BufferModesCollection.cs
- NamespaceList.cs
- XslAst.cs
- DeviceContext.cs
- DiagnosticStrings.cs
- XsdDateTime.cs
- WindowsClientCredential.cs
- ReferenceEqualityComparer.cs
- PropertyNames.cs
- SslStream.cs
- InvalidProgramException.cs
- PackageDigitalSignature.cs
- TextEditorDragDrop.cs
- AddToCollection.cs
- SamlAction.cs
- AdvancedBindingPropertyDescriptor.cs
- WorkflowNamespace.cs
- Pts.cs
- ScrollChrome.cs
- ObjectParameterCollection.cs
- KnownBoxes.cs
- DataRowExtensions.cs
- UserControl.cs
- ListViewEditEventArgs.cs
- OrthographicCamera.cs
- DeleteWorkflowOwnerCommand.cs
- oledbmetadatacollectionnames.cs
- formatter.cs
- DynamicPropertyHolder.cs
- DataGridViewComboBoxColumnDesigner.cs
- ObjectRef.cs
- TraceRecord.cs
- TaiwanLunisolarCalendar.cs
- Selection.cs
- FileUtil.cs
- TdsValueSetter.cs
- TextDecoration.cs
- DataShape.cs
- SessionParameter.cs
- CrossContextChannel.cs
- HtmlSelectionListAdapter.cs
- MergePropertyDescriptor.cs
- CellParagraph.cs
- BitArray.cs
- UpdatePanelTriggerCollection.cs
- ScriptDescriptor.cs
- TreeNodeEventArgs.cs
- NCryptSafeHandles.cs
- EntityTransaction.cs
- PropertyIdentifier.cs
- util.cs
- Authorization.cs
- UriParserTemplates.cs
- WindowsFormsLinkLabel.cs
- RootBrowserWindowAutomationPeer.cs
- ClientSponsor.cs
- GridEntryCollection.cs
- MenuCommandsChangedEventArgs.cs
- DiscriminatorMap.cs
- WebPartConnectionsCloseVerb.cs
- CallbackDebugBehavior.cs
- FeatureSupport.cs
- CapabilitiesUse.cs
- MemoryRecordBuffer.cs
- SortKey.cs
- SessionStateSection.cs
- UnsafeNativeMethods.cs
- FixedDocumentSequencePaginator.cs
- AnnotationAuthorChangedEventArgs.cs
- ProvidersHelper.cs
- FutureFactory.cs
- MetafileHeader.cs
- PtsCache.cs
- ReadOnlyMetadataCollection.cs
- HashCryptoHandle.cs
- CompiledScopeCriteria.cs
- DataGridViewCellFormattingEventArgs.cs
- LogLogRecord.cs
- WebEncodingValidatorAttribute.cs
- TypefaceMap.cs
- DataGridColumnHeaderAutomationPeer.cs
- EntityKey.cs
- TextDecorationLocationValidation.cs
- DoubleKeyFrameCollection.cs
- WebBaseEventKeyComparer.cs
- TextPattern.cs
- IxmlLineInfo.cs
- Stacktrace.cs