---
name: "CryptExportKey"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/CryptExportKey"
---

# CryptExportKey(3w)

## NAME

**CryptExportKey** (ADVAPI32.@)

## SYNOPSIS

BOOL CryptExportKey\
  (\
   HCRYPTKEY *hKey*,\
   HCRYPTKEY *hExpKey*,\
   DWORD     *dwBlobType*,\
   DWORD     *dwFlags*,\
   BYTE\*     *pbData*,\
   DWORD\*    *pdwDataLen*\
  )

## DESCRIPTION

Exports a cryptographic key from a **CSP**.

## PARAMS

*hKey* **\[In\]**  Handle to the key to export.

*hExpKey* **\[In\]**  Handle to a cryptographic key of the end user.

*dwBlobType* **\[In\]**  Type of **BLOB** to be exported.

*dwFlags* **\[In\]**  CRYPT\_DESTROYKEY/SSL2\_FALLBACK/OAEP.

*pbData* **\[Out\]**  Buffer to receive **BLOB** data.

*pdwDataLen* **\[In/Out\]**  Specifies the size of *pbData*.

## RETURNS

**Success:** **TRUE**

**Failure:** **FALSE**.

## NOTES

if *pbData* is **NULL**, CryptExportKey sets *pdwDataLen* as the size of the buffer needed to hold the **BLOB**.

## IMPLEMENTATION

Declared in **"wincrypt.h"**.

Implemented in **"dlls/advapi32/crypt.c"**.

Debug channel **"crypt"**.
