/[openpgpmdrv]/trunk/OpenPGPminidriver/CryptoOperations.h
ViewVC logotype

Contents of /trunk/OpenPGPminidriver/CryptoOperations.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10 - (show annotations)
Mon Mar 15 18:23:17 2010 UTC (15 years, 1 month ago) by vletoux
File MIME type: text/plain
File size: 2705 byte(s)
first beta version
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 ContainerSignature,
21 ContainerConfidentiality,
22 ContainerAuthentication,
23 ContainerMax
24 } OPENPGP_CONTAINER;
25
26 typedef enum _OPENPGP_KEY
27 {
28 KeySignature,
29 KeyConfidentiality,
30 KeyAuthentication,
31 KeyMax
32 } OPENPGP_KEY;
33
34 typedef struct _OPENPGP_KEY_INFO
35 {
36 BYTE bKeyTag;
37 BYTE bDateTimeTag;
38 BYTE bSignatureTag;
39 ALG_ID aiKeyAlg;
40 } OPENPGP_KEY_INFO, *POPENPGP_KEY_INFO;
41
42 extern OPENPGP_KEY_INFO Keys[];
43
44 typedef struct _OPENPGP_CONTAINER_INFO
45 {
46 PIN_ID PinId;
47 DWORD dwKeySpec;
48 } OPENPGP_CONTAINER_INFO, *POPENPGP_CONTAINER_INFO;
49
50 extern OPENPGP_CONTAINER_INFO Containers[];
51
52 #define OPENPGP_SUPPORTED_CYPHER_ALGORITHM L"\0"
53 #define OPENPGP_SUPPORTED_ASYMETRIC_ALGORITHM L"RSA\0"
54
55 #pragma pack(push,1)
56 typedef struct _OPENPGP_ALGORITHM_ATTRIBUTE
57 {
58 BYTE bAlgoId;
59 unsigned short wModulusLengthInBit;
60 unsigned short wExponentLengthInBit;
61 BYTE bFormat;
62 } OPENPGP_ALGORITHM_ATTRIBUTE, *POPENPGP_ALGORITHM_ATTRIBUTE;
63 #pragma pack(pop)
64
65 DWORD OCardReadPublicKey(PCARD_DATA pCardData,
66 OPENPGP_KEY dwKey,
67 PBYTE *pbPublicKey, PDWORD pdwPublicKeySize);
68
69 DWORD OCardCreateKey(PCARD_DATA pCardData, OPENPGP_KEY dwKey, DWORD dwBitLen);
70
71 DWORD OCardImportKey(PCARD_DATA pCardData,
72 OPENPGP_KEY dwKey,
73 PBYTE pBlob,
74 DWORD dwKeySize);
75
76 DWORD OCardSign(PCARD_DATA pCardData,
77 PCARD_SIGNING_INFO pInfo);
78
79 DWORD OCardAuthenticate(PCARD_DATA pCardData,
80 PCARD_SIGNING_INFO pInfo);
81
82 DWORD OCardDecrypt(PCARD_DATA pCardData,
83 PCARD_RSA_DECRYPT_INFO pInfo);
84
85 DWORD OCardReadContainerMapFile(__in PCARD_DATA pCardData,
86 __in PBYTE* ppbResponse, __in PDWORD pdwResponseSize);
87
88 DWORD OCardGetKeyLengthInBytes(__in PCARD_DATA pCardData, __in OPENPGP_KEY dwKey,
89 __out PDWORD pdwLengthInBytes);
90
91 DWORD OCardIsConfidentialityKeyTheSameThanAuthentication(__in PCARD_DATA pCardData);

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26