Commit 07f9952a authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ncrypt: Implement NCryptExportKey().

parent a90df92a
......@@ -413,6 +413,33 @@ SECURITY_STATUS WINAPI NCryptImportKey(NCRYPT_PROV_HANDLE provider, NCRYPT_KEY_H
return ERROR_SUCCESS;
}
SECURITY_STATUS WINAPI NCryptExportKey(NCRYPT_KEY_HANDLE key, NCRYPT_KEY_HANDLE encrypt_key, const WCHAR *type,
NCryptBufferDesc *params, BYTE *output, DWORD output_len, DWORD *ret_len,
DWORD flags)
{
struct object *object = (struct object *)key;
TRACE("(%#Ix, %#Ix, %s, %p, %p, %lu, %p, %#lx)\n", key, encrypt_key, wine_dbgstr_w(type), params, output,
output_len, ret_len, flags);
if (encrypt_key)
{
FIXME("Key blob encryption not implemented\n");
return NTE_NOT_SUPPORTED;
}
if (params)
{
FIXME("Parameter information not implemented\n");
return NTE_NOT_SUPPORTED;
}
if (flags == NCRYPT_SILENT_FLAG)
{
FIXME("Silent flag not implemented\n");
}
return map_ntstatus(BCryptExportKey(object->key.bcrypt_key, NULL, type, output, output_len, ret_len, 0));
}
SECURITY_STATUS WINAPI NCryptIsAlgSupported(NCRYPT_PROV_HANDLE provider, const WCHAR *algid, DWORD flags)
{
static const ULONG supported = BCRYPT_CIPHER_OPERATION |\
......
......@@ -70,7 +70,7 @@
@ stdcall NCryptEnumAlgorithms(long long ptr ptr long)
@ stdcall NCryptEnumKeys(long wstr ptr ptr long)
@ stub NCryptEnumStorageProviders
@ stub NCryptExportKey
@ stdcall NCryptExportKey(long long wstr ptr ptr long ptr long)
@ stdcall NCryptFinalizeKey(long long)
@ stdcall NCryptFreeBuffer(ptr)
@ stdcall NCryptFreeObject(long)
......
......@@ -110,9 +110,12 @@ typedef ULONG_PTR NCRYPT_SECRET_HANDLE;
#define NCRYPT_SCARD_PIN_ID L"SmartCardPinId"
#define NCRYPT_SCARD_PIN_INFO L"SmartCardPinInfo"
SECURITY_STATUS WINAPI NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE *, const WCHAR *, const WCHAR *, DWORD, DWORD);
SECURITY_STATUS WINAPI NCryptCreatePersistedKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE *, const WCHAR *, const WCHAR *,
DWORD, DWORD);
SECURITY_STATUS WINAPI NCryptDecrypt(NCRYPT_KEY_HANDLE, BYTE *, DWORD, void *, BYTE *, DWORD, DWORD *, DWORD);
SECURITY_STATUS WINAPI NCryptEncrypt(NCRYPT_KEY_HANDLE, BYTE *, DWORD, void *, BYTE *, DWORD, DWORD *, DWORD);
SECURITY_STATUS WINAPI NCryptExportKey(NCRYPT_KEY_HANDLE, NCRYPT_KEY_HANDLE, const WCHAR *, NCryptBufferDesc *, BYTE *,
DWORD, DWORD *, DWORD);
SECURITY_STATUS WINAPI NCryptFinalizeKey(NCRYPT_KEY_HANDLE, DWORD);
SECURITY_STATUS WINAPI NCryptFreeObject(NCRYPT_HANDLE);
SECURITY_STATUS WINAPI NCryptGetProperty(NCRYPT_HANDLE, const WCHAR *, BYTE *, DWORD, DWORD *, DWORD);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment