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
- ShowExpandedMultiValueConverter.cs
- LinkConverter.cs
- SafeCryptHandles.cs
- PrintControllerWithStatusDialog.cs
- HtmlTableRow.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- CustomErrorCollection.cs
- _Win32.cs
- ErrorFormatterPage.cs
- CryptoStream.cs
- DescendantQuery.cs
- ExtensionDataReader.cs
- ClientUtils.cs
- CustomAssemblyResolver.cs
- RuleConditionDialog.Designer.cs
- XmlSchemaObjectTable.cs
- AuthenticationConfig.cs
- OutputCacheProfileCollection.cs
- OperationResponse.cs
- EnumBuilder.cs
- RegistryDataKey.cs
- ObjectDataSourceStatusEventArgs.cs
- Choices.cs
- FileIOPermission.cs
- DecoderBestFitFallback.cs
- IndentTextWriter.cs
- EmptyStringExpandableObjectConverter.cs
- PopupControlService.cs
- ScrollItemPattern.cs
- DataReceivedEventArgs.cs
- DependentList.cs
- DetailsViewUpdateEventArgs.cs
- ApplicationTrust.cs
- SqlBinder.cs
- DataBindingList.cs
- DataGridViewCellMouseEventArgs.cs
- Attributes.cs
- RegionIterator.cs
- PrintDialogDesigner.cs
- HelloOperationAsyncResult.cs
- XmlUrlResolver.cs
- NonDualMessageSecurityOverHttpElement.cs
- DetailsViewUpdatedEventArgs.cs
- SourceLineInfo.cs
- LineSegment.cs
- ChangeDirector.cs
- AssemblyNameProxy.cs
- EventMetadata.cs
- XPathChildIterator.cs
- XmlSchemaSet.cs
- SimpleTypeResolver.cs
- GeometryGroup.cs
- CodeAccessPermission.cs
- HandleRef.cs
- OledbConnectionStringbuilder.cs
- ByeMessageApril2005.cs
- ClassDataContract.cs
- DoubleKeyFrameCollection.cs
- NameValuePermission.cs
- _HelperAsyncResults.cs
- StickyNote.cs
- AssociationTypeEmitter.cs
- DataGridViewImageColumn.cs
- XmlSchemaAll.cs
- M3DUtil.cs
- DataTableMappingCollection.cs
- MiniAssembly.cs
- DocumentEventArgs.cs
- InternalPolicyElement.cs
- ObjectAssociationEndMapping.cs
- DbParameterCollectionHelper.cs
- TextLineResult.cs
- GenericXmlSecurityToken.cs
- SelectorItemAutomationPeer.cs
- ComponentSerializationService.cs
- XsltSettings.cs
- CapabilitiesPattern.cs
- TypeLoadException.cs
- InternalReceiveMessage.cs
- ObjectDataSourceStatusEventArgs.cs
- ReferencedCollectionType.cs
- ResourcePermissionBase.cs
- ConstraintConverter.cs
- EntitySqlQueryCacheKey.cs
- CombinedGeometry.cs
- TransformPatternIdentifiers.cs
- DelegateBodyWriter.cs
- FixedPosition.cs
- XmlValidatingReaderImpl.cs
- CodeStatementCollection.cs
- BindingExpression.cs
- TypeConstant.cs
- ControllableStoryboardAction.cs
- DecoderFallbackWithFailureFlag.cs
- MimePart.cs
- PropertiesTab.cs
- BypassElement.cs
- EffectiveValueEntry.cs
- GridViewSortEventArgs.cs
- SourceFilter.cs