2 * Copyright (c) 2016 Austin English
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #define WINAPI __stdcall
30 #ifndef __SECSTATUS_DEFINED__
31 typedef LONG SECURITY_STATUS
;
32 #define __SECSTATUS_DEFINED__
35 typedef struct _NCryptAlgorithmName
{
38 DWORD dwAlgOperations
;
40 } NCryptAlgorithmName
;
42 typedef struct _NCryptBuffer
{
46 } NCryptBuffer
, *PNCryptBuffer
;
48 typedef struct _NCryptBufferDesc
{
51 PNCryptBuffer pBuffers
;
52 } NCryptBufferDesc
, *PNCryptBufferDesc
;
54 typedef struct NCryptKeyName
{
57 DWORD dwLegacyKeySpec
;
61 typedef ULONG_PTR NCRYPT_HANDLE
;
62 typedef ULONG_PTR NCRYPT_PROV_HANDLE
;
63 typedef ULONG_PTR NCRYPT_KEY_HANDLE
;
64 typedef ULONG_PTR NCRYPT_HASH_HANDLE
;
65 typedef ULONG_PTR NCRYPT_SECRET_HANDLE
;
67 #define NCRYPT_KEY_STORAGE_INTERFACE 0x00010001
68 #define NCRYPT_SCHANNEL_INTERFACE 0x00010002
69 #define NCRYPT_SCHANNEL_SIGNATURE_INTERFACE 0x00010003
70 #define NCRYPT_KEY_PROTECTION_INTERFACE 0x00010004
72 SECURITY_STATUS WINAPI
NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE
, NCRYPT_KEY_HANDLE
*, const WCHAR
*, const WCHAR
*, DWORD
, DWORD
);
73 SECURITY_STATUS WINAPI
NCryptDecrypt(NCRYPT_KEY_HANDLE
, BYTE
*, DWORD
, void *, BYTE
*, DWORD
, DWORD
*, DWORD
);
74 SECURITY_STATUS WINAPI
NCryptEncrypt(NCRYPT_KEY_HANDLE
, BYTE
*, DWORD
, void *, BYTE
*, DWORD
, DWORD
*, DWORD
);
75 SECURITY_STATUS WINAPI
NCryptFinalizeKey(NCRYPT_KEY_HANDLE
, DWORD
);
76 SECURITY_STATUS WINAPI
NCryptFreeObject(NCRYPT_HANDLE
);
77 SECURITY_STATUS WINAPI
NCryptOpenKey(NCRYPT_PROV_HANDLE
, NCRYPT_KEY_HANDLE
*, const WCHAR
*, DWORD
, DWORD
);
78 SECURITY_STATUS WINAPI
NCryptOpenStorageProvider(NCRYPT_PROV_HANDLE
*, const WCHAR
*, DWORD
);
84 #endif /* __NCRYPT_H__ */