IX509PrivateKey interface
Applies to: desktop apps only
The IX509PrivateKey interface represents an asymmetric private key that can be used for encryption, signing, and key agreement. Private keys are referenced in the following objects:
Members
The IX509PrivateKey interface inherits from the IDispatch interface. IX509PrivateKey also has these types of members:
Methods
The IX509PrivateKey interface has these methods.
| Method | Description |
|---|---|
| Close |
Releases the handle of the cryptographic service provider (CSP) or the handle of the Cryptography API: Next Generation (CNG) key storage provider (KSP). |
| Create |
Creates an asymmetric private key. |
| Delete |
Releases the handle of the CSP or KSP and deletes the key from disk or smart card. |
| Export |
Copies the private key to a byte array. |
| ExportPublicKey |
Exports the public key portion of the asymmetric key pair. |
| Import |
Imports an existing private key into a key container within a CSP. |
| Open |
Opens an existing private key. |
| Verify |
Verifies that a private key exists and can be used by the client but does not open the key. |
Properties
The IX509PrivateKey interface has these properties.
| Property | Access type | Description |
|---|---|---|
| Read/write |
Specifies or retrieves an object identifier (OID) for the public key algorithm. [WebEnabled] | |
| Read/write |
Specifies or retrieves a byte array that contains the certificate associated with the private key. | |
| Read/write |
Specifies or retrieves the name of the key container. [WebEnabled] | |
| Read/write |
Specifies or retrieves a prefix added to the name of the key container. | |
| Read/write |
Specifies or retrieves a collection of ICspInformation objects that contain information about the available cryptographic providers that support the public key algorithm associated with the private key. [WebEnabled] | |
| Read/write |
Specifies or retrieves an ICspStatus object that contains information about the cryptographic provider and algorithm pair associated with the private key. [WebEnabled] | |
| Read-only |
Retrieves a Boolean value that specifies whether the private key represents the default key container. | |
| Read/write |
Specifies or retrieves a string that contains a description of the private key. | |
| Read/write |
Specifies or retrieves a Boolean value that indicates whether the private key has been created or imported. [WebEnabled] | |
| Read/write |
Specifies or retrieves export constraints for a private key. [WebEnabled] | |
| Read/write |
Specifies or retrieves a display name for the private key. | |
| Read/write |
Specifies or retrieves a value that indicates how a private key is protected before use. [WebEnabled] | |
| Read/write |
Specifies or retrieves a value that identifies whether a private key can be used for signing, or encryption, or both. [WebEnabled] | |
| Read/write |
Specifies or retrieves a value that identifies the specific purpose for which a private key can be used. [WebEnabled] | |
| Read/write |
Specifies or retrieves a Boolean value that indicates whether the provider is a CryptoAPI (legacy) cryptographic service provider (CSP). [WebEnabled] | |
| Read/write |
Specifies or retrieves the length, in bits, of the private key. [WebEnabled] | |
| Read/write |
Specifies or retrieves a Boolean value that identifies the local certificate store context. [WebEnabled] | |
| Read-only |
Retrieves a Boolean value that specifies whether the private key is open. | |
| Read/write |
Specifies or retrieves the ID of the window used to display key information. | |
| Write-only |
Specifies a personal identification number (PIN) that is used to authenticate users prior to accessing a private key container on a smart card. | |
| Read/write |
Specifies or retrieves the name of the cryptographic provider. [WebEnabled] | |
| Read/write |
Specifies or retrieves the type of cryptographic provider associated with the private key. [WebEnabled] | |
| Read/write |
Specifies the name of a smart card reader. | |
| Read/write |
Specifies or retrieves the security descriptor for the private key. | |
| Read/write |
Specifies or retrieves a Boolean value that indicates whether the Certificate Enrollment Control is allowed to display a dialog box when the private key is accessed. | |
| Read/write |
Specifies or retrieves a string that contains user interface text associated with the private key. | |
| Read-only |
Retrieves a unique name for the key container. |
Requirements
|
Minimum supported client | Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Header |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 2/3/2012