Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / CngKeyCreationParameters.cs / 1305376 / CngKeyCreationParameters.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Security; using System.Security.Permissions; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Settings to be applied to a CNG key before it is finalized. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class CngKeyCreationParameters { private CngExportPolicies? m_exportPolicy; private CngKeyCreationOptions m_keyCreationOptions; private CngKeyUsages? m_keyUsage; private CngPropertyCollection m_parameters = new CngPropertyCollection(); private IntPtr m_parentWindowHandle; private CngProvider m_provider = CngProvider.MicrosoftSoftwareKeyStorageProvider; private CngUIPolicy m_uiPolicy; ////// How many times can this key be exported from the KSP /// public CngExportPolicies? ExportPolicy { get { return m_exportPolicy; } set { m_exportPolicy = value; } } ////// Flags controlling how to create the key /// public CngKeyCreationOptions KeyCreationOptions { get { return m_keyCreationOptions; } set { m_keyCreationOptions = value; } } ////// Which cryptographic operations are valid for use with this key /// public CngKeyUsages? KeyUsage { get { return m_keyUsage; } set { m_keyUsage = value; } } ////// Window handle to use as the parent for the dialog shown when the key is created /// public IntPtr ParentWindowHandle { get { return m_parentWindowHandle; } [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)] set { m_parentWindowHandle = value; } } ////// Extra parameter values to set before the key is finalized /// public CngPropertyCollection Parameters { [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)] get { Contract.Ensures(Contract.Result() != null); return m_parameters; } } /// /// Internal access to the parameters method without a demand /// internal CngPropertyCollection ParametersNoDemand { get { Contract.Ensures(Contract.Result() != null); return m_parameters; } } /// /// KSP to create the key in /// public CngProvider Provider { get { Contract.Ensures(Contract.Result() != null); return m_provider; } set { if (value == null) { throw new ArgumentNullException("value"); } m_provider = value; } } /// /// Settings for UI shown on access to the key /// public CngUIPolicy UIPolicy { get { return m_uiPolicy; } [HostProtection(Action = SecurityAction.Demand, UI = true)] [UIPermission(SecurityAction.Demand, Window = UIPermissionWindow.SafeSubWindows)] set { m_uiPolicy = value; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Security; using System.Security.Permissions; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Settings to be applied to a CNG key before it is finalized. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class CngKeyCreationParameters { private CngExportPolicies? m_exportPolicy; private CngKeyCreationOptions m_keyCreationOptions; private CngKeyUsages? m_keyUsage; private CngPropertyCollection m_parameters = new CngPropertyCollection(); private IntPtr m_parentWindowHandle; private CngProvider m_provider = CngProvider.MicrosoftSoftwareKeyStorageProvider; private CngUIPolicy m_uiPolicy; ////// How many times can this key be exported from the KSP /// public CngExportPolicies? ExportPolicy { get { return m_exportPolicy; } set { m_exportPolicy = value; } } ////// Flags controlling how to create the key /// public CngKeyCreationOptions KeyCreationOptions { get { return m_keyCreationOptions; } set { m_keyCreationOptions = value; } } ////// Which cryptographic operations are valid for use with this key /// public CngKeyUsages? KeyUsage { get { return m_keyUsage; } set { m_keyUsage = value; } } ////// Window handle to use as the parent for the dialog shown when the key is created /// public IntPtr ParentWindowHandle { get { return m_parentWindowHandle; } [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)] set { m_parentWindowHandle = value; } } ////// Extra parameter values to set before the key is finalized /// public CngPropertyCollection Parameters { [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)] get { Contract.Ensures(Contract.Result() != null); return m_parameters; } } /// /// Internal access to the parameters method without a demand /// internal CngPropertyCollection ParametersNoDemand { get { Contract.Ensures(Contract.Result() != null); return m_parameters; } } /// /// KSP to create the key in /// public CngProvider Provider { get { Contract.Ensures(Contract.Result() != null); return m_provider; } set { if (value == null) { throw new ArgumentNullException("value"); } m_provider = value; } } /// /// Settings for UI shown on access to the key /// public CngUIPolicy UIPolicy { get { return m_uiPolicy; } [HostProtection(Action = SecurityAction.Demand, UI = true)] [UIPermission(SecurityAction.Demand, Window = UIPermissionWindow.SafeSubWindows)] set { m_uiPolicy = value; } } } } // 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
- XmlDictionaryWriter.cs
- KerberosSecurityTokenProvider.cs
- EventListener.cs
- DmlSqlGenerator.cs
- SerializerDescriptor.cs
- GrammarBuilder.cs
- SeparatorAutomationPeer.cs
- ServiceObjectContainer.cs
- As.cs
- SqlConnectionManager.cs
- TableCellsCollectionEditor.cs
- CodeSnippetStatement.cs
- FrameworkElementAutomationPeer.cs
- Calendar.cs
- ContentFilePart.cs
- XsdDataContractImporter.cs
- Native.cs
- DataBoundControlHelper.cs
- PolyLineSegmentFigureLogic.cs
- PnrpPermission.cs
- ProcessStartInfo.cs
- BounceEase.cs
- XmlDictionaryWriter.cs
- VisualStyleRenderer.cs
- NamedPipeConnectionPoolSettings.cs
- Freezable.cs
- NCryptNative.cs
- ErrorItem.cs
- SimpleExpression.cs
- UpdatePanelTrigger.cs
- EditingMode.cs
- PropertyTabAttribute.cs
- FrameAutomationPeer.cs
- BeginEvent.cs
- FontDriver.cs
- StaticTextPointer.cs
- ContentElementCollection.cs
- Constants.cs
- StateRuntime.cs
- NavigationFailedEventArgs.cs
- NotifyParentPropertyAttribute.cs
- XmlSerializerFactory.cs
- ParseChildrenAsPropertiesAttribute.cs
- CodeCompileUnit.cs
- FileSecurity.cs
- LoadedOrUnloadedOperation.cs
- Matrix.cs
- OdbcError.cs
- ChannelServices.cs
- DispatcherHookEventArgs.cs
- Walker.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- WebPartVerbsEventArgs.cs
- ProxySimple.cs
- LogLogRecordHeader.cs
- SplineQuaternionKeyFrame.cs
- SqlInfoMessageEvent.cs
- NullableFloatSumAggregationOperator.cs
- FontUnit.cs
- Currency.cs
- SeparatorAutomationPeer.cs
- BulletedList.cs
- TypeDescriptionProviderAttribute.cs
- HijriCalendar.cs
- ExpressionBuilderCollection.cs
- BaseTreeIterator.cs
- SqlVersion.cs
- PersonalizationProviderCollection.cs
- SqlRowUpdatingEvent.cs
- PassportAuthenticationModule.cs
- HttpCapabilitiesEvaluator.cs
- ADConnectionHelper.cs
- SeparatorAutomationPeer.cs
- ButtonRenderer.cs
- RowSpanVector.cs
- TextRangeAdaptor.cs
- QilList.cs
- ObjectViewEntityCollectionData.cs
- BookmarkUndoUnit.cs
- ItemsChangedEventArgs.cs
- MemberDescriptor.cs
- DocumentReferenceCollection.cs
- _IPv6Address.cs
- ImageClickEventArgs.cs
- IriParsingElement.cs
- PasswordBox.cs
- CompositeActivityTypeDescriptor.cs
- ProfileGroupSettings.cs
- Utils.cs
- TraceContextRecord.cs
- DrawingVisual.cs
- ExpandSegmentCollection.cs
- APCustomTypeDescriptor.cs
- Types.cs
- BaseCollection.cs
- HScrollProperties.cs
- XamlFigureLengthSerializer.cs
- Nullable.cs
- ButtonField.cs
- XmlDocumentType.cs