2022-02-16 15:13:04 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021 Santino Mazza
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2022-03-08 11:10:55 +01:00
|
|
|
#include <bcrypt.h>
|
2022-02-16 15:13:05 +01:00
|
|
|
|
2022-03-10 11:05:05 +01:00
|
|
|
enum algid
|
|
|
|
{
|
|
|
|
/* symmetric */
|
|
|
|
AES,
|
|
|
|
/* asymmetric */
|
|
|
|
RSA,
|
|
|
|
DSA,
|
|
|
|
ECDSA,
|
|
|
|
};
|
|
|
|
|
2022-02-16 15:13:05 +01:00
|
|
|
struct key
|
|
|
|
{
|
2022-03-10 11:05:05 +01:00
|
|
|
enum algid algid;
|
2022-03-08 11:10:55 +01:00
|
|
|
BCRYPT_ALG_HANDLE bcrypt_alg;
|
|
|
|
BCRYPT_KEY_HANDLE bcrypt_key;
|
2022-02-16 15:13:05 +01:00
|
|
|
};
|
|
|
|
|
2022-02-16 15:13:04 +01:00
|
|
|
struct storage_provider
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
enum object_type
|
|
|
|
{
|
2022-02-16 15:13:05 +01:00
|
|
|
KEY,
|
2022-02-16 15:13:04 +01:00
|
|
|
STORAGE_PROVIDER,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct object_property
|
|
|
|
{
|
|
|
|
WCHAR *key;
|
|
|
|
DWORD value_size;
|
|
|
|
void *value;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct object
|
|
|
|
{
|
|
|
|
enum object_type type;
|
|
|
|
DWORD num_properties;
|
|
|
|
struct object_property *properties;
|
|
|
|
union
|
|
|
|
{
|
2022-02-16 15:13:05 +01:00
|
|
|
struct key key;
|
2022-02-16 15:13:04 +01:00
|
|
|
struct storage_provider storage_provider;
|
|
|
|
};
|
|
|
|
};
|