Code:
/ 4.0 / 4.0 / 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.
//------------------------------------------------------------
// 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
- PasswordRecovery.cs
- DataSourceSelectArguments.cs
- BasicHttpBindingCollectionElement.cs
- _NegoStream.cs
- HttpResponseInternalWrapper.cs
- _NegoState.cs
- ConversionValidationRule.cs
- Code.cs
- UrlPropertyAttribute.cs
- AppModelKnownContentFactory.cs
- CellParagraph.cs
- ParentQuery.cs
- ToolStripLocationCancelEventArgs.cs
- SemanticAnalyzer.cs
- WebPartsSection.cs
- GatewayIPAddressInformationCollection.cs
- DBDataPermission.cs
- SocketSettings.cs
- ApplicationServiceManager.cs
- HttpConfigurationSystem.cs
- DocumentSchemaValidator.cs
- RSAPKCS1SignatureFormatter.cs
- ToolStripComboBox.cs
- Int16Converter.cs
- ValidatorCollection.cs
- EdmToObjectNamespaceMap.cs
- PropertyDescriptorGridEntry.cs
- ExpressionNode.cs
- PermissionRequestEvidence.cs
- DynamicValueConverter.cs
- VisualCollection.cs
- ShapingEngine.cs
- TagElement.cs
- HttpValueCollection.cs
- LocalizedNameDescriptionPair.cs
- RawContentTypeMapper.cs
- Decorator.cs
- EventProxy.cs
- WebAdminConfigurationHelper.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- EditorResources.cs
- XPathEmptyIterator.cs
- GeometryModel3D.cs
- Int32EqualityComparer.cs
- DataGridViewAutoSizeModeEventArgs.cs
- WorkflowApplicationTerminatedException.cs
- ReachIDocumentPaginatorSerializerAsync.cs
- AutomationIdentifier.cs
- CollectionMarkupSerializer.cs
- AdornerDecorator.cs
- DesigntimeLicenseContextSerializer.cs
- FontConverter.cs
- AnnotationResourceCollection.cs
- DataRowChangeEvent.cs
- InputScopeAttribute.cs
- CorrelationToken.cs
- SqlServices.cs
- DESCryptoServiceProvider.cs
- GuidelineSet.cs
- TextSpanModifier.cs
- BoundColumn.cs
- WorkflowPrinting.cs
- StylusPlugInCollection.cs
- PointHitTestResult.cs
- ResXResourceReader.cs
- WindowsTokenRoleProvider.cs
- Control.cs
- MailAddressParser.cs
- X509ThumbprintKeyIdentifierClause.cs
- WizardStepCollectionEditor.cs
- HttpCachePolicyElement.cs
- ToolStripDesignerUtils.cs
- PreDigestedSignedInfo.cs
- OdbcHandle.cs
- BuildDependencySet.cs
- ObjectDataSource.cs
- RelationshipDetailsRow.cs
- BasicSecurityProfileVersion.cs
- LongTypeConverter.cs
- XslVisitor.cs
- TreeNodeMouseHoverEvent.cs
- DesignerUtility.cs
- HtmlWindow.cs
- OperationValidationEventArgs.cs
- RegexRunnerFactory.cs
- FtpRequestCacheValidator.cs
- SmtpCommands.cs
- EndPoint.cs
- BorderGapMaskConverter.cs
- ExceptionHandler.cs
- OracleString.cs
- XmlIlTypeHelper.cs
- AssemblySettingAttributes.cs
- DataTableCollection.cs
- BaseWebProxyFinder.cs
- EventMappingSettings.cs
- FormViewDesigner.cs
- Registry.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- XmlQueryTypeFactory.cs