X509.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (c) 2006 by Autodesk, Inc.
00003 //
00004 //  By using this code, you are agreeing to the terms and conditions of
00005 //  the License Agreement included in the documentation for this code.
00006 //
00007 //  AUTODESK MAKES NO WARRANTIES, EXPRESS OR IMPLIED, AS TO THE CORRECTNESS
00008 //  OF THIS CODE OR ANY DERIVATIVE WORKS WHICH INCORPORATE IT. AUTODESK
00009 //  PROVIDES THE CODE ON AN "AS-IS" BASIS AND EXPLICITLY DISCLAIMS ANY
00010 //  LIABILITY, INCLUDING CONSEQUENTIAL AND INCIDENTAL DAMAGES FOR ERRORS,
00011 //  OMISSIONS, AND OTHER PROBLEMS IN THE CODE.
00012 //
00013 //  Use, duplication, or disclosure by the U.S. Government is subject to
00014 //  restrictions set forth in FAR 52.227-19 (Commercial Computer Software
00015 //  Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) (Rights in Technical
00016 //  Data and Computer Software), as applicable.
00017 //
00018 //  $Header: //DWF/Development/Components/Internal/DWF Toolkit/v7.6/develop/global/src/dwf/package/X509.h#2 $
00019 //  $DateTime: 2008/06/18 18:08:14 $
00020 //  $Author: gaoje $
00021 //  $Change: 101166 $
00022 //  $Revision: #2 $
00023 //
00024 
00025 #ifndef _DWFTK_X509_H
00026 #define _DWFTK_X509_H
00027 
00032 
00033 #include "dwfcore/STL.h"
00034 #include "dwfcore/Vector.h"
00035 #include "dwfcore/SkipList.h"
00036 using namespace DWFCore;
00037 
00038 #include "dwf/Toolkit.h"
00039 
00040 
00041 
00042 namespace DWFToolkit
00043 {
00044 
00045 
00046 
00047 
00055 class X509DataItem
00056 {
00057 public:
00063     _DWFTK_API
00064     X509DataItem()
00065         throw()
00066     {
00067     }
00068 
00074     _DWFTK_API
00075     virtual ~X509DataItem()
00076         throw()
00077     {
00078     }
00079 
00080 #ifndef DWFTK_READ_ONLY
00081 
00082     //
00083     // Serializes just the data item
00084     //
00085     _DWFTK_API
00086     virtual void serialize( DWFXMLSerializer& /*rSerializer*/, const DWFString& /*zNamespace*/ )
00087         throw( DWFException )
00088     {;}
00089 
00090 #endif
00091 
00092 private:
00093 };
00094 
00102 class X509IssuerSerial : public X509DataItem
00103 {
00104 public:
00110     _DWFTK_API
00111     X509IssuerSerial()
00112         throw()
00113         : _zX509IssuerName("")
00114         ,_nX509SerialNumber(-1)
00115     {
00116     }
00117 
00123     _DWFTK_API
00124     virtual ~X509IssuerSerial()
00125         throw()
00126     {
00127     }
00128 
00135     virtual const DWFString& issuerName() const
00136         throw()
00137     {
00138         return _zX509IssuerName;
00139     }
00140 
00147     virtual void setIssuerName(const DWFString& zName)
00148         throw()
00149     {
00150         _zX509IssuerName = zName;
00151     }
00152 
00159     virtual const long serialNumber() const
00160         throw()
00161     {
00162         return _nX509SerialNumber;
00163     }
00164 
00171     virtual void setSerialNumber(const long nNumber)
00172         throw()
00173     {
00174         _nX509SerialNumber = nNumber;
00175     }
00176 
00177 #ifndef DWFTK_READ_ONLY
00178 
00179     //
00180     // Serializes just the data item
00181     //
00182     _DWFTK_API
00183     virtual void serialize( DWFXMLSerializer& rSerializer, const DWFString& zNamespace )
00184         throw( DWFException );
00185 
00186 #endif
00187 
00188 private:
00189     DWFString   _zX509IssuerName;
00190     long        _nX509SerialNumber;
00191 
00192 };
00193 
00201 class X509SKI : public X509DataItem
00202 {
00203 public:
00209     _DWFTK_API
00210     X509SKI()
00211         throw()
00212         : _zSubjectKeyIdentifier()
00213     {
00214     }
00215 
00221     _DWFTK_API
00222     virtual ~X509SKI()
00223         throw()
00224     {
00225     }
00226 
00233     virtual const DWFString& subjectKeyIdentifier () const
00234         throw()
00235     {
00236         return _zSubjectKeyIdentifier;
00237     }
00238 
00245     virtual void setSubjectKeyIdentifier(const DWFString& zSubjectKeyIdentifier )
00246         throw()
00247     {
00248         _zSubjectKeyIdentifier  = zSubjectKeyIdentifier ;
00249     }
00250 
00251 #ifndef DWFTK_READ_ONLY
00252 
00253     //
00254     // Serializes just the data item
00255     //
00256     _DWFTK_API
00257     virtual void serialize( DWFXMLSerializer& rSerializer, const DWFString& zNamespace )
00258         throw( DWFException );
00259 
00260 #endif
00261 
00262 private:
00263     DWFString   _zSubjectKeyIdentifier;
00264 };
00265 
00273 class X509SubjectName : public X509DataItem
00274 {
00275 public:
00281     _DWFTK_API
00282     X509SubjectName()
00283         throw()
00284         : _zName()
00285     {
00286     }
00287 
00293     _DWFTK_API
00294     virtual ~X509SubjectName()
00295         throw()
00296     {
00297     }
00298 
00305     virtual const DWFString& subjectName() const
00306         throw()
00307     {
00308         return _zName;
00309     }
00310 
00317     virtual void setSubjectName(const DWFString& zName)
00318         throw()
00319     {
00320         _zName = zName;
00321     }
00322 
00323 #ifndef DWFTK_READ_ONLY
00324 
00325     //
00326     // Serializes just the data item
00327     //
00328     _DWFTK_API
00329     virtual void serialize( DWFXMLSerializer& rSerializer, const DWFString& zNamespace )
00330         throw( DWFException );
00331 
00332 #endif
00333 
00334 private:
00335     DWFString _zName;
00336 };
00337 
00345 class X509Certificate : public X509DataItem
00346 {
00347 public:
00353     _DWFTK_API
00354     X509Certificate()
00355         throw()
00356         : _zCert()
00357     {
00358     }
00359 
00365     _DWFTK_API
00366     virtual ~X509Certificate()
00367         throw()
00368     {
00369     }
00370 
00377     virtual const DWFString& certificate() const
00378         throw()
00379     {
00380         return _zCert;
00381     }
00382 
00389     virtual void setCertificate(const DWFString& zCert)
00390         throw()
00391     {
00392         _zCert = zCert;
00393     }
00394 
00395 #ifndef DWFTK_READ_ONLY
00396 
00397     //
00398     // Serializes just the data item
00399     //
00400     _DWFTK_API
00401     virtual void serialize( DWFXMLSerializer& rSerializer, const DWFString& zNamespace )
00402         throw( DWFException );
00403 
00404 #endif
00405 
00406 private:
00407     DWFString _zCert;
00408 };
00409 
00410 
00418 class X509CRL : public X509DataItem
00419 {
00420 public:
00426     _DWFTK_API
00427     X509CRL()
00428         throw()
00429     {
00430     }
00431 
00437     _DWFTK_API
00438     virtual ~X509CRL()
00439         throw()
00440     {
00441     }
00442 
00449     virtual const DWFString& CRL() const
00450         throw()
00451     {
00452         return _zCRL;
00453     }
00454 
00461     virtual void setCRL(const DWFString& zCRL)
00462         throw()
00463     {
00464         _zCRL = zCRL;
00465     }
00466 
00467 #ifndef DWFTK_READ_ONLY
00468 
00469     //
00470     // Serializes just the data item
00471     //
00472     _DWFTK_API
00473     virtual void serialize( DWFXMLSerializer& rSerializer, const DWFString& zNamespace )
00474         throw( DWFException );
00475 
00476 #endif
00477 
00478 private:
00479     DWFString   _zCRL;
00480 };
00481 
00489 class X509Data
00490 {
00491 public:
00495     typedef DWFOrderedVector<X509DataItem*>   tX509DataItemVector;
00496 
00497 public:
00503     _DWFTK_API
00504     X509Data()
00505         throw()
00506         : _oDataItemVector()
00507     {
00508     }
00509 
00515     _DWFTK_API
00516     virtual ~X509Data()
00517         throw();
00518 
00525     _DWFTK_API
00526     virtual void addDataItem(X509DataItem* pDataItem)
00527         throw()
00528     {
00529         _oDataItemVector.push_back(pDataItem);
00530     }
00531 
00532     
00539     _DWFTK_API
00540     virtual tX509DataItemVector::Iterator* dataItems()
00541         throw()
00542     {
00543         return _oDataItemVector.iterator();
00544     }
00545 
00546 #ifndef DWFTK_READ_ONLY
00547 
00548     //
00549     // Serializes all the data items
00550     //
00551     _DWFTK_API
00552     virtual void serialize( DWFXMLSerializer& rSerializer, const DWFString& zNamespace )
00553         throw( DWFException );
00554 
00555 #endif
00556 
00557 private:
00558     tX509DataItemVector _oDataItemVector;
00559 };
00560 
00561 }
00562 
00563 #endif
00564 

Generated on Tue Jan 6 22:40:05 2009 for Autodesk DWF Toolkit by  doxygen 1.4.5