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
00061 class DSIG_EXPORT DSIGKeyInfoList {
00062
00063 public:
00064
00065 #if defined(XSEC_NO_NAMESPACES)
00066 typedef vector<DSIGKeyInfo *> KeyInfoListVectorType;
00067 #else
00068 typedef std::vector<DSIGKeyInfo *> KeyInfoListVectorType;
00069 #endif
00070
00071 #if defined(XSEC_SIZE_T_IN_NAMESPACE_STD)
00072 typedef std::size_t size_type;
00073 #else
00074 typedef size_t size_type;
00075 #endif
00076
00079
00090 DSIGKeyInfoList(const XSECEnv * env);
00091
00096 ~DSIGKeyInfoList();
00097
00099
00102
00109 size_t getSize();
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122 DSIGKeyInfo * item(size_type index);
00123
00125
00128
00140 void addKeyInfo(DSIGKeyInfo * ref);
00141
00153 void addAndInsertKeyInfo(DSIGKeyInfo * ref);
00154
00167 bool addXMLKeyInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *ki);
00168
00181 bool loadListFromXML(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node);
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192 DSIGKeyInfo * removeKeyInfo(size_type index);
00193
00202 void setEnvironment(const XSECEnv * env) {mp_env = env;}
00203
00212 void empty();
00213
00220 bool isEmpty();
00221
00223
00226
00234 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
00235 DSIGKeyInfoList::createKeyInfo(void);
00236
00249 DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P,
00250 const XMLCh * Q,
00251 const XMLCh * G,
00252 const XMLCh * Y);
00253
00264 DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus,
00265 const XMLCh * exponent);
00266
00278 DSIGKeyInfoX509 * appendX509Data(void);
00279
00290 DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false);
00291
00303 DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet);
00304
00314 DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp);
00315
00325 DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data);
00326
00328
00329 private:
00330
00331 DSIGKeyInfoList();
00332
00333 KeyInfoListVectorType m_keyInfoList;
00334 const XSECEnv * mp_env;
00335 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_keyInfoNode;
00336
00337 };
00338
00339
00340 #endif