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
- DifferencingCollection.cs
- CopyCodeAction.cs
- ParameterToken.cs
- Stackframe.cs
- FontFamilyConverter.cs
- DocumentPageView.cs
- TransformedBitmap.cs
- DesignerEditorPartChrome.cs
- DBPropSet.cs
- TextViewBase.cs
- JsonWriterDelegator.cs
- ListCommandEventArgs.cs
- IItemProperties.cs
- JsonQNameDataContract.cs
- Stylesheet.cs
- CodeDomExtensionMethods.cs
- HMACSHA1.cs
- HtmlWindowCollection.cs
- ValueProviderWrapper.cs
- manifestimages.cs
- PathFigureCollection.cs
- InternalSafeNativeMethods.cs
- ControlAdapter.cs
- ToolStripComboBox.cs
- UrlMappingCollection.cs
- RepeaterItemCollection.cs
- DesignSurfaceServiceContainer.cs
- NullReferenceException.cs
- ConfigXmlWhitespace.cs
- ControlTemplate.cs
- NamedPipeAppDomainProtocolHandler.cs
- DefaultValueConverter.cs
- EditingCommands.cs
- TrustSection.cs
- DynamicActivityXamlReader.cs
- CodeNamespaceImport.cs
- Vector3DValueSerializer.cs
- IpcPort.cs
- RegisteredHiddenField.cs
- XmlNodeList.cs
- _StreamFramer.cs
- XmlStringTable.cs
- ComboBoxItem.cs
- messageonlyhwndwrapper.cs
- SystemIPGlobalProperties.cs
- SqlProcedureAttribute.cs
- PropertyDescriptorCollection.cs
- UidManager.cs
- ContentType.cs
- SQLConvert.cs
- ByteAnimationBase.cs
- CodeGen.cs
- TextSelectionProcessor.cs
- ManagementPath.cs
- ReflectionServiceProvider.cs
- DynamicDataRoute.cs
- ThreadStateException.cs
- ToolStripDropDownClosedEventArgs.cs
- FormViewPageEventArgs.cs
- TextRunTypographyProperties.cs
- PageAction.cs
- Parser.cs
- PortCache.cs
- ScriptResourceInfo.cs
- SoapSchemaImporter.cs
- TreeNodeClickEventArgs.cs
- SqlServices.cs
- SchemaCollectionCompiler.cs
- PeerTransportBindingElement.cs
- DesignerPerfEventProvider.cs
- UrlAuthFailedErrorFormatter.cs
- EventWaitHandleSecurity.cs
- XmlToDatasetMap.cs
- ExpressionBuilderContext.cs
- WebPartDisplayMode.cs
- PointAnimationBase.cs
- TabRenderer.cs
- FolderNameEditor.cs
- TraceEventCache.cs
- GridViewPageEventArgs.cs
- MapPathBasedVirtualPathProvider.cs
- GenericAuthenticationEventArgs.cs
- Logging.cs
- SecurityException.cs
- SqlDataSourceCommandEventArgs.cs
- VisualStyleTypesAndProperties.cs
- RecipientInfo.cs
- GridViewColumnHeaderAutomationPeer.cs
- MetadataItemSerializer.cs
- CodeThrowExceptionStatement.cs
- XmlAttributeHolder.cs
- ObjectToIdCache.cs
- AsyncStreamReader.cs
- PathFigure.cs
- IntranetCredentialPolicy.cs
- TagPrefixCollection.cs
- SqlDataSourceSelectingEventArgs.cs
- X509Certificate.cs
- LayoutDump.cs
- _NativeSSPI.cs