Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / Tokens / WindowsSidIdentity.cs / 1 / WindowsSidIdentity.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security.Tokens { using System.IdentityModel.Claims; using System.ServiceModel; using System.IdentityModel.Policy; using System.Security.Principal; class WindowsSidIdentity : IIdentity { SecurityIdentifier sid; string name; string authenticationType; public WindowsSidIdentity(SecurityIdentifier sid) { if (sid == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("sid"); this.sid = sid; this.authenticationType = String.Empty; } public WindowsSidIdentity(SecurityIdentifier sid, string name, string authenticationType) { if (sid == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("sid"); if (name == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("name"); if (authenticationType == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("authenticationType"); this.sid = sid; this.name = name; this.authenticationType = authenticationType; } public SecurityIdentifier SecurityIdentifier { get { return this.sid; } } public string AuthenticationType { get { return this.authenticationType; } } public bool IsAuthenticated { get { return true; } } public string Name { get { if (this.name == null) this.name = ((NTAccount)this.sid.Translate(typeof(NTAccount))).Value; return this.name; } } public override bool Equals(object obj) { if (ReferenceEquals(this, obj)) return true; WindowsSidIdentity sidIdentity = obj as WindowsSidIdentity; if (sidIdentity == null) return false; return this.sid == sidIdentity.SecurityIdentifier; } public override int GetHashCode() { return this.sid.GetHashCode(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AlphaSortedEnumConverter.cs
- ProfilePropertyNameValidator.cs
- AutomationIdentifierGuids.cs
- DesignerCommandSet.cs
- SafeIUnknown.cs
- NumericExpr.cs
- ComponentDispatcher.cs
- Context.cs
- Inline.cs
- EntityTypeBase.cs
- Int64Animation.cs
- ExecutionContext.cs
- BypassElement.cs
- LocationSectionRecord.cs
- CodeBlockBuilder.cs
- TrackingDataItemValue.cs
- WebControlParameterProxy.cs
- SystemIPGlobalStatistics.cs
- _UriTypeConverter.cs
- HtmlContainerControl.cs
- FontStyleConverter.cs
- WebBrowserNavigatedEventHandler.cs
- LogicalTreeHelper.cs
- ResponseStream.cs
- CipherData.cs
- UTF32Encoding.cs
- TargetInvocationException.cs
- XmlSchemaSubstitutionGroup.cs
- HostedHttpRequestAsyncResult.cs
- UnmanagedMemoryStreamWrapper.cs
- DrawingGroupDrawingContext.cs
- GlyphShapingProperties.cs
- TextEditor.cs
- VarRemapper.cs
- SyndicationSerializer.cs
- MaterialGroup.cs
- DataGridViewUtilities.cs
- DetailsViewRow.cs
- VectorValueSerializer.cs
- xml.cs
- Pair.cs
- DataGridCellAutomationPeer.cs
- FontNamesConverter.cs
- DefaultAsyncDataDispatcher.cs
- VScrollProperties.cs
- SqlResolver.cs
- XPathNavigatorReader.cs
- RichTextBoxAutomationPeer.cs
- NetTcpSectionData.cs
- DoubleAnimationClockResource.cs
- QueryResponse.cs
- FrameworkElement.cs
- WmlMobileTextWriter.cs
- StylusPointCollection.cs
- RadioButtonList.cs
- KeyFrames.cs
- OutputBuffer.cs
- SafeLocalAllocation.cs
- WebPartCloseVerb.cs
- _AutoWebProxyScriptEngine.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- ArrangedElementCollection.cs
- XmlDataDocument.cs
- VariableAction.cs
- ToolStripSystemRenderer.cs
- CodeArgumentReferenceExpression.cs
- ListItemViewAttribute.cs
- Rotation3D.cs
- _IPv6Address.cs
- EditorPartCollection.cs
- RangeValidator.cs
- ManagementObject.cs
- StylusButtonEventArgs.cs
- XmlSchemaObjectTable.cs
- MailBnfHelper.cs
- ClientApiGenerator.cs
- Group.cs
- TrustManager.cs
- List.cs
- TransformDescriptor.cs
- SizeChangedEventArgs.cs
- TextTrailingCharacterEllipsis.cs
- CodeAttributeDeclaration.cs
- WebPartExportVerb.cs
- FormConverter.cs
- NavigationPropertyEmitter.cs
- PopupRootAutomationPeer.cs
- ErrorStyle.cs
- _Events.cs
- SpeechDetectedEventArgs.cs
- RemotingServices.cs
- UpdateExpressionVisitor.cs
- XmlValueConverter.cs
- KeyEventArgs.cs
- GroupPartitionExpr.cs
- DefaultParameterValueAttribute.cs
- Drawing.cs
- NetTcpSection.cs
- InOutArgument.cs
- InputLanguage.cs