Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / Tools / WSATConfig / Configuration / SafeCertificateContext.cs / 1305376 / SafeCertificateContext.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.Tools.ServiceModel.WsatConfig { using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using Microsoft.Win32.SafeHandles; using System.Security.Cryptography.X509Certificates; internal sealed class SafeCertificateContext : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeCertificateContext() : base(false) { } public override bool IsInvalid { get { return handle == IntPtr.Zero; } } protected override bool ReleaseHandle() { // Returns a Win32 error code, 0 for success int r = SafeNativeMethods.CertFreeCertificateContext(handle); return r == 0; } internal X509Certificate2 GetNewX509Certificate() { return new X509Certificate2(handle); } } } // 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
- InvokeProviderWrapper.cs
- UserControl.cs
- ContractListAdapter.cs
- SplineKeyFrames.cs
- ListViewContainer.cs
- DataControlImageButton.cs
- SharedDp.cs
- HttpStaticObjectsCollectionBase.cs
- SurrogateSelector.cs
- HttpListenerResponse.cs
- Scene3D.cs
- DeclarativeCatalogPart.cs
- FixedHighlight.cs
- ManipulationDelta.cs
- SQLSingleStorage.cs
- IconBitmapDecoder.cs
- StyleXamlTreeBuilder.cs
- diagnosticsswitches.cs
- DBSchemaTable.cs
- AddingNewEventArgs.cs
- CodeTryCatchFinallyStatement.cs
- ObjectDataSourceDisposingEventArgs.cs
- EntityCommandDefinition.cs
- SqlTypeSystemProvider.cs
- LinkArea.cs
- SecurityDocument.cs
- ListViewContainer.cs
- PolicyLevel.cs
- InlinedAggregationOperator.cs
- LogAppendAsyncResult.cs
- DataRelationCollection.cs
- ExtensibleClassFactory.cs
- CompatibleIComparer.cs
- XmlSchemaDatatype.cs
- Random.cs
- Positioning.cs
- XmlEncoding.cs
- Rights.cs
- ServiceHttpModule.cs
- Cell.cs
- FilePrompt.cs
- StyleBamlRecordReader.cs
- DesignTimeTemplateParser.cs
- RequestQueryProcessor.cs
- PageVisual.cs
- XmlNodeChangedEventManager.cs
- WebPartConnectionsDisconnectVerb.cs
- HtmlInputButton.cs
- AnnotationComponentChooser.cs
- InvokeGenerator.cs
- PrePostDescendentsWalker.cs
- _OverlappedAsyncResult.cs
- DataGridViewRowConverter.cs
- COM2Enum.cs
- DataGridClipboardCellContent.cs
- _ConnectStream.cs
- ManagedWndProcTracker.cs
- SmtpNtlmAuthenticationModule.cs
- ProtocolsSection.cs
- DefaultProxySection.cs
- DrawingGroup.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- ObjectFullSpanRewriter.cs
- MSAANativeProvider.cs
- wgx_commands.cs
- MethodBuilder.cs
- Rect3DConverter.cs
- Pkcs9Attribute.cs
- NetworkAddressChange.cs
- CounterSample.cs
- MultiTrigger.cs
- DataBindingCollection.cs
- GenericEnumConverter.cs
- RuntimeConfigLKG.cs
- TextSelectionHighlightLayer.cs
- ReadOnlyDataSource.cs
- HebrewNumber.cs
- SelectionProviderWrapper.cs
- SessionStateItemCollection.cs
- IsolatedStorageFileStream.cs
- EntityStoreSchemaFilterEntry.cs
- AuthorizationRule.cs
- CodeMemberMethod.cs
- DrawListViewItemEventArgs.cs
- PersonalizablePropertyEntry.cs
- TraceContext.cs
- followingquery.cs
- LayoutDump.cs
- Compiler.cs
- WebPartDisplayMode.cs
- SerializationAttributes.cs
- BaseAddressElementCollection.cs
- DependencyPropertyAttribute.cs
- UmAlQuraCalendar.cs
- ListViewAutomationPeer.cs
- CompilerScopeManager.cs
- FormsAuthenticationCredentials.cs
- TableLayout.cs
- IndependentAnimationStorage.cs
- DataGridViewCellStyleContentChangedEventArgs.cs