Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6license.h
Go to the documentation of this file.
1 
11 #ifndef P6LICENSE_H__
12 #define P6LICENSE_H__ 1
13 
14 #include "p6i18n.h"
15 #include "p6cryptokey.h"
16 #include "p6sign.h"
17 
18 namespace P6R {
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
39 typedef enum
40 {
41  LICENSE_NOOP = 0x00,
42  LICENSE_CREATE = 0x01,
45 
54 typedef struct
55 {
56  const P6WCHAR* pName;
57  const P6WCHAR* pValue;
59 
68 const P6LICENSEFLAGS P6LICENSE_NOFLAGS = 0x00000000;
69 
70 
78 {
87  P6COMMETHOD reset() = 0;
88 
103  P6COMMETHOD next( P6UINT32 cElements, P6PROPERTYVALUE* parElements, P6UINT32* pcReturned ) = 0;
104 };
105 
106 // {0AAB71D4-A6B1-4b55-BD31-2F14A2592C4B}
107 #define IF_p6IEnumLicense {0xaab71d4,0xa6b1,0x4b55,{0xbd,0x31,0x2f,0x14,0xa2,0x59,0x2c,0x4b}}
108 
109 
119 {
128  P6COMMETHOD reset() = 0;
129 
144  P6COMMETHOD next( P6UINT32 cElements, P6PROPERTYVALUE* parElements, P6UINT32* pcReturned ) = 0;
145 };
146 
147 
148 // {67A3B9F0-A69C-40B6-AFE4-0CB02E81780D}
149 #define IF_p6IEnumLicenseValueList {0x67A3B9F0,0xA69C,0x40B6,{0xAF,0xE4,0x0C,0xB0,0x2E,0x81,0x78,0x0D}}
150 
151 
175 interface p6ILicense : public p6ICom
176 {
189  P6COMMETHOD initialize( P6LICENSEFLAGS flags, P6LICENSE_OPERATION mode ) = 0;
190 
203 
226  P6COMMETHOD setKeys( p6ICryptoKey* pPublicKey, p6ICryptoKey* pPrivateKey, P6SIGNHMAC algorithm ) = 0;
227 
244  P6COMMETHOD setPropInt( const P6WCHAR* pPropName, P6INT32 value ) = 0;
245 
262  P6COMMETHOD setPropString( const P6WCHAR* pPropName, const P6WCHAR* pValue ) = 0;
263 
280  P6COMMETHOD setPropStringList( const P6WCHAR* pPropName, const P6WCHAR* pValue ) = 0;
281 
282 
297  P6COMMETHOD getPropInt( const P6WCHAR* pPropName, P6INT32* pValue ) = 0;
298 
319  P6COMMETHOD getPropString( const P6WCHAR* pPropName, P6WCHAR* pBuffer, P6UINT32 cBuffer, P6UINT32* pWritten ) = 0;
320 
337  P6COMMETHOD enumLicense( p6IEnumLicense** ppEnum ) = 0;
338 
356  P6COMMETHOD enumLicenseValueList( const P6R::P6WCHAR *pszKeyName, p6IEnumLicenseValueList** ppEnum ) = 0;
357 
376  P6COMMETHOD createLicenseFile( const P6WCHAR* pFilePath ) = 0;
377 
398  P6COMMETHOD verifyLicenseFile( const P6WCHAR* pFilePath ) = 0;
399 };
400 
401 // {1DF20931-007C-48d4-9308-7D2A6F0E72BB}
402 #define IF_p6ILicense {0x1df20931,0x7c,0x48d4,{0x93,0x8,0x7d,0x2a,0x6f,0xe,0x72,0xbb}}
403 
404 // {3753D1AF-5BDD-4daa-A7E4-FC07BD0BC3BB}
405 #define COMP_p6License {0x3753d1af,0x5bdd,0x4daa,{0xa7,0xe4,0xfc,0x7,0xbd,0xb,0xc3,0xbb}}
406 
407 #ifdef __cplusplus
408 }
409 #endif
410 
411 } // namespace
412 
413 
414 #endif
415 
416 
417 
418 
419 
P6SIGNHMAC
Supported HMAC algorthms for signing:
Definition: p6sign.h:46
const P6WCHAR * pName
Definition: p6license.h:56
virtual P6R::P6ERR reset()=0
This method is used to re-start the enumerator at the beginning.
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:787
virtual P6R::P6ERR enumLicenseValueList(const P6R::P6WCHAR *pszKeyName, p6IEnumLicenseValueList **ppEnum)=0
Creates and returns an enumerator for a value list for a specific key name in a verified license (i...
unsigned int P6UINT32
Definition: p6types.h:40
A license file is composed of one or more name - value pairs.
Definition: p6license.h:77
virtual P6R::P6ERR setPropInt(const P6WCHAR *pPropName, P6INT32 value)=0
Store the integer value as a property of the license in the format of "name=value", where pPropName points to a string containing "name".
A license file is composed of one or more name - value pairs.
Definition: p6license.h:118
virtual P6R::P6ERR setPropStringList(const P6WCHAR *pPropName, const P6WCHAR *pValue)=0
Store the string list value as a property of the license in the format of "name=value", where pPropName points to a string containing "name".
virtual P6R::P6ERR getPropString(const P6WCHAR *pPropName, P6WCHAR *pBuffer, P6UINT32 cBuffer, P6UINT32 *pWritten)=0
Retrieve the string value of the named property in the license that has been successfully verified or...
virtual P6R::P6ERR setMode(P6LICENSE_OPERATION mode)=0
This method can be invoked many times to change the mode of the p6ILicense component.
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
const P6WCHAR * pValue
Definition: p6license.h:57
int P6INT32
Definition: p6types.h:41
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
virtual P6R::P6ERR reset()=0
This method is used to re-start the enumerator at the beginning.
virtual P6R::P6ERR setKeys(p6ICryptoKey *pPublicKey, p6ICryptoKey *pPrivateKey, P6SIGNHMAC algorithm)=0
This component does not do key management.
virtual P6R::P6ERR next(P6UINT32 cElements, P6PROPERTYVALUE *parElements, P6UINT32 *pcReturned)=0
This method is used to iterate through all the value list items for the specified key name...
virtual P6R::P6ERR verifyLicenseFile(const P6WCHAR *pFilePath)=0
Validate that the license file was generated by this component given the key pair used in the call to...
Interface definition for all p6I18n and L10n features.
This interface supports the generation and verification of p6I18n licenses.
Definition: p6license.h:175
virtual P6R::P6ERR next(P6UINT32 cElements, P6PROPERTYVALUE *parElements, P6UINT32 *pcReturned)=0
This method is used to iterate through all the properties of a license.
virtual P6R::P6ERR enumLicense(p6IEnumLicense **ppEnum)=0
Creates and returns an enumerator for all the properties in a verified license (i.e., after a successful call to verifyLicenseFile) or a license being created (i.e., after several setPropXXX function calls but BEFORE createLicenseFile is called).
virtual P6R::P6ERR initialize(P6LICENSEFLAGS flags, P6LICENSE_OPERATION mode)=0
Sets up the object to run properly.
P6LICENSE_OPERATION
These are the supported operations that can be performed on a license.
Definition: p6license.h:39
const P6LICENSEFLAGS P6LICENSE_NOFLAGS
Definition: p6license.h:68
#define P6COMMETHOD
Definition: p6types.h:872
A license property is a name - value pair.
Definition: p6license.h:54
P6UINT32 P6LICENSEFLAGS
P6LICENSEFLAGS.
Definition: p6license.h:67
virtual P6R::P6ERR createLicenseFile(const P6WCHAR *pFilePath)=0
Create a new license file at the "pFilePath" location.
virtual P6R::P6ERR getPropInt(const P6WCHAR *pPropName, P6INT32 *pValue)=0
Retrieve the integer value of the named property in the license that has been successfully verified o...
Interface definition for the cryptographic signature generation and verification. ...
virtual P6R::P6ERR setPropString(const P6WCHAR *pPropName, const P6WCHAR *pValue)=0
Store the string value as a property of the license in the format of "name=value", where pPropName points to a string containing "name".
P6R Cryptographic key interface definitions.