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
- TabRenderer.cs
- LineSegment.cs
- RequestResizeEvent.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- OuterGlowBitmapEffect.cs
- TraceSwitch.cs
- ServicePointManager.cs
- OdbcCommand.cs
- CookieHandler.cs
- MouseButton.cs
- ColorConverter.cs
- PrimitiveSchema.cs
- MetadataProperty.cs
- Error.cs
- UrlPath.cs
- MethodBuilder.cs
- ImageFormat.cs
- TripleDES.cs
- BitmapImage.cs
- CodeCompileUnit.cs
- QilChoice.cs
- MetadataPropertyvalue.cs
- WindowsListViewSubItem.cs
- CodePageEncoding.cs
- ManifestResourceInfo.cs
- InputBuffer.cs
- ControlBuilder.cs
- ProfileInfo.cs
- WebChannelFactory.cs
- WMIGenerator.cs
- ImageListStreamer.cs
- AdapterDictionary.cs
- mansign.cs
- ServiceReference.cs
- DragCompletedEventArgs.cs
- CodeConstructor.cs
- XmlSchemaInferenceException.cs
- WebBrowserSiteBase.cs
- Viewport2DVisual3D.cs
- PolyBezierSegmentFigureLogic.cs
- ReflectionServiceProvider.cs
- HiddenFieldPageStatePersister.cs
- StubHelpers.cs
- UniqueIdentifierService.cs
- HotCommands.cs
- ExtendedPropertyDescriptor.cs
- FixedDocumentSequencePaginator.cs
- ListControl.cs
- FrameworkContentElement.cs
- DesignerSerializerAttribute.cs
- HttpContext.cs
- StyleSheetRefUrlEditor.cs
- EntityDataReader.cs
- Soap12ProtocolReflector.cs
- HandleRef.cs
- DataControlFieldCollection.cs
- Globals.cs
- XmlSchemaSequence.cs
- PropertyInfoSet.cs
- Application.cs
- StateRuntime.cs
- ToolStripItemRenderEventArgs.cs
- dbdatarecord.cs
- ListViewSortEventArgs.cs
- TabItemWrapperAutomationPeer.cs
- XXXInfos.cs
- PieceNameHelper.cs
- PageWrapper.cs
- AlternationConverter.cs
- Base64Stream.cs
- ConfigurationValue.cs
- Logging.cs
- FormsAuthentication.cs
- SQLUtility.cs
- EncodingDataItem.cs
- DataControlPagerLinkButton.cs
- RemotingSurrogateSelector.cs
- Helpers.cs
- ButtonPopupAdapter.cs
- DrawingGroup.cs
- ImplicitInputBrush.cs
- ToolstripProfessionalRenderer.cs
- PageMediaSize.cs
- HtmlFormParameterReader.cs
- GridItemCollection.cs
- ListViewCommandEventArgs.cs
- SelectionProcessor.cs
- Parameter.cs
- DetailsViewRowCollection.cs
- Win32Native.cs
- GlyphCache.cs
- DbProviderFactoriesConfigurationHandler.cs
- JsonWriterDelegator.cs
- SplitterEvent.cs
- LinkedList.cs
- InputQueue.cs
- RowTypeElement.cs
- HttpListenerResponse.cs
- PatternMatcher.cs
- SapiGrammar.cs