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
- CodeDirectoryCompiler.cs
- IndexedGlyphRun.cs
- HttpSysSettings.cs
- DiscardableAttribute.cs
- AccessKeyManager.cs
- UriParserTemplates.cs
- TextElement.cs
- CompositeActivityTypeDescriptorProvider.cs
- Int16Converter.cs
- QueryableDataSourceView.cs
- TaskFormBase.cs
- CustomDictionarySources.cs
- GroupQuery.cs
- RuleSetReference.cs
- XmlJsonReader.cs
- RenamedEventArgs.cs
- RadioButton.cs
- CalendarDateRangeChangingEventArgs.cs
- CatalogPart.cs
- ParserExtension.cs
- SoapFaultCodes.cs
- DemultiplexingClientMessageFormatter.cs
- FileIOPermission.cs
- GridProviderWrapper.cs
- ContainerFilterService.cs
- VisualStateGroup.cs
- EventListenerClientSide.cs
- ObjectNotFoundException.cs
- CapiNative.cs
- URI.cs
- RegexBoyerMoore.cs
- GraphicsState.cs
- _AutoWebProxyScriptHelper.cs
- ProfileManager.cs
- SupportsEventValidationAttribute.cs
- ToolStripHighContrastRenderer.cs
- NonParentingControl.cs
- PublishLicense.cs
- FigureParagraph.cs
- FloaterParagraph.cs
- GiveFeedbackEvent.cs
- SiteMapDataSource.cs
- ProcessHostServerConfig.cs
- BasicBrowserDialog.designer.cs
- Site.cs
- DataSourceView.cs
- HyperLink.cs
- FormDocumentDesigner.cs
- DataGridColumnHeaderAutomationPeer.cs
- SoapEnumAttribute.cs
- CustomAttributeBuilder.cs
- SynchronousChannelMergeEnumerator.cs
- DataGridViewCellLinkedList.cs
- FusionWrap.cs
- References.cs
- DiscreteKeyFrames.cs
- GacUtil.cs
- GAC.cs
- Int16AnimationBase.cs
- CaseStatementProjectedSlot.cs
- CompoundFileReference.cs
- IdentityReference.cs
- COM2PropertyDescriptor.cs
- LinkDesigner.cs
- _KerberosClient.cs
- UnsafePeerToPeerMethods.cs
- AssertSection.cs
- UIElementParagraph.cs
- AuthenticationManager.cs
- ConnectionProviderAttribute.cs
- TextEditorParagraphs.cs
- TabControl.cs
- ScriptControlManager.cs
- EntityStoreSchemaFilterEntry.cs
- AbsoluteQuery.cs
- PointLight.cs
- pingexception.cs
- ObjectDataSourceStatusEventArgs.cs
- MultipartIdentifier.cs
- SqlUserDefinedAggregateAttribute.cs
- LinearKeyFrames.cs
- XmlQueryStaticData.cs
- IndexedGlyphRun.cs
- DeclarativeCatalogPart.cs
- TextReader.cs
- GetWinFXPath.cs
- ScriptingProfileServiceSection.cs
- CompiledQueryCacheEntry.cs
- CalendarDesigner.cs
- FrameworkElementFactory.cs
- CompiledXpathExpr.cs
- SplineQuaternionKeyFrame.cs
- HtmlButton.cs
- sqlmetadatafactory.cs
- Input.cs
- ToolboxItemWrapper.cs
- ButtonBaseAutomationPeer.cs
- FunctionImportElement.cs
- EdmToObjectNamespaceMap.cs
- HiddenField.cs