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
- FontFamilyValueSerializer.cs
- DataGridViewRowHeaderCell.cs
- UntrustedRecipientException.cs
- HttpCacheVaryByContentEncodings.cs
- FontInfo.cs
- GAC.cs
- Visual3D.cs
- DecoratedNameAttribute.cs
- TextRangeAdaptor.cs
- FirewallWrapper.cs
- ComboBoxItem.cs
- ReservationCollection.cs
- DateRangeEvent.cs
- JavascriptCallbackBehaviorAttribute.cs
- FixedPage.cs
- ContentPlaceHolder.cs
- WaitForChangedResult.cs
- PartialCachingControl.cs
- Size.cs
- SimpleHandlerBuildProvider.cs
- SQLString.cs
- DynamicArgumentDialog.cs
- HorizontalAlignConverter.cs
- KeyInterop.cs
- METAHEADER.cs
- PersonalizablePropertyEntry.cs
- ContextProperty.cs
- FixedSOMFixedBlock.cs
- SiteMapHierarchicalDataSourceView.cs
- ManagementDateTime.cs
- SchemaAttDef.cs
- processwaithandle.cs
- ISAPIWorkerRequest.cs
- UnsafeNativeMethodsMilCoreApi.cs
- TCPListener.cs
- TypeUtils.cs
- TrackBarDesigner.cs
- TdsParserHelperClasses.cs
- PageStatePersister.cs
- InfocardInteractiveChannelInitializer.cs
- FeatureSupport.cs
- CheckedPointers.cs
- ApplicationManager.cs
- XamlToRtfParser.cs
- Message.cs
- DockPattern.cs
- TextBlock.cs
- Semaphore.cs
- StrokeCollectionDefaultValueFactory.cs
- SHA512Managed.cs
- XsdCachingReader.cs
- ClassValidator.cs
- XomlCompilerHelpers.cs
- WSHttpBindingBase.cs
- IDataContractSurrogate.cs
- AbstractDataSvcMapFileLoader.cs
- DataGridViewColumnTypePicker.cs
- ScriptRegistrationManager.cs
- EventWaitHandleSecurity.cs
- GridViewRowPresenterBase.cs
- ToolStripSettings.cs
- ModulesEntry.cs
- SHA512Managed.cs
- XsdSchemaFileEditor.cs
- XmlMembersMapping.cs
- CookieHandler.cs
- GeometryModel3D.cs
- CodeVariableDeclarationStatement.cs
- PathFigure.cs
- ContractInferenceHelper.cs
- BooleanFunctions.cs
- DefaultConfirmation.cs
- XamlVector3DCollectionSerializer.cs
- DialogResultConverter.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DescendentsWalker.cs
- EntityDataSourceChangedEventArgs.cs
- UpdatePanelControlTrigger.cs
- COM2ExtendedUITypeEditor.cs
- RootAction.cs
- ListViewItem.cs
- MulticastNotSupportedException.cs
- ToolStripScrollButton.cs
- DesignerCapabilities.cs
- RuntimeArgumentHandle.cs
- MappingModelBuildProvider.cs
- SoundPlayerAction.cs
- BaseTemplateParser.cs
- MouseButtonEventArgs.cs
- CreateUserWizard.cs
- TextRange.cs
- MeasureData.cs
- ResourceProviderFactory.cs
- ProfileInfo.cs
- StrokeDescriptor.cs
- BaseTemplateCodeDomTreeGenerator.cs
- IncomingWebResponseContext.cs
- Transform3D.cs
- EntityViewContainer.cs
- CallbackValidator.cs