00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef DSIGKEYINFOLIST_INCLUDE
00027 #define DSIGKEYINFOLIST_INCLUDE
00028
00029
00030
00031 #include <xsec/framework/XSECDefs.hpp>
00032 #include <xsec/dsig/DSIGKeyInfo.hpp>
00033 #include <xsec/utils/XSECSafeBufferFormatter.hpp>
00034 #include <xsec/enc/XSECCryptoKey.hpp>
00035
00036
00037 #include <xercesc/dom/DOM.hpp>
00038
00039
00040 #include <vector>
00041
00042
00043 class DSIGKeyInfoValue;
00044 class DSIGKeyInfoX509;
00045 class DSIGKeyInfoName;
00046 class DSIGKeyInfoPGPData;
00047 class DSIGKeyInfoSPKIData;
00048 class DSIGKeyInfoMgmtData;
00049 class DSIGSignature;
00050
00062 class DSIG_EXPORT DSIGKeyInfoList {
00063
00064 public:
00065
00066 #if defined(XSEC_NO_NAMESPACES)
00067 typedef vector<DSIGKeyInfo *> KeyInfoListVectorType;
00068 #else
00069 typedef std::vector<DSIGKeyInfo *> KeyInfoListVectorType;
00070 #endif
00071
00072 #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD)
00073 typedef std::size_t size_type;
00074 #else
00075 typedef size_t size_type;
00076 #endif
00077
00080
00091 DSIGKeyInfoList(const XSECEnv * env);
00092
00097 ~DSIGKeyInfoList();
00098
00100
00103
00110 size_t getSize();
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 DSIGKeyInfo * item(size_type index);
00124
00126
00129
00141 void addKeyInfo(DSIGKeyInfo * ref);
00142
00154 void addAndInsertKeyInfo(DSIGKeyInfo * ref);
00155
00168 bool addXMLKeyInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *ki);
00169
00182 bool loadListFromXML(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node);
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 DSIGKeyInfo * removeKeyInfo(size_type index);
00194
00203 void setEnvironment(const XSECEnv * env) {mp_env = env;}
00204
00213 void empty();
00214
00221 bool isEmpty();
00222
00224
00227
00235 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
00236 DSIGKeyInfoList::createKeyInfo(void);
00237
00250 DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P,
00251 const XMLCh * Q,
00252 const XMLCh * G,
00253 const XMLCh * Y);
00254
00265 DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus,
00266 const XMLCh * exponent);
00267
00279 DSIGKeyInfoX509 * appendX509Data(void);
00280
00291 DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false);
00292
00304 DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet);
00305
00315 DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp);
00316
00326 DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data);
00327
00329
00330 private:
00331
00332 DSIGKeyInfoList();
00333
00334 KeyInfoListVectorType m_keyInfoList;
00335 const XSECEnv * mp_env;
00336 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyInfoNode;
00337
00338 };
00339
00340
00341 #endif