IX509PrivateKey::ProviderName property

The ProviderName property specifies or retrieves the name of the cryptographic provider. This property is web enabled for both input and output.

This property is read/write.

Syntax


HRESULT put_ProviderName(
  [in]  BSTR Value
);

HRESULT get_ProviderName(
  [out] BSTR *pValue
);

Property value

A BSTR variable that contains the name.

Error codes

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following table. For a list of common error codes, see Common HRESULT Values.

Name/valueMeaning
CERTSRV_E_PROPERTY_EMPTY

The property value could not be found.

HRESULT_FROM_WIN32(ERROR_FILE_READ_ONLY)

The key is open, and the property value cannot be set.

NTE_BAD_PROVIDER

The provider specified could not be found on the computer.

Remarks

Setting this property automatically sets the following properties to be consistent with the specified ProviderName value:

These properties are set in the following manner:

  • The provider configuration data is used, if available, to determine the appropriate ProviderType value.
  • If the specified provider is a CNG KSP:
    • The LegacyCsp property is set to VARIANT_FALSE.
    • The KeySpec property is set to XCN_AT_NONE.
  • If the specified provider is not a CNG KSP:
    • The LegacyCsp property is set to VARIANT_TRUE.
    • The KeySpec property is set to XCN_AT_SIGNATURE.

If you set the ProviderName property, we recommend that you do not set the LegacyCsp or ProviderType properties.

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

IX509PrivateKey

 

 

Show: