IX509PrivateKey::Open method (certenroll.h)
The Open method opens an existing private key.
Syntax
HRESULT Open();
Return value
If the function succeeds, the function returns S_OK.
If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.
Remarks
If successful, this method sets the Opened property. You must call either the Open or Create methods before calling the Export method or ExportPublicKey method.
You cannot set the following properties after calling the Open or Create methods. If you wish to specify them, you must do so before calling either of these methods.
- Algorithm
- ContainerName
- ContainerNamePrefix
- CspInformations
- CspStatus
- Description
- Existing
- ExportPolicy
- FriendlyName
- KeyProtection
- KeySpec
- KeyUsage
- LegacyCsp
- Length
- MachineContext
- ProviderName
- ProviderType
- Pin
- ReaderName
- Silent
- UIContextMessage
The following properties can be set regardless of whether the key is open:
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | certenroll.h |
DLL | CertEnroll.dll |