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 * DSIGKeyInfoValue := A value setting 00021 * 00022 * Author(s): Berin Lautenbach 00023 * 00024 * $Id: DSIGKeyInfoValue.hpp,v 1.13 2005/06/04 11:30:25 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 00062 class DSIG_EXPORT DSIGKeyInfoValue : public DSIGKeyInfo { 00063 00064 public: 00065 00068 00079 DSIGKeyInfoValue( 00080 const XSECEnv * env, 00081 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *valueNode 00082 ); 00083 00093 DSIGKeyInfoValue(const XSECEnv * env); 00094 00095 virtual ~DSIGKeyInfoValue(); 00096 00098 00101 00109 virtual void load(void); 00110 00117 const XMLCh * getDSAP(void) {return mp_PTextNode->getNodeValue();} 00118 00125 const XMLCh * getDSAQ(void) {return mp_QTextNode->getNodeValue();} 00126 00133 const XMLCh * getDSAG(void) {return mp_GTextNode->getNodeValue();} 00134 00141 const XMLCh * getDSAY(void) {return mp_YTextNode->getNodeValue();} 00142 00149 const XMLCh * getRSAModulus(void); 00150 00157 const XMLCh * getRSAExponent(void); 00158 00160 00163 00177 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * createBlankDSAKeyValue(const XMLCh * P, 00178 const XMLCh * Q, 00179 const XMLCh * G, 00180 const XMLCh * Y 00181 ); 00182 00190 void setDSAP(const XMLCh * P); 00191 00199 void setDSAQ(const XMLCh * Q); 00200 00208 void setDSAG(const XMLCh * G); 00209 00217 void setDSAY(const XMLCh * Y); 00218 00220 00223 00234 XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * 00235 DSIGKeyInfoValue::createBlankRSAKeyValue(const XMLCh * modulus, 00236 const XMLCh * exponent); 00237 00246 void DSIGKeyInfoValue::setRSAModulus(const XMLCh * modulus); 00247 00256 void DSIGKeyInfoValue::setRSAExponent(const XMLCh * exponent); 00257 00259 00262 00269 virtual keyInfoType getKeyInfoType(void); 00270 00277 virtual const XMLCh * getKeyName(void); 00278 00280 private: 00281 00282 // Structures to hold ALL the required information 00283 // Not the most efficient of methods, but simple. 00284 00285 // DSA 00286 00287 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_PTextNode; // Nodes where strings are stored 00288 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_QTextNode; 00289 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_GTextNode; 00290 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_YTextNode; 00291 00292 // RSA 00293 00294 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_modulusTextNode; 00295 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_exponentTextNode; 00296 00297 // General 00298 00299 keyInfoType m_keyInfoType; 00300 }; 00301 00302 #endif /* #define DSIGKEYVALUE_INCLUDE */