Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / X509WindowsSecurityToken.cs / 1305376 / X509WindowsSecurityToken.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.IdentityModel.Tokens
{
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
public class X509WindowsSecurityToken : X509SecurityToken
{
WindowsIdentity windowsIdentity;
bool disposed = false;
string authenticationType;
public X509WindowsSecurityToken(X509Certificate2 certificate, WindowsIdentity windowsIdentity)
: this(certificate, windowsIdentity, null, true)
{
}
public X509WindowsSecurityToken(X509Certificate2 certificate, WindowsIdentity windowsIdentity, string id)
: this(certificate, windowsIdentity, null, id, true)
{
}
public X509WindowsSecurityToken(X509Certificate2 certificate, WindowsIdentity windowsIdentity, string authenticationType, string id)
: this( certificate, windowsIdentity, authenticationType, id, true )
{
}
internal X509WindowsSecurityToken(X509Certificate2 certificate, WindowsIdentity windowsIdentity, string authenticationType, bool clone)
: this( certificate, windowsIdentity, authenticationType, SecurityUniqueId.Create().Value, clone )
{
}
internal X509WindowsSecurityToken(X509Certificate2 certificate, WindowsIdentity windowsIdentity, string authenticationType, string id, bool clone)
: base(certificate, id, clone)
{
if (windowsIdentity == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("windowsIdentity");
this.authenticationType = authenticationType;
this.windowsIdentity = clone ? SecurityUtils.CloneWindowsIdentityIfNecessary(windowsIdentity, authenticationType) : windowsIdentity;
}
public WindowsIdentity WindowsIdentity
{
get
{
ThrowIfDisposed();
return this.windowsIdentity;
}
}
public string AuthenticationType
{
get
{
return this.authenticationType;
}
}
public override void Dispose()
{
try
{
if (!this.disposed)
{
this.disposed = true;
this.windowsIdentity.Dispose();
}
}
finally
{
base.Dispose();
}
}
}
}
// 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
- OperatingSystem.cs
- XmlSchemaSubstitutionGroup.cs
- XmlSchemaValidationException.cs
- TemplatePagerField.cs
- CancellationHandler.cs
- ShaderRenderModeValidation.cs
- CodeIterationStatement.cs
- PeerInvitationResponse.cs
- PropertyItemInternal.cs
- MultiTrigger.cs
- AssemblyAssociatedContentFileAttribute.cs
- StateValidator.cs
- WSSecurityPolicy.cs
- FlowDocumentFormatter.cs
- XamlPathDataSerializer.cs
- XmlILTrace.cs
- PathFigureCollection.cs
- SafeNativeMethods.cs
- MultiDataTrigger.cs
- HtmlInputCheckBox.cs
- BitStream.cs
- ModelUIElement3D.cs
- PolicyValidationException.cs
- ErrorFormatter.cs
- ListMarkerLine.cs
- MobileSysDescriptionAttribute.cs
- DataServiceKeyAttribute.cs
- StreamProxy.cs
- SendKeys.cs
- Simplifier.cs
- HoistedLocals.cs
- VectorAnimationBase.cs
- ProcessHostMapPath.cs
- WebResourceAttribute.cs
- ProfileEventArgs.cs
- ClientSession.cs
- AutoGeneratedFieldProperties.cs
- TimeStampChecker.cs
- FormatSettings.cs
- CLRBindingWorker.cs
- PackageDigitalSignature.cs
- SynchronizationContextHelper.cs
- ReflectionUtil.cs
- HttpGetProtocolReflector.cs
- StopStoryboard.cs
- DBSchemaTable.cs
- ReliableReplySessionChannel.cs
- ArrayHelper.cs
- Decoder.cs
- DiscoveryEndpointValidator.cs
- X509CertificateInitiatorClientCredential.cs
- XmlSiteMapProvider.cs
- TdsParameterSetter.cs
- WindowsRegion.cs
- DataSetMappper.cs
- RouteCollection.cs
- Schema.cs
- MissingMethodException.cs
- DropShadowEffect.cs
- ObjectIDGenerator.cs
- SystemResourceKey.cs
- FileCodeGroup.cs
- DrawingContextDrawingContextWalker.cs
- NamespaceMapping.cs
- Module.cs
- SignedXml.cs
- CollectionBase.cs
- StringFormat.cs
- CommentAction.cs
- Win32PrintDialog.cs
- DelegateBodyWriter.cs
- ObjectRef.cs
- UnmanagedMarshal.cs
- StreamInfo.cs
- VersionPair.cs
- ObjectListFieldsPage.cs
- RepeatBehavior.cs
- WinEventHandler.cs
- UIElement.cs
- DebugInfoGenerator.cs
- EdmConstants.cs
- ExpressionCopier.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- FixedDocumentPaginator.cs
- SurrogateSelector.cs
- SelectorAutomationPeer.cs
- WebInvokeAttribute.cs
- XmlDictionaryString.cs
- PageParser.cs
- ConnectionManagementSection.cs
- NodeLabelEditEvent.cs
- ScopeElement.cs
- PersistenceTypeAttribute.cs
- Delay.cs
- BaseProcessProtocolHandler.cs
- StrongBox.cs
- DropAnimation.xaml.cs
- MasterPageParser.cs
- Transform3D.cs
- WinFormsSecurity.cs