Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

DSIGSignedInfo.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * DSIGSignature := Class for checking and setting up signature nodes in a DSIG signature
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: DSIGSignedInfo.hpp 351395 2005-07-23 02:11:54Z blautenb $
00025  *
00026  */
00027 
00028 #ifndef DSIGSIGNEDINFO_INCLUDE
00029 #define DSIGSIGNEDINFO_INCLUDE
00030 
00031 // XSEC Includes
00032 #include <xsec/framework/XSECDefs.hpp>
00033 #include <xsec/utils/XSECSafeBufferFormatter.hpp>
00034 #include <xsec/dsig/DSIGConstants.hpp>
00035 #include <xsec/dsig/DSIGReferenceList.hpp>
00036 
00037 // Xerces Includes
00038 
00039 XSEC_DECLARE_XERCES_CLASS(DOMDocument);
00040 XSEC_DECLARE_XERCES_CLASS(DOMNode);
00041 XSEC_DECLARE_XERCES_CLASS(DOMElement);
00042 
00043 // General includes
00044 
00045 #include <vector>
00046 
00047 class XSECEnv;
00048 
00064 class DSIG_EXPORT DSIGSignedInfo {
00065 
00066 public:
00067 
00070 
00083     DSIGSignedInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, 
00084         XSECSafeBufferFormatter * pFormatter, 
00085         XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *signedInfoNode,
00086         const XSECEnv * env);
00087 
00088 
00100     DSIGSignedInfo(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc,
00101                 XSECSafeBufferFormatter * pFormatter, 
00102                 const XSECEnv * env);
00103 
00111     ~DSIGSignedInfo();
00112 
00114 
00117 
00127     void load(void);
00128 
00138     bool verify(safeBuffer &errStr);
00139 
00151     void hash(bool interlockingReferences);
00152 
00166     XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
00167         createBlankSignedInfo(
00168             const XMLCh * canonicalizationAlgorithmURI,
00169             const XMLCh * signatureAlgorithmURI
00170         );
00171 
00186     XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
00187         createBlankSignedInfo(canonicalizationMethod cm,
00188             signatureMethod sm,
00189             hashMethod hm
00190         );
00191 
00203     DSIGReference * createReference(const XMLCh * URI,
00204         hashMethod hm, char * type);
00205 
00206 
00217     DSIGReference * createReference(
00218         const XMLCh * URI,
00219         const XMLCh * hashAlgorithmURI, 
00220         const XMLCh * type
00221     );
00222 
00224 
00227 
00234     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getDOMNode(void);
00235 
00243     const XMLCh * getAlgorithmURI() {return mp_algorithmURI;}
00244 
00251     canonicalizationMethod getCanonicalizationMethod(void);
00252 
00259     hashMethod getHashMethod(void);
00260 
00267     signatureMethod getSignatureMethod(void);
00268 
00276     int getHMACOutputLength(void);
00277 
00285     DSIGReferenceList *getReferenceList (void) {return mp_referenceList;}
00286 
00288 
00289 
00290 private:
00291 
00292     XSECSafeBufferFormatter     * mp_formatter;
00293     bool                        m_loaded;               // Have we already loaded?
00294     XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument                  
00295                                 * mp_doc;
00296     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode                      
00297                                 * mp_signedInfoNode;
00298     canonicalizationMethod      m_canonicalizationMethod;
00299     signatureMethod             m_signatureMethod;
00300     hashMethod                  m_hashMethod;
00301     DSIGReferenceList           * mp_referenceList;
00302     int                         m_HMACOutputLength;
00303     const XMLCh                 * mp_algorithmURI;
00304     const XSECEnv               * mp_env;
00305 
00306     // Not implemented constructors
00307 
00308     DSIGSignedInfo();
00309     // DSIGSignedInfo & operator= (const DSIGSignedInfo &);
00310 
00311 };
00312 
00313 
00314 #endif /* DSIGSIGNEDINFO_INCLUDE */

Generated on Sun Jan 28 19:37:22 2007 for XML-Security-C by  doxygen 1.4.2