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

DSIGKeyInfoValue.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2004 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  * imitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * DSIGKeyInfoValue := A value setting
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: DSIGKeyInfoValue.hpp,v 1.9 2004/02/08 10:20:51 blautenb Exp $
00025  *
00026  */
00027 
00028 #ifndef DSIGKEYINFOVALUE_INCLUDE
00029 #define DSIGKEYINFOVALUE_INCLUDE
00030 
00031 #include <xsec/utils/XSECSafeBuffer.hpp>
00032 #include <xsec/dsig/DSIGKeyInfo.hpp>
00033 #include <xsec/utils/XSECPlatformUtils.hpp>
00034 
00035 XSEC_DECLARE_XERCES_CLASS(DOMElement);
00036 
00063 class DSIG_EXPORT DSIGKeyInfoValue : public DSIGKeyInfo {
00064 
00065 public:
00066 
00069 
00080     DSIGKeyInfoValue(
00081         const XSECEnv * env, 
00082         XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *valueNode
00083     );
00084 
00094     DSIGKeyInfoValue(const XSECEnv * env);
00095 
00096     virtual ~DSIGKeyInfoValue();
00097 
00099 
00102 
00110     virtual void load(void);
00111 
00118     const XMLCh * getDSAP(void) {return mp_PTextNode->getNodeValue();}
00119 
00126     const XMLCh * getDSAQ(void) {return mp_QTextNode->getNodeValue();}
00127 
00134     const XMLCh * getDSAG(void) {return mp_GTextNode->getNodeValue();}
00135 
00142     const XMLCh * getDSAY(void) {return mp_YTextNode->getNodeValue();}
00143 
00150     const XMLCh * getRSAModulus(void);
00151 
00158     const XMLCh * getRSAExponent(void);
00159 
00161 
00164 
00178     XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankDSAKeyValue(const XMLCh * P,
00179         const XMLCh * Q,
00180         const XMLCh * G,
00181         const XMLCh * Y
00182     );
00183 
00191     void setDSAP(const XMLCh * P);
00192 
00200     void setDSAQ(const XMLCh * Q);
00201 
00209     void setDSAG(const XMLCh * G);
00210 
00218     void setDSAY(const XMLCh * Y);
00219 
00221 
00224 
00235     XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * 
00236         DSIGKeyInfoValue::createBlankRSAKeyValue(const XMLCh * modulus,
00237             const XMLCh * exponent);
00238 
00247     void DSIGKeyInfoValue::setRSAModulus(const XMLCh * modulus);
00248 
00257     void DSIGKeyInfoValue::setRSAExponent(const XMLCh * exponent);
00258 
00260 
00263 
00270     virtual keyInfoType getKeyInfoType(void);
00271 
00278     virtual const XMLCh * getKeyName(void);
00279 
00281 private:
00282 
00283     // Structures to hold ALL the required information
00284     // Not the most efficient of methods, but simple.
00285 
00286     // DSA
00287 
00288     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_PTextNode; // Nodes where strings are stored
00289     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_QTextNode;
00290     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_GTextNode;
00291     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_YTextNode;
00292 
00293     // RSA
00294     
00295     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_modulusTextNode;
00296     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_exponentTextNode;
00297 
00298     // General
00299 
00300     XERCES_CPP_NAMESPACE_QUALIFIER DOMNode  * mp_valueNode;
00301     keyInfoType                             m_keyInfoType;
00302 };
00303 
00304 #endif /* #define DSIGKEYVALUE_INCLUDE */

Generated on Sun Mar 14 20:20:34 2004 for XML-Security-C by doxygen 1.3.2