sapi: Use standard C functions for memory allocation in token.c.
[wine.git] / include / ncrypt.h
blob18198fdc5bbf98fc942752150b7a9f226b37b228
1 /*
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
19 #ifndef __NCRYPT_H__
20 #define __NCRYPT_H__
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 #ifndef WINAPI
27 #define WINAPI __stdcall
28 #endif
30 #ifndef __SECSTATUS_DEFINED__
31 typedef LONG SECURITY_STATUS;
32 #define __SECSTATUS_DEFINED__
33 #endif
35 typedef struct _NCryptAlgorithmName {
36 LPWSTR pszName;
37 DWORD dwClass;
38 DWORD dwAlgOperations;
39 DWORD dwFlags;
40 } NCryptAlgorithmName;
42 typedef struct _NCryptBuffer {
43 ULONG cbBuffer;
44 ULONG BufferType;
45 PVOID pvBuffer;
46 } NCryptBuffer, *PNCryptBuffer;
48 typedef struct _NCryptBufferDesc {
49 ULONG ulVersion;
50 ULONG cBuffers;
51 PNCryptBuffer pBuffers;
52 } NCryptBufferDesc, *PNCryptBufferDesc;
54 typedef struct NCryptKeyName {
55 LPWSTR pszName;
56 LPWSTR pszAlgid;
57 DWORD dwLegacyKeySpec;
58 DWORD dwFlags;
59 } NCryptKeyName;
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 #define NCRYPT_SILENT_FLAG 0x00000040
74 #define NCRYPT_NO_PADDING_FLAG 0x00000001
75 #define NCRYPT_PAD_PKCS1_FLAG 0x00000002
76 #define NCRYPT_PAD_OAEP_FLAG 0x00000004
77 #define NCRYPT_PAD_PSS_FLAG 0x00000008
79 #define NCRYPT_NAME_PROPERTY L"Name"
80 #define NCRYPT_UNIQUE_NAME_PROPERTY L"Unique Name"
81 #define NCRYPT_ALGORITHM_PROPERTY L"Algorithm Name"
82 #define NCRYPT_LENGTH_PROPERTY L"Length"
83 #define NCRYPT_LENGTHS_PROPERTY L"Lengths"
84 #define NCRYPT_BLOCK_LENGTH_PROPERTY L"Block Length"
85 #define NCRYPT_UI_POLICY_PROPERTY L"UI Policy"
86 #define NCRYPT_EXPORT_POLICY_PROPERTY L"Export Policy"
87 #define NCRYPT_WINDOW_HANDLE_PROPERTY L"HWND Handle"
88 #define NCRYPT_USE_CONTEXT_PROPERTY L"Use Context"
89 #define NCRYPT_IMPL_TYPE_PROPERTY L"Impl Type"
90 #define NCRYPT_KEY_USAGE_PROPERTY L"Key Usage"
91 #define NCRYPT_KEY_TYPE_PROPERTY L"Key Type"
92 #define NCRYPT_VERSION_PROPERTY L"Version"
93 #define NCRYPT_SECURITY_DESCR_SUPPORT_PROPERTY L"Security Descr Support"
94 #define NCRYPT_SECURITY_DESCR_PROPERTY L"Security Descr"
95 #define NCRYPT_USE_COUNT_ENABLED_PROPERTY L"Enabled Use Count"
96 #define NCRYPT_USE_COUNT_PROPERTY L"Use Count"
97 #define NCRYPT_LAST_MODIFIED_PROPERTY L"Modified"
98 #define NCRYPT_MAX_NAME_LENGTH_PROPERTY L"Max Name Length"
99 #define NCRYPT_ALGORITHM_GROUP_PROPERTY L"Algorithm Group"
100 #define NCRYPT_PROVIDER_HANDLE_PROPERTY L"Provider Handle"
101 #define NCRYPT_PIN_PROPERTY L"SmartCardPin"
102 #define NCRYPT_READER_PROPERTY L"SmartCardReader"
103 #define NCRYPT_SMARTCARD_GUID_PROPERTY L"SmartCardGuid"
104 #define NCRYPT_CERTIFICATE_PROPERTY L"SmartCardKeyCertificate"
105 #define NCRYPT_PIN_PROMPT_PROPERTY L"SmartCardPinPrompt"
106 #define NCRYPT_USER_CERTSTORE_PROPERTY L"SmartCardUserCertStore"
107 #define NCRYPT_ROOT_CERTSTORE_PROPERTY L"SmartcardRootCertStore"
108 #define NCRYPT_SECURE_PIN_PROPERTY L"SmartCardSecurePin"
109 #define NCRYPT_ASSOCIATED_ECDH_KEY L"SmartCardAssociatedECDHKey"
110 #define NCRYPT_SCARD_PIN_ID L"SmartCardPinId"
111 #define NCRYPT_SCARD_PIN_INFO L"SmartCardPinInfo"
113 SECURITY_STATUS WINAPI NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE *, const WCHAR *, const WCHAR *, DWORD, DWORD);
114 SECURITY_STATUS WINAPI NCryptDecrypt(NCRYPT_KEY_HANDLE, BYTE *, DWORD, void *, BYTE *, DWORD, DWORD *, DWORD);
115 SECURITY_STATUS WINAPI NCryptEncrypt(NCRYPT_KEY_HANDLE, BYTE *, DWORD, void *, BYTE *, DWORD, DWORD *, DWORD);
116 SECURITY_STATUS WINAPI NCryptFinalizeKey(NCRYPT_KEY_HANDLE, DWORD);
117 SECURITY_STATUS WINAPI NCryptFreeObject(NCRYPT_HANDLE);
118 SECURITY_STATUS WINAPI NCryptGetProperty(NCRYPT_HANDLE, const WCHAR *, BYTE *, DWORD, DWORD *, DWORD);
119 SECURITY_STATUS WINAPI NCryptImportKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE, const WCHAR *, NCryptBufferDesc *,
120 NCRYPT_KEY_HANDLE *, BYTE *, DWORD, DWORD);
121 SECURITY_STATUS WINAPI NCryptIsAlgSupported(NCRYPT_PROV_HANDLE, const WCHAR *, DWORD);
122 SECURITY_STATUS WINAPI NCryptOpenKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE *, const WCHAR *, DWORD, DWORD);
123 SECURITY_STATUS WINAPI NCryptOpenStorageProvider(NCRYPT_PROV_HANDLE *, const WCHAR *, DWORD);
124 SECURITY_STATUS WINAPI NCryptSetProperty(NCRYPT_HANDLE, const WCHAR *, BYTE *, DWORD, DWORD);
125 SECURITY_STATUS WINAPI NCryptVerifySignature(NCRYPT_KEY_HANDLE, void *, BYTE *, DWORD, BYTE *, DWORD, DWORD);
127 #ifdef __cplusplus
129 #endif
131 #endif /* __NCRYPT_H__ */