CryptUnprotectData function crypt32

int CryptUnprotectData(
  1. Pointer<CRYPT_INTEGER_BLOB> pDataIn,
  2. Pointer<Pointer<Utf16>> ppszDataDescr,
  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 CryptUnprotectData function decrypts and does an integrity check of the data in a DATA_BLOB structure. Usually, the only user who can decrypt the data is a user with the same logon credentials as the user who encrypted the data. In addition, the encryption and decryption must be done on the same computer.

BOOL CryptUnprotectData(
  [in]            DATA_BLOB                 *pDataIn,
  [out, optional] LPWSTR                    *ppszDataDescr,
  [in, optional]  DATA_BLOB                 *pOptionalEntropy,
                  PVOID                     pvReserved,
  [in, optional]  CRYPTPROTECT_PROMPTSTRUCT *pPromptStruct,
  [in]            DWORD                     dwFlags,
  [out]           DATA_BLOB                 *pDataOut
);

Implementation

int CryptUnprotectData(
        Pointer<CRYPT_INTEGER_BLOB> pDataIn,
        Pointer<Pointer<Utf16>> ppszDataDescr,
        Pointer<CRYPT_INTEGER_BLOB> pOptionalEntropy,
        Pointer pvReserved,
        Pointer<CRYPTPROTECT_PROMPTSTRUCT> pPromptStruct,
        int dwFlags,
        Pointer<CRYPT_INTEGER_BLOB> pDataOut) =>
    _CryptUnprotectData(pDataIn, ppszDataDescr, pOptionalEntropy, pvReserved,
        pPromptStruct, dwFlags, pDataOut);