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
- DataGrid.cs
- GridViewSortEventArgs.cs
- ProfileSection.cs
- CommandLibraryHelper.cs
- SerializationTrace.cs
- FunctionParameter.cs
- StyleSelector.cs
- SerialStream.cs
- BinaryMessageEncodingBindingElement.cs
- DefaultValueTypeConverter.cs
- Oid.cs
- TypeResolver.cs
- ClientRuntimeConfig.cs
- CompModSwitches.cs
- MetadataSource.cs
- TypeDescriptionProvider.cs
- IsolatedStorageFile.cs
- GenericNameHandler.cs
- LayeredChannelFactory.cs
- SecureEnvironment.cs
- OdbcParameter.cs
- ConfigurationLocationCollection.cs
- X500Name.cs
- SmtpTransport.cs
- FilterException.cs
- FactoryGenerator.cs
- HttpPostLocalhostServerProtocol.cs
- MergablePropertyAttribute.cs
- SafeLibraryHandle.cs
- InstancePersistence.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- XmlChildEnumerator.cs
- StyleSelector.cs
- SecurityException.cs
- HtmlControlDesigner.cs
- UxThemeWrapper.cs
- CircleHotSpot.cs
- securitycriticaldata.cs
- WS2007HttpBindingElement.cs
- ThicknessConverter.cs
- URL.cs
- InvalidContentTypeException.cs
- SiteMembershipCondition.cs
- SecurityTokenReferenceStyle.cs
- BamlReader.cs
- XmlNodeChangedEventManager.cs
- DBConnection.cs
- GlobalEventManager.cs
- HandleCollector.cs
- PageContentCollection.cs
- ParenthesizePropertyNameAttribute.cs
- SettingsProviderCollection.cs
- Automation.cs
- BamlStream.cs
- ArithmeticException.cs
- XXXOnTypeBuilderInstantiation.cs
- SamlAuthorizationDecisionClaimResource.cs
- CodeNamespace.cs
- SignatureToken.cs
- XmlDictionaryReaderQuotas.cs
- UserControl.cs
- FixedBufferAttribute.cs
- CodeChecksumPragma.cs
- SevenBitStream.cs
- XmlTextReaderImplHelpers.cs
- PropertyItem.cs
- ServiceNameElement.cs
- PromptEventArgs.cs
- TrustLevelCollection.cs
- Expression.cs
- MenuItemStyleCollectionEditor.cs
- DispatcherProcessingDisabled.cs
- remotingproxy.cs
- ReferencedCollectionType.cs
- FilterQueryOptionExpression.cs
- LinearGradientBrush.cs
- DBAsyncResult.cs
- oledbmetadatacolumnnames.cs
- SimpleWebHandlerParser.cs
- ServiceHostingEnvironment.cs
- AnchorEditor.cs
- HttpValueCollection.cs
- OutputScopeManager.cs
- SoapSchemaMember.cs
- ControlPropertyNameConverter.cs
- AudienceUriMode.cs
- URLMembershipCondition.cs
- WebEventCodes.cs
- SelectorAutomationPeer.cs
- PrincipalPermission.cs
- BrowserTree.cs
- Control.cs
- MatrixTransform.cs
- X509Certificate2.cs
- StorageBasedPackageProperties.cs
- HGlobalSafeHandle.cs
- NumericUpDownAcceleration.cs
- GridViewRow.cs
- _NtlmClient.cs
- Int16AnimationUsingKeyFrames.cs