Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6sign.h
Go to the documentation of this file.
1 
11 #ifndef P6SIGN_H__
12 #define P6SIGN_H__ 1
13 
14 #include "p6crypto.h"
15 #include "p6cryptokey.h"
16 
17 namespace P6R {
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
46 typedef enum {
57 } P6SIGNHMAC;
58 
69 const P6SIGNFLAGS P6SIGN_NOFLAGS = 0x00000000;
70 const P6SIGNFLAGS P6SIGN_TRACEON = 0x00000001;
71 
72 
80 interface p6ISign : public p6ICom
81 {
95  P6COMMETHOD initialize( P6SIGNFLAGS flags ) = 0;
96 
114  P6COMMETHOD setKey( p6ICryptoKey* pKey ) = 0;
115 
150  P6COMMETHOD sign( P6CRYPTODATASOURCE* pInData, P6CRYPTODATASINK* pOutData, P6BOOL base64Encode, P6SIGNHMAC hmac) = 0;
151 
183  P6COMMETHOD verify( P6CRYPTODATASOURCE* pInData, P6CRYPTODATASOURCE* pSignature, P6BOOL base64Encoded, P6SIGNHMAC hmac) = 0;
184 
221  P6COMMETHOD signDSARaw( P6CRYPTODATASOURCE* pInData, P6UCHAR* pR, P6UINT32* pRLength, P6UCHAR* pS, P6UINT32* pSLength ) = 0;
222 
248  P6COMMETHOD verifyDSARaw( P6CRYPTODATASOURCE* pInData, P6UCHAR* pR, P6UINT32 rLength, P6UCHAR* pS, P6UINT32 sLength ) = 0;
249 };
250 
251 // {F1D98E80-E10F-448f-81FA-E94B75B7183A}
252 #define IF_p6ISign {0xf1d98e80,0xe10f,0x448f,{0x81,0xfa,0xe9,0x4b,0x75,0xb7,0x18,0x3a}}
253 
254 // {13B2B4BA-9258-422b-AF54-FE2118B145B2}
255 #define COMP_p6Sign {0x13b2b4ba,0x9258,0x422b,{0xaf,0x54,0xfe,0x21,0x18,0xb1,0x45,0xb2}}
256 
257 #ifdef __cplusplus
258 }
259 #endif
260 
261 } // namespace
262 
263 
264 #endif
265 
266 
267 
P6SIGNHMAC
Supported HMAC algorthms for signing:
Definition: p6sign.h:46
unsigned char P6UCHAR
Definition: p6types.h:74
Cryptography component definitions.
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:787
This interface provides cryptographic signature generation and verification functions.
Definition: p6sign.h:80
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR verify(P6CRYPTODATASOURCE *pInData, P6CRYPTODATASOURCE *pSignature, P6BOOL base64Encoded, P6SIGNHMAC hmac)=0
Verify that the data pointed to by pInData has not been modified.
bool P6BOOL
Boolean type.
Definition: p6types.h:101
Where to get the data to process, either a file or generic buffer.
Definition: p6crypto.h:37
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
P6UINT32 P6SIGNFLAGS
P6SIGNFLAGS.
Definition: p6sign.h:68
virtual P6R::P6ERR sign(P6CRYPTODATASOURCE *pInData, P6CRYPTODATASINK *pOutData, P6BOOL base64Encode, P6SIGNHMAC hmac)=0
Sign the data pointed to by pInData given the key and the key type set in setKey. ...
Where to put the data processed, either a file or generic buffer.
Definition: p6crypto.h:55
#define P6COMMETHOD
Definition: p6types.h:872
const P6SIGNFLAGS P6SIGN_TRACEON
Definition: p6sign.h:70
virtual P6R::P6ERR signDSARaw(P6CRYPTODATASOURCE *pInData, P6UCHAR *pR, P6UINT32 *pRLength, P6UCHAR *pS, P6UINT32 *pSLength)=0
Sign the data, using SH_SHA1, pointed to by pInData given the key and the key type set in setKey...
virtual P6R::P6ERR initialize(P6SIGNFLAGS flags)=0
Sets up the object to run properly.
virtual P6R::P6ERR setKey(p6ICryptoKey *pKey)=0
Load the key to be used for either signing or verficiation.
virtual P6R::P6ERR verifyDSARaw(P6CRYPTODATASOURCE *pInData, P6UCHAR *pR, P6UINT32 rLength, P6UCHAR *pS, P6UINT32 sLength)=0
Verify that the data pointed to by pInData has not been modified.
P6R Cryptographic key interface definitions.
const P6SIGNFLAGS P6SIGN_NOFLAGS
Definition: p6sign.h:69