CryptProtectData function crypt32

int CryptProtectData(
  1. Pointer<CRYPT_INTEGER_BLOB> pDataIn,
  2. Pointer<Utf16> szDataDescr,
  3. Pointer<CRYPT_INTEGER_BLOB> pOptionalEntropy,
  4. Pointer<NativeType> pvReserved,
  5. Pointer<CRYPTPROTECT_PROMPTSTRUCT> pPromptStruct,
  6. int dwFlags,
  7. Pointer<CRYPT_INTEGER_BLOB> pDataOut,
)

The CryptProtectData function performs encryption on the data in a DATA_BLOB structure. Typically, only a user with the same logon credential as the user who encrypted the data can decrypt the data. In addition, the encryption and decryption usually must be done on the same computer.

BOOL CryptProtectData(
  [in]           DATA_BLOB                 *pDataIn,
  [in, optional] LPCWSTR                   szDataDescr,
  [in, optional] DATA_BLOB                 *pOptionalEntropy,
  [in]           PVOID                     pvReserved,
  [in, optional] CRYPTPROTECT_PROMPTSTRUCT *pPromptStruct,
  [in]           DWORD                     dwFlags,
  [out]          DATA_BLOB                 *pDataOut
);

Implementation

int CryptProtectData(
        Pointer<CRYPT_INTEGER_BLOB> pDataIn,
        Pointer<Utf16> szDataDescr,
        Pointer<CRYPT_INTEGER_BLOB> pOptionalEntropy,
        Pointer pvReserved,
        Pointer<CRYPTPROTECT_PROMPTSTRUCT> pPromptStruct,
        int dwFlags,
        Pointer<CRYPT_INTEGER_BLOB> pDataOut) =>
    _CryptProtectData(pDataIn, szDataDescr, pOptionalEntropy, pvReserved,
        pPromptStruct, dwFlags, pDataOut);