Windows Dev Center

IX509PrivateKey interface

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.

MethodDescription
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.

PropertyAccess typeDescription

Algorithm

Read/write

Specifies or retrieves an object identifier (OID) for the public key algorithm.

[WebEnabled]

Certificate

Read/write

Specifies or retrieves a byte array that contains the certificate associated with the private key.

ContainerName

Read/write

Specifies or retrieves the name of the key container.

[WebEnabled]

ContainerNamePrefix

Read/write

Specifies or retrieves a prefix added to the name of the key container.

CspInformations

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]

CspStatus

Read/write

Specifies or retrieves an ICspStatus object that contains information about the cryptographic provider and algorithm pair associated with the private key.

[WebEnabled]

DefaultContainer

Read-only

Retrieves a Boolean value that specifies whether the private key represents the default key container.

Description

Read/write

Specifies or retrieves a string that contains a description of the private key.

Existing

Read/write

Specifies or retrieves a Boolean value that indicates whether the private key has been created or imported.

[WebEnabled]

ExportPolicy

Read/write

Specifies or retrieves export constraints for a private key.

[WebEnabled]

FriendlyName

Read/write

Specifies or retrieves a display name for the private key.

KeyProtection

Read/write

Specifies or retrieves a value that indicates how a private key is protected before use.

[WebEnabled]

KeySpec

Read/write

Specifies or retrieves a value that identifies whether a private key can be used for signing, or encryption, or both.

[WebEnabled]

KeyUsage

Read/write

Specifies or retrieves a value that identifies the specific purpose for which a private key can be used.

[WebEnabled]

LegacyCsp

Read/write

Specifies or retrieves a Boolean value that indicates whether the provider is a CryptoAPI (legacy) cryptographic service provider (CSP).

[WebEnabled]

Length

Read/write

Specifies or retrieves the length, in bits, of the private key.

[WebEnabled]

MachineContext

Read/write

Specifies or retrieves a Boolean value that identifies the local certificate store context.

[WebEnabled]

Opened

Read-only

Retrieves a Boolean value that specifies whether the private key is open.

ParentWindow

Read/write

Specifies or retrieves the ID of the window used to display key information.

Pin

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.

ProviderName

Read/write

Specifies or retrieves the name of the cryptographic provider.

[WebEnabled]

ProviderType

Read/write

Specifies or retrieves the type of cryptographic provider associated with the private key.

[WebEnabled]

ReaderName

Read/write

Specifies the name of a smart card reader.

SecurityDescriptor

Read/write

Specifies or retrieves the security descriptor for the private key.

Silent

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.

UIContextMessage

Read/write

Specifies or retrieves a string that contains user interface text associated with the private key.

UniqueContainerName

Read-only

Retrieves a unique name for the key container.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

CertEnroll.h

DLL

CertEnroll.dll

See also

IDispatch
CertEnroll Interfaces
IX509PublicKey

 

 

Community Additions

ADD
Show:
© 2015 Microsoft