Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6gencerts.h
Go to the documentation of this file.
1 
11 #ifndef P6GENCERTS_H__
12 #define P6GENCERTS_H__ 1
13 
14 #include "p6cryptokey.h"
15 #include "p6cert.h"
16 
17 namespace P6R {
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
48 typedef enum
49 {
50  RDN_COUNTRY = 0x00,
51  RDN_STATE = 0x01,
52  RDN_LOCALITY = 0x02,
53  RDN_ORG = 0x03,
54  RDN_ORGUNIT = 0x04,
55  RDN_COMMONNAME = 0x05,
56  RDN_EMAIL = 0x06,
57  RDN_GIVENNAME = 0x07,
58  RDN_SURNAME = 0x08,
59  RDN_NAME = 0x09
60 } P6RDNTYPE;
61 
62 
74 typedef struct
75 {
78 } P6CERTRDN;
79 
93 struct extension
94 {
95  P6CHAR* name; // basicConstraints
96  P6CHAR* value; // CA:TRUE
97 };
98 typedef struct extension P6CERTEXTENSION;
99 typedef struct extension P6CRLEXTENSION;
100 
101 
110 const P6GENCERTSFLAGS P6GENCERTS_NOFLAGS = 0x00000000;
111 
112 
118 interface p6IGenCerts : public p6ICom
119 {
130  P6COMMETHOD initialize( P6GENCERTSFLAGS flags ) = 0;
131 
175  P6UINT32 numDN,
176  p6ICryptoKey* pPublicKey,
177  p6ICryptoKey* pPrivateKey,
178  p6ICert* pCACertificate,
179  P6UINT32 secondsToExpire,
180  P6CERTEXTENSION* pExtensionSet,
181  P6UINT32 numExtension,
182  p6ICert** pCertificate ) = 0;
183 
200  P6COMMETHOD verifyCertificate( p6ICert* pCertificate, p6ICert** pCertChain, P6UINT32 numChain, const P6WCHAR* pCrlFile ) = 0;
201 
251  P6COMMETHOD newCrl( P6UINT32 nextInDays,
252  P6UINT32 nextInHours,
253  P6CERTEXTENSION* pExtensionSet,
254  P6UINT32 numExtension,
255  p6ICert* pCACertificate ) = 0;
256 
265  P6COMMETHOD deleteCrl() = 0;
266 
289  P6COMMETHOD revokeCert( P6UINT32 serialNumber,
290  P6UINT16 onYear,
291  P6UINT8 onMonth,
292  P6UINT8 onDay,
293  P6UINT8 onHour,
294  P6UINT8 onMinute,
295  P6UINT8 onSecond ) = 0;
296 
317  P6COMMETHOD genCrlFile( const P6WCHAR* pCrlFile, p6ICryptoKey* pCAPrivateKey ) = 0;
318 
334  P6COMMETHOD printCrl( const P6WCHAR* pPrintToFile, const P6WCHAR* pCrlFile ) = 0;
335 };
336 
337 // {74B7789C-EA87-4c13-B9F3-345DC1E50345}
338 #define IF_p6IGenCerts {0x74b7789c,0xea87,0x4c13,{0xb9,0xf3,0x34,0x5d,0xc1,0xe5,0x3,0x45}}
339 
340 // {58BA3A0E-EA35-40d6-BD2C-F1592559AF5B}
341 #define COMP_p6GenCerts {0x58ba3a0e,0xea35,0x40d6,{0xbd,0x2c,0xf1,0x59,0x25,0x59,0xaf,0x5b}}
342 
343 
344 #ifdef __cplusplus
345 }
346 #endif
347 
348 } // namespace
349 
350 
351 #endif
This interface provides key metadata infrormation and key access.
Definition: p6cryptokey.h:787
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR revokeCert(P6UINT32 serialNumber, P6UINT16 onYear, P6UINT8 onMonth, P6UINT8 onDay, P6UINT8 onHour, P6UINT8 onMinute, P6UINT8 onSecond)=0
Add the revoked (i.e., invalid) certificate to the CRL.
virtual P6R::P6ERR verifyCertificate(p6ICert *pCertificate, p6ICert **pCertChain, P6UINT32 numChain, const P6WCHAR *pCrlFile)=0
This function is used to verify that the Certificate file has been generated by the CA in question an...
unsigned char P6UINT8
Definition: p6types.h:30
P6UINT32 P6GENCERTSFLAGS
P6GENCERTFLAGS.
Definition: p6gencerts.h:109
virtual P6R::P6ERR genCrlFile(const P6WCHAR *pCrlFile, p6ICryptoKey *pCAPrivateKey)=0
Write the composed V2 CRL to the "crlFile" in PEM format.
unsigned short int P6UINT16
Definition: p6types.h:34
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
virtual P6R::P6ERR printCrl(const P6WCHAR *pPrintToFile, const P6WCHAR *pCrlFile)=0
Print the contents of the CRL in parsed form to a file.
P6WCHAR * pValue
Definition: p6gencerts.h:77
This interface provides the capabilities to generate certificates and certificate revocation lists...
Definition: p6gencerts.h:118
A distinguished name (DN) is comprised of one or more relative distinguished names (RDN)...
Definition: p6gencerts.h:74
Interface definition for X509 V3 Certificates.
P6RDNTYPE
Relative Distingushed Name (RDN) components:
Definition: p6gencerts.h:48
virtual P6R::P6ERR genCertificate(P6CERTRDN *pDN, P6UINT32 numDN, p6ICryptoKey *pPublicKey, p6ICryptoKey *pPrivateKey, p6ICert *pCACertificate, P6UINT32 secondsToExpire, P6CERTEXTENSION *pExtensionSet, P6UINT32 numExtension, p6ICert **pCertificate)=0
Generate a X509 V3 certificate binding the pDN and publicKeyFile contents with a signature from the C...
virtual P6R::P6ERR deleteCrl()=0
Free the memory allocated by the newCrl function.
P6CHAR * value
Definition: p6gencerts.h:96
This interface allows the caller to access parts of an X509 V3 certificate for use in protocols and i...
Definition: p6cert.h:180
const P6GENCERTSFLAGS P6GENCERTS_NOFLAGS
Definition: p6gencerts.h:110
virtual P6R::P6ERR initialize(P6GENCERTSFLAGS flags)=0
Sets up the object to run properly.
#define P6COMMETHOD
Definition: p6types.h:872
P6CHAR * name
Definition: p6gencerts.h:95
P6RDNTYPE type
Definition: p6gencerts.h:76
char P6CHAR
Narrow character type.
Definition: p6types.h:71
P6R Cryptographic key interface definitions.
virtual P6R::P6ERR newCrl(P6UINT32 nextInDays, P6UINT32 nextInHours, P6CERTEXTENSION *pExtensionSet, P6UINT32 numExtension, p6ICert *pCACertificate)=0
Create an in-memory image of a certificate revocation list (CRL).