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
- Application.cs
- DbConnectionOptions.cs
- GlobalProxySelection.cs
- ColumnBinding.cs
- SizeConverter.cs
- DescendentsWalkerBase.cs
- HwndHost.cs
- SqlReferenceCollection.cs
- FixedSOMContainer.cs
- Component.cs
- safesecurityhelperavalon.cs
- AppSettingsExpressionBuilder.cs
- SafeNativeMethods.cs
- EventProviderBase.cs
- XmlCharCheckingWriter.cs
- ToolStripArrowRenderEventArgs.cs
- PerformanceCounterPermission.cs
- DataContractSerializer.cs
- TextTreeRootTextBlock.cs
- CodeMemberProperty.cs
- TemplateBamlRecordReader.cs
- ScriptingJsonSerializationSection.cs
- FirstMatchCodeGroup.cs
- StaticExtension.cs
- RtType.cs
- VersionConverter.cs
- DataChangedEventManager.cs
- AppDomainAttributes.cs
- IdentityVerifier.cs
- DefaultBindingPropertyAttribute.cs
- FontCacheUtil.cs
- GeneralTransform3DCollection.cs
- DbDataSourceEnumerator.cs
- PickDesigner.xaml.cs
- KeyedQueue.cs
- XPathParser.cs
- RuntimeResourceSet.cs
- EventlogProvider.cs
- TypedServiceOperationListItem.cs
- Bidi.cs
- Glyph.cs
- ApplicationSecurityManager.cs
- GridItem.cs
- CellTreeNodeVisitors.cs
- MimeTextImporter.cs
- AliasedExpr.cs
- TraceContext.cs
- PeerContact.cs
- MSG.cs
- SapiAttributeParser.cs
- XPathNodeHelper.cs
- SecurityKeyType.cs
- CngKeyCreationParameters.cs
- ComponentResourceManager.cs
- GenericPrincipal.cs
- EndpointConfigContainer.cs
- VisualBasicHelper.cs
- IDReferencePropertyAttribute.cs
- ResourceReferenceKeyNotFoundException.cs
- BehaviorDragDropEventArgs.cs
- documentsequencetextview.cs
- SmiEventStream.cs
- XPathBinder.cs
- FixedLineResult.cs
- ExceptionUtil.cs
- ImageBrush.cs
- FontUnit.cs
- ConstraintManager.cs
- ReadContentAsBinaryHelper.cs
- PeerEndPoint.cs
- BamlBinaryWriter.cs
- Array.cs
- TrackBarRenderer.cs
- UnsafeNativeMethodsPenimc.cs
- SqlConnectionHelper.cs
- ClipboardProcessor.cs
- DtrList.cs
- RijndaelManaged.cs
- DaylightTime.cs
- ToolBar.cs
- ObjectStateManagerMetadata.cs
- BuildProviderInstallComponent.cs
- TextEditorCopyPaste.cs
- CodeConstructor.cs
- SecurityResources.cs
- Processor.cs
- ProviderConnectionPoint.cs
- BooleanConverter.cs
- HtmlTitle.cs
- SessionChannels.cs
- MimeBasePart.cs
- XmlSchemaSimpleContent.cs
- MarkerProperties.cs
- ComponentGlyph.cs
- CommandPlan.cs
- TypeListConverter.cs
- ConnectionOrientedTransportManager.cs
- DataSourceHelper.cs
- AccessViolationException.cs
- WebPartCloseVerb.cs