FreeRDP
include/winpr/ncrypt.h File Reference
#include <winpr/wtypes.h>
#include <winpr/winpr.h>
This graph shows which files directly or indirectly include this file:

Data Structures

struct  NCryptKeyName
 a key name descriptor More...
 
struct  NCryptProviderName
 a provider name descriptor More...
 

Macros

#define __SECSTATUS_DEFINED__
 
#define MS_KEY_STORAGE_PROVIDER
 
#define MS_SMART_CARD_KEY_STORAGE_PROVIDER
 
#define MS_SCARD_PROV_A   "Microsoft Base Smart Card Crypto Provider"
 
#define MS_SCARD_PROV
 
#define MS_PLATFORM_KEY_STORAGE_PROVIDER
 
#define NCRYPT_CERTIFICATE_PROPERTY
 
#define NCRYPT_NAME_PROPERTY   (const WCHAR*)"N\x00a\x00m\x00e\x00\x00"
 
#define NCRYPT_UNIQUE_NAME_PROPERTY
 
#define NCRYPT_READER_PROPERTY
 
#define NCRYPT_WINPR_SLOTID   (const WCHAR*)"S\x00l\x00o\x00t\x00\x00"
 
#define NCRYPT_MACHINE_KEY_FLAG   0x20
 
#define NCRYPT_SILENT_FLAG   0x40
 

Typedefs

typedef LONG SECURITY_STATUS
 
typedef ULONG_PTR NCRYPT_HANDLE
 
typedef ULONG_PTR NCRYPT_PROV_HANDLE
 
typedef ULONG_PTR NCRYPT_KEY_HANDLE
 

Functions

WINPR_API SECURITY_STATUS NCryptEnumStorageProviders (DWORD *wProviderCount, NCryptProviderName **ppProviderList, DWORD dwFlags)
 
WINPR_API SECURITY_STATUS NCryptOpenStorageProvider (NCRYPT_PROV_HANDLE *phProvider, LPCWSTR pszProviderName, DWORD dwFlags)
 
WINPR_API SECURITY_STATUS NCryptEnumKeys (NCRYPT_PROV_HANDLE hProvider, LPCWSTR pszScope, NCryptKeyName **ppKeyName, PVOID *ppEnumState, DWORD dwFlags)
 
WINPR_API SECURITY_STATUS NCryptOpenKey (NCRYPT_PROV_HANDLE hProvider, NCRYPT_KEY_HANDLE *phKey, LPCWSTR pszKeyName, DWORD dwLegacyKeySpec, DWORD dwFlags)
 
WINPR_API SECURITY_STATUS NCryptGetProperty (NCRYPT_HANDLE hObject, LPCWSTR pszProperty, PBYTE pbOutput, DWORD cbOutput, DWORD *pcbResult, DWORD dwFlags)
 
WINPR_API SECURITY_STATUS NCryptFreeObject (NCRYPT_HANDLE hObject)
 
WINPR_API SECURITY_STATUS NCryptFreeBuffer (PVOID pvInput)
 
WINPR_API SECURITY_STATUS winpr_NCryptOpenStorageProviderEx (NCRYPT_PROV_HANDLE *phProvider, LPCWSTR pszProviderName, DWORD dwFlags, LPCSTR *modulePaths)
 
WINPR_API const char * winpr_NCryptSecurityStatusError (SECURITY_STATUS status)
 

Macro Definition Documentation

◆ __SECSTATUS_DEFINED__

#define __SECSTATUS_DEFINED__

◆ MS_KEY_STORAGE_PROVIDER

#define MS_KEY_STORAGE_PROVIDER
Value:
(const WCHAR*)"M\x00i\x00" \
"c\x00r\x00o\x00s\x00o\x00" \
"f\x00t\x00 " \
"\x00S\x00o\x00" \
"f\x00t\x00w\x00" \
"a\x00r\x00" \
"e\x00 \x00K\x00" \
"e\x00y\x00 " \
"\x00S\x00t\x00o\x00r\x00" \
"a\x00g\x00" \
"e\x00 " \
"\x00P\x00r\x00o\x00v\x00i\x00" \
"d\x00" \
"e\x00r\x00\x00"

◆ MS_PLATFORM_KEY_STORAGE_PROVIDER

#define MS_PLATFORM_KEY_STORAGE_PROVIDER
Value:
(const WCHAR*)"M\x00i\x00" \
"c\x00r\x00o\x00s\x00o\x00" \
"f\x00t\x00 " \
"\x00P\x00l\x00" \
"a\x00t\x00" \
"f\x00o\x00r\x00m\x00 " \
"\x00" \
"C\x00r\x00y\x00p\x00t\x00o\x00 " \
"\x00P\x00r\x00o\x00v\x00i\x00" \
"d\x00" \
"e\x00r\x00\x00"

◆ MS_SCARD_PROV

#define MS_SCARD_PROV
Value:
(const WCHAR*)("M\x00i\x00" \
"c\x00r\x00o\x00s\x00o\x00" \
"f\x00t\x00 \x00" \
"B\x00" \
"a\x00s\x00" \
"e\x00 " \
"\x00S\x00m\x00" \
"a\x00r\x00t\x00 \x00" \
"C\x00" \
"a\x00r\x00" \
"d\x00 " \
"\x00" \
"C\x00r\x00y\x00p\x00t\x00o\x00 " \
"\x00P\x00r\x00o\x00v\x00i\x00" \
"d\x00" \
"e\x00r\x00\x00")

◆ MS_SCARD_PROV_A

#define MS_SCARD_PROV_A   "Microsoft Base Smart Card Crypto Provider"

◆ MS_SMART_CARD_KEY_STORAGE_PROVIDER

#define MS_SMART_CARD_KEY_STORAGE_PROVIDER
Value:
(const WCHAR*)"M\x00i\x00" \
"c\x00r\x00o\x00s\x00o\x00" \
"f\x00t\x00 \x00S\x00m\x00" \
"a\x00r\x00t\x00 " \
"\x00" \
"C\x00" \
"a\x00r\x00" \
"d\x00 \x00K\x00" \
"e\x00y\x00 " \
"\x00S\x00t\x00o\x00r\x00" \
"a\x00g\x00" \
"e\x00 " \
"\x00P\x00r\x00o\x00v\x00i\x00" \
"d\x00" \
"e\x00r\x00\x00"

◆ NCRYPT_CERTIFICATE_PROPERTY

#define NCRYPT_CERTIFICATE_PROPERTY
Value:
(const WCHAR*)"S\x00m\x00" \
"a\x00r\x00t\x00" \
"C\x00" \
"a\x00r\x00" \
"d\x00K\x00" \
"e\x00y\x00" \
"C\x00" \
"e\x00r\x00t" \
"\x00i\x00" \
"f\x00i\x00" \
"c\x00" \
"a\x00t\x00" \
"e\x00\x00"

◆ NCRYPT_MACHINE_KEY_FLAG

#define NCRYPT_MACHINE_KEY_FLAG   0x20

◆ NCRYPT_NAME_PROPERTY

#define NCRYPT_NAME_PROPERTY   (const WCHAR*)"N\x00a\x00m\x00e\x00\x00"

◆ NCRYPT_READER_PROPERTY

#define NCRYPT_READER_PROPERTY
Value:
(const WCHAR*)"S\x00m\x00" \
"a\x00r\x00t\x00" \
"C\x00" \
"a\x00r\x00" \
"d\x00R\x00" \
"e\x00" \
"a\x00" \
"d\x00" \
"e\x00r\x00\x00"

◆ NCRYPT_SILENT_FLAG

#define NCRYPT_SILENT_FLAG   0x40

◆ NCRYPT_UNIQUE_NAME_PROPERTY

#define NCRYPT_UNIQUE_NAME_PROPERTY
Value:
(const WCHAR*)"U\x00n\x00i\x00q\x00u\x00" \
"e\x00 \x00N\x00" \
"a\x00m\x00" \
"e\x00\x00"

◆ NCRYPT_WINPR_SLOTID

#define NCRYPT_WINPR_SLOTID   (const WCHAR*)"S\x00l\x00o\x00t\x00\x00"

Typedef Documentation

◆ NCRYPT_HANDLE

typedef ULONG_PTR NCRYPT_HANDLE

◆ NCRYPT_KEY_HANDLE

typedef ULONG_PTR NCRYPT_KEY_HANDLE

◆ NCRYPT_PROV_HANDLE

typedef ULONG_PTR NCRYPT_PROV_HANDLE

◆ SECURITY_STATUS

typedef LONG SECURITY_STATUS

WinPR: Windows Portable Runtime NCrypt library

Copyright 2021 David Fort conta.nosp@m.ct@h.nosp@m.arden.nosp@m.ing-.nosp@m.consu.nosp@m.ltin.nosp@m.g.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ NCryptEnumKeys()

WINPR_API SECURITY_STATUS NCryptEnumKeys ( NCRYPT_PROV_HANDLE  hProvider,
LPCWSTR  pszScope,
NCryptKeyName **  ppKeyName,
PVOID *  ppEnumState,
DWORD  dwFlags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NCryptEnumStorageProviders()

WINPR_API SECURITY_STATUS NCryptEnumStorageProviders ( DWORD *  wProviderCount,
NCryptProviderName **  ppProviderList,
DWORD  dwFlags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NCryptFreeBuffer()

WINPR_API SECURITY_STATUS NCryptFreeBuffer ( PVOID  pvInput)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NCryptFreeObject()

WINPR_API SECURITY_STATUS NCryptFreeObject ( NCRYPT_HANDLE  hObject)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NCryptGetProperty()

WINPR_API SECURITY_STATUS NCryptGetProperty ( NCRYPT_HANDLE  hObject,
LPCWSTR  pszProperty,
PBYTE  pbOutput,
DWORD  cbOutput,
DWORD *  pcbResult,
DWORD  dwFlags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NCryptOpenKey()

WINPR_API SECURITY_STATUS NCryptOpenKey ( NCRYPT_PROV_HANDLE  hProvider,
NCRYPT_KEY_HANDLE phKey,
LPCWSTR  pszKeyName,
DWORD  dwLegacyKeySpec,
DWORD  dwFlags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ NCryptOpenStorageProvider()

WINPR_API SECURITY_STATUS NCryptOpenStorageProvider ( NCRYPT_PROV_HANDLE phProvider,
LPCWSTR  pszProviderName,
DWORD  dwFlags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_NCryptOpenStorageProviderEx()

WINPR_API SECURITY_STATUS winpr_NCryptOpenStorageProviderEx ( NCRYPT_PROV_HANDLE phProvider,
LPCWSTR  pszProviderName,
DWORD  dwFlags,
LPCSTR *  modulePaths 
)

custom NCryptOpenStorageProvider that allows to provide a list of modules to load

Parameters
phProvider[out] resulting provider handle
dwFlags[in] the flags to use
modulePaths[in] an array of library path to try to load ended with a NULL string
Returns
ERROR_SUCCESS or an NTE error code something failed
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_NCryptSecurityStatusError()

WINPR_API const char* winpr_NCryptSecurityStatusError ( SECURITY_STATUS  status)

Gives a string representation of a SECURITY_STATUS

Parameters
status[in] SECURITY_STATUS that we want as string
Returns
the string representation of status
Here is the caller graph for this function: