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
- BaseDataBoundControl.cs
- DateTimeHelper.cs
- QilPatternFactory.cs
- InfiniteTimeSpanConverter.cs
- PropertySegmentSerializationProvider.cs
- EntityConnection.cs
- Models.cs
- SystemInfo.cs
- SendMailErrorEventArgs.cs
- OpenCollectionAsyncResult.cs
- InternalBufferOverflowException.cs
- TransactionState.cs
- ConfigXmlWhitespace.cs
- PortCache.cs
- AudioStateChangedEventArgs.cs
- ComponentDesigner.cs
- XamlFrame.cs
- EventBuilder.cs
- DictionaryContent.cs
- Debug.cs
- WindowVisualStateTracker.cs
- ContentPathSegment.cs
- DataGridViewImageColumn.cs
- PermissionSet.cs
- IriParsingElement.cs
- DataRelationPropertyDescriptor.cs
- CmsUtils.cs
- CompensatableTransactionScopeActivity.cs
- DesignTable.cs
- TimeZoneInfo.cs
- PriorityBinding.cs
- TracingConnectionInitiator.cs
- UnSafeCharBuffer.cs
- nulltextnavigator.cs
- OwnerDrawPropertyBag.cs
- Action.cs
- StreamSecurityUpgradeProvider.cs
- PopupRoot.cs
- XmlDataSourceNodeDescriptor.cs
- RoutedEventConverter.cs
- MissingMemberException.cs
- SqlRewriteScalarSubqueries.cs
- AuthenticationModeHelper.cs
- ISFClipboardData.cs
- SspiHelper.cs
- IpcChannelHelper.cs
- XmlSchemaObject.cs
- HttpContext.cs
- ThumbAutomationPeer.cs
- ManipulationDelta.cs
- TableCell.cs
- FormViewCommandEventArgs.cs
- ReadOnlyHierarchicalDataSource.cs
- XpsDocument.cs
- MsmqBindingElementBase.cs
- TemplateEditingVerb.cs
- BaseCollection.cs
- GuidConverter.cs
- InputGestureCollection.cs
- VirtualDirectoryMapping.cs
- EntityDataSourceDesignerHelper.cs
- DataViewListener.cs
- SystemKeyConverter.cs
- HebrewNumber.cs
- CqlBlock.cs
- DesignerDataColumn.cs
- MILUtilities.cs
- DbConnectionOptions.cs
- errorpatternmatcher.cs
- ListViewDeleteEventArgs.cs
- ApplicationSecurityManager.cs
- DbParameterCollection.cs
- WorkflowQueue.cs
- RenderTargetBitmap.cs
- SecureConversationSecurityTokenParameters.cs
- DotExpr.cs
- XmlSchemaAny.cs
- DataComponentNameHandler.cs
- SimpleRecyclingCache.cs
- BitmapCacheBrush.cs
- AttachInfo.cs
- SqlClientWrapperSmiStreamChars.cs
- AbstractExpressions.cs
- CodeSubDirectory.cs
- ToolStripManager.cs
- InteropTrackingRecord.cs
- BrowserCapabilitiesFactoryBase.cs
- OutputCacheModule.cs
- MatrixTransform3D.cs
- CommonXSendMessage.cs
- DataControlField.cs
- PolicyManager.cs
- Properties.cs
- FlowPosition.cs
- AttributedMetaModel.cs
- ConfigurationProperty.cs
- RenderData.cs
- StackSpiller.Temps.cs
- ByteFacetDescriptionElement.cs
- XslTransform.cs