Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Tools / WSATConfig / Configuration / SafeCertificateContext.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AsymmetricKeyExchangeDeformatter.cs
- AutoCompleteStringCollection.cs
- ScrollItemPattern.cs
- LogEntryDeserializer.cs
- RightNameExpirationInfoPair.cs
- Switch.cs
- PrivateFontCollection.cs
- BamlVersionHeader.cs
- WebPartZoneCollection.cs
- Normalizer.cs
- OracleString.cs
- EventWaitHandle.cs
- SamlSubject.cs
- ObjectSelectorEditor.cs
- DynamicRendererThreadManager.cs
- StorageInfo.cs
- InlinedAggregationOperatorEnumerator.cs
- TableLayout.cs
- XmlRawWriter.cs
- DocumentOrderQuery.cs
- UIAgentCrashedException.cs
- GridViewRowPresenterBase.cs
- DropTarget.cs
- FontEmbeddingManager.cs
- TransformedBitmap.cs
- ResourceReferenceExpression.cs
- AttributeSetAction.cs
- FloatMinMaxAggregationOperator.cs
- MatrixStack.cs
- ByteStreamMessage.cs
- ExpressionStringBuilder.cs
- DispatcherExceptionFilterEventArgs.cs
- UnsafeNativeMethods.cs
- SafeSystemMetrics.cs
- MouseOverProperty.cs
- DocComment.cs
- FactoryMaker.cs
- StylusCollection.cs
- RefType.cs
- DeleteHelper.cs
- TemplateBindingExtension.cs
- ConnectionManagementElementCollection.cs
- FrameworkElementAutomationPeer.cs
- ProfileModule.cs
- EntityDataSourceMemberPath.cs
- ActivationArguments.cs
- BitmapData.cs
- GetPageCompletedEventArgs.cs
- CounterSample.cs
- ToolBar.cs
- ListenerPerfCounters.cs
- PeerResolverSettings.cs
- Decoder.cs
- HebrewNumber.cs
- SqlCachedBuffer.cs
- Array.cs
- StringArrayConverter.cs
- ReliableMessagingVersion.cs
- Inline.cs
- Comparer.cs
- PagerSettings.cs
- ToolstripProfessionalRenderer.cs
- IntranetCredentialPolicy.cs
- Zone.cs
- TransportConfigurationTypeElement.cs
- HandleRef.cs
- NativeMethods.cs
- UnsafeNativeMethods.cs
- LinkGrep.cs
- SplineKeyFrames.cs
- Preprocessor.cs
- QuaternionValueSerializer.cs
- MethodExpr.cs
- LinqDataSourceHelper.cs
- InvokePattern.cs
- DesignerUtils.cs
- Claim.cs
- PagePropertiesChangingEventArgs.cs
- pingexception.cs
- DataGridViewColumnStateChangedEventArgs.cs
- FrameworkContentElement.cs
- DateTimePickerDesigner.cs
- HandlerFactoryCache.cs
- XPathSelfQuery.cs
- FileDialog.cs
- WorkflowRuntimeService.cs
- PropertyDescriptor.cs
- AssemblyAssociatedContentFileAttribute.cs
- UIElementParaClient.cs
- DataServiceRequestOfT.cs
- DataServicePagingProviderWrapper.cs
- ProcessHost.cs
- HostedTransportConfigurationManager.cs
- AssociationSetMetadata.cs
- RSAPKCS1KeyExchangeFormatter.cs
- HtmlInputPassword.cs
- WebPartMovingEventArgs.cs
- GridViewRowPresenterBase.cs
- TimeStampChecker.cs
- CommandID.cs