Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Net / System / Net / Mail / SmtpDigestAuthenticationModule.cs / 1305376 / SmtpDigestAuthenticationModule.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net.Mail { using System; using System.Collections; using System.IO; using System.Net; using System.Security.Permissions; using System.Security.Authentication.ExtendedProtection; // #if MAKE_MAILCLIENT_PUBLIC internal #else internal #endif class SmtpDigestAuthenticationModule : ISmtpAuthenticationModule { Hashtable sessions = new Hashtable(); internal SmtpDigestAuthenticationModule() { } #region ISmtpAuthenticationModule Members // Security this method will access NetworkCredential properties that demand UnmanagedCode and Environment Permission [EnvironmentPermission(SecurityAction.Assert, Unrestricted = true)] [SecurityPermission(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)] public Authorization Authenticate(string challenge, NetworkCredential credential, object sessionCookie, string spn, ChannelBinding channelBindingToken) { lock (this.sessions) { NTAuthentication clientContext = this.sessions[sessionCookie] as NTAuthentication; if (clientContext == null) { if (credential == null){ return null; } // this.sessions[sessionCookie] = clientContext = new NTAuthentication(false, "WDigest", credential, spn, ContextFlags.Connection, channelBindingToken); } string resp = clientContext.GetOutgoingBlob(challenge); if (!clientContext.IsCompleted) { return new Authorization(resp, false); } else { this.sessions.Remove(sessionCookie); return new Authorization(resp, true); } } } public string AuthenticationType { get { return "WDigest"; } } public void CloseContext(object sessionCookie) { // This is a no-op since the context is not // kept open by this module beyond auth completion. } #endregion } } // 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
- StrokeCollectionDefaultValueFactory.cs
- ConnectionsZone.cs
- Directory.cs
- InstalledFontCollection.cs
- ToolStripControlHost.cs
- DoubleAnimationBase.cs
- KeyTimeConverter.cs
- GridViewSortEventArgs.cs
- SecurityTokenException.cs
- HostingEnvironment.cs
- Int32RectValueSerializer.cs
- UserMapPath.cs
- NativeMethods.cs
- DataGridViewRowsAddedEventArgs.cs
- RecordManager.cs
- ThreadLocal.cs
- TableItemPatternIdentifiers.cs
- UInt64Converter.cs
- DynamicResourceExtension.cs
- Point3DValueSerializer.cs
- SessionStateSection.cs
- TdsParserSafeHandles.cs
- IsolatedStorageException.cs
- LocalFileSettingsProvider.cs
- SafePEFileHandle.cs
- WebEventCodes.cs
- SchemaInfo.cs
- PassportAuthenticationModule.cs
- CompositeScriptReference.cs
- ProviderConnectionPointCollection.cs
- UshortList2.cs
- TextViewBase.cs
- ScriptHandlerFactory.cs
- TextBoxLine.cs
- PropertyPath.cs
- RangeBaseAutomationPeer.cs
- PathStreamGeometryContext.cs
- AssemblyBuilder.cs
- Walker.cs
- ChannelToken.cs
- AsyncContentLoadedEventArgs.cs
- HyperLinkStyle.cs
- ProviderManager.cs
- ProfileProvider.cs
- StretchValidation.cs
- BrowserCapabilitiesFactoryBase.cs
- Span.cs
- CancellationHandlerDesigner.cs
- HelpInfo.cs
- StackOverflowException.cs
- XmlEntityReference.cs
- CorePropertiesFilter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- GroupQuery.cs
- MouseEvent.cs
- TextRangeProviderWrapper.cs
- ColorConvertedBitmapExtension.cs
- NopReturnReader.cs
- DuplexChannel.cs
- AppDomainProtocolHandler.cs
- DesignerVerb.cs
- PreviewPageInfo.cs
- ManagementOptions.cs
- Point3DCollection.cs
- AstNode.cs
- FileClassifier.cs
- BlurBitmapEffect.cs
- StickyNoteAnnotations.cs
- XmlAutoDetectWriter.cs
- MailWebEventProvider.cs
- PlaceHolder.cs
- Mapping.cs
- LocalizabilityAttribute.cs
- SiteMapNodeCollection.cs
- CacheDict.cs
- TableRowGroup.cs
- PathStreamGeometryContext.cs
- SecondaryViewProvider.cs
- PassportAuthentication.cs
- DoubleLinkListEnumerator.cs
- RightsManagementInformation.cs
- LocalizabilityAttribute.cs
- AxisAngleRotation3D.cs
- ValuePatternIdentifiers.cs
- TheQuery.cs
- BuilderInfo.cs
- CompareInfo.cs
- FontCollection.cs
- DbReferenceCollection.cs
- ListBox.cs
- BmpBitmapDecoder.cs
- UriSection.cs
- TrustSection.cs
- SelectionManager.cs
- NativeWindow.cs
- BatchWriter.cs
- sqlpipe.cs
- ProtocolImporter.cs
- ObjRef.cs
- CorePropertiesFilter.cs