IX509PrivateKey::SecurityDescriptor property

The SecurityDescriptor property specifies or retrieves the security descriptor for the private key.

This property is read/write.

Syntax


HRESULT put_SecurityDescriptor(
  [in]   BSTR Value
);

HRESULT get_SecurityDescriptor(
  [out]  BSTR *pValue
);

Property value

A BSTR variable that contains the security descriptor.

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.

Remarks

To use the security descriptor, you must call the ConvertStringSecurityDescriptorToSecurityDescriptor function included with the Microsoft Authorization API and specify the string returned by the GetDefaultSecurityDescriptor method.

The security descriptor is used to define access to private keys for the computer and user in the following manner:

  • By default, only local administrators and services running under the LocalSystem account can access private keys associated with the computer account.
  • When a CSP stores the private key of a user in an encrypted file in the user profile, it uses a security descriptor to set access permissions to the file.

If the key is not open when you specify a descriptor, the property value will be set when the key is opened.

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft