Platform SDK: Files and I/O

SetUserFileEncryptionKey

The SetUserFileEncryptionKey function sets the user's current key to the specified certificate.

DWORD SetUserFileEncryptionKey(
  PENCRYPTION_CERTIFICATE pEncryptionCertificate  // certificate
);

Parameters

pEncryptionCertificate
[in] Pointer to a certificate that will be the user's key. This parameter is a pointer to an ENCRYPTION_CERTIFICATE structure.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a Win32 error code. For a complete list of error codes, see Error Codes or the Platform SDK header file WinError.h.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winefs.h; include Windows.h.
  Library: Use Advapi32.lib.

See Also

File Systems Overview, File System Functions, ENCRYPTION_CERTIFICATE