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

# CryptImportKey(3w)

## NAME

**CryptImportKey** (ADVAPI32.@)

## SYNOPSIS

BOOL CryptImportKey\
  (\
   HCRYPTPROV  *hProv*,\
   CONST BYTE\* *pbData*,\
   DWORD       *dwDataLen*,\
   HCRYPTKEY   *hPubKey*,\
   DWORD       *dwFlags*,\
   HCRYPTKEY\*  *phKey*\
  )

## DESCRIPTION

Transfer a cryptographic key from a key **BLOB** into a cryptographic service provider (**CSP**).

## PARAMS

*hProv* **\[In\]**  Handle of a **CSP**.

*pbData* **\[In\]**  Contains the key to be imported.

*dwDataLen* **\[In\]**  Length of the key.

*hPubKey* **\[In\]**  Cryptographic key that decrypts pdData.

*dwFlags* **\[In\]**  Used only with a public/private key pair.

*phKey* **\[Out\]**  Imported key.

## RETURNS

**Success:** **TRUE**

**Failure:** **FALSE**

## IMPLEMENTATION

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

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

Debug channel **"crypt"**.
