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

# CryptGetUserKey(3w)

## NAME

**CryptGetUserKey** (ADVAPI32.@)

## SYNOPSIS

BOOL CryptGetUserKey\
  (\
   HCRYPTPROV *hProv*,\
   DWORD      *dwKeySpec*,\
   HCRYPTKEY\* *phUserKey*\
  )

## DESCRIPTION

Gets a handle of one of a user's two public/private key pairs.

## PARAMS

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

*dwKeySpec* **\[In\]**  Private key to use.

*phUserKey* **\[Out\]**  Pointer to the handle of the retrieved keys.

## RETURNS

**Success:** **TRUE**

**Failure:** **FALSE**

## IMPLEMENTATION

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

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

Debug channel **"crypt"**.
