1 |
vletoux |
1 |
/* OpenPGP Smart Card Mini Driver |
2 |
|
|
Copyright (C) 2009 Vincent Le Toux |
3 |
|
|
|
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 version 2.1 as published by the Free Software Foundation. |
7 |
|
|
|
8 |
|
|
This library is distributed in the hope that it will be useful, |
9 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 |
|
|
Lesser General Public License for more details. |
12 |
|
|
|
13 |
|
|
You should have received a copy of the GNU Lesser General Public |
14 |
|
|
License along with this library; if not, write to the Free Software |
15 |
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
16 |
|
|
*/ |
17 |
|
|
|
18 |
|
|
typedef enum _OPENPGP_CONTAINER |
19 |
|
|
{ |
20 |
|
|
Signature, |
21 |
|
|
Authentication, |
22 |
|
|
Confidentiality, |
23 |
|
|
MaxContainer |
24 |
|
|
} OPENPGP_CONTAINER; |
25 |
|
|
|
26 |
|
|
typedef struct _OPENPGP_CONTAINER_INFO |
27 |
|
|
{ |
28 |
|
|
BYTE Tag; |
29 |
|
|
ALG_ID aiKeyAlg; |
30 |
|
|
DWORD dwKeySpec; |
31 |
|
|
PIN_ID PinId; |
32 |
|
|
} OPENPGP_CONTAINER_INFO, *POPENPGP_CONTAINER_INFO; |
33 |
|
|
|
34 |
|
|
extern OPENPGP_CONTAINER_INFO Containers[]; |
35 |
|
|
|
36 |
|
|
#define OPENPGP_SUPPORTED_CYPHER_ALGORITHM L"\0" |
37 |
|
|
#define OPENPGP_SUPPORTED_ASYMETRIC_ALGORITHM L"RSA\0" |
38 |
|
|
|
39 |
|
|
DWORD SCardReadPublicKey(PCARD_DATA pCardData, |
40 |
|
|
OPENPGP_CONTAINER dwContainer, |
41 |
|
|
PBYTE *pbPublicKey, PDWORD pdwPublicKeySize); |
42 |
|
|
|
43 |
|
|
DWORD SCardCreateKey(PCARD_DATA pCardData, OPENPGP_CONTAINER dwContainer, DWORD dwBitLen); |
44 |
|
|
|
45 |
|
|
DWORD SCardImportKey(PCARD_DATA pCardData, |
46 |
|
|
OPENPGP_CONTAINER dwContainer, |
47 |
|
|
PBYTE pBlob, |
48 |
|
|
DWORD dwKeySize); |
49 |
|
|
|
50 |
|
|
DWORD SCardSign(PCARD_DATA pCardData, |
51 |
|
|
PCARD_SIGNING_INFO pInfo); |
52 |
|
|
|
53 |
|
|
DWORD SCardDecrypt(PCARD_DATA pCardData, |
54 |
|
|
PCARD_RSA_DECRYPT_INFO pInfo); |
55 |
|
|
|
56 |
|
|
DWORD SCardAuthenticate(PCARD_DATA pCardData, |
57 |
|
|
PCARD_SIGNING_INFO pInfo); |
58 |
|
|
|
59 |
|
|
DWORD GetPinInfo(DWORD __in bContainerIndex, __inout PPIN_INFO pPinInfo); |