00001 /* 00002 * Copyright 2004-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 * XKMSKeyBindingAbstractType := Interface for base schema of XKMS messages 00021 * 00022 * $Id: XKMSKeyBindingAbstractType.hpp,v 1.6 2005/06/04 11:30:26 blautenb Exp $ 00023 * 00024 */ 00025 00026 #ifndef XKMSKEYBINDINGABSTRACTTYPE_INCLUDE 00027 #define XKMSKEYBINDINGABSTRACTTYPE_INCLUDE 00028 00029 // XSEC Includes 00030 00031 #include <xsec/framework/XSECDefs.hpp> 00032 00033 class DSIGKeyInfoList; 00034 class DSIGKeyInfoMgmtData; 00035 class DSIGKeyInfoName; 00036 class DSIGKeyInfoPGPData; 00037 class DSIGKeyInfoSPKIData; 00038 class DSIGKeyInfoValue; 00039 class DSIGKeyInfoX509; 00040 class XKMSUseKeyWith; 00041 00042 XSEC_DECLARE_XERCES_CLASS(DOMElement); 00043 00072 class XKMSKeyBindingAbstractType { 00073 00076 00077 protected: 00078 00079 XKMSKeyBindingAbstractType() {}; 00080 00081 public: 00082 00083 virtual ~XKMSKeyBindingAbstractType() {}; 00084 00087 00088 /* 00089 * \brief Obtain the base Element for this structure 00090 * 00091 * @returns the Element node at the head of the DOM structure 00092 */ 00093 00094 virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0; 00095 00106 virtual const XMLCh * getId(void) const = 0; 00107 00117 virtual DSIGKeyInfoList * getKeyInfoList(void) const = 0; 00118 00128 virtual bool getEncryptionKeyUsage(void) const = 0; 00129 00139 virtual bool getSignatureKeyUsage(void) const = 0; 00140 00150 virtual bool getExchangeKeyUsage(void) const = 0; 00151 00153 00156 00166 virtual void setId(const XMLCh * id = NULL) = 0; 00167 00178 virtual void setEncryptionKeyUsage(void) = 0; 00179 00190 virtual void setSignatureKeyUsage(void) = 0; 00191 00202 virtual void setExchangeKeyUsage(void) = 0; 00203 00205 00209 00220 virtual DSIGKeyInfoList * getKeyInfoList(void) = 0; 00221 00230 virtual void clearKeyInfo(void) = 0; 00231 00244 virtual DSIGKeyInfoValue * appendDSAKeyValue(const XMLCh * P, 00245 const XMLCh * Q, 00246 const XMLCh * G, 00247 const XMLCh * Y) = 0; 00248 00259 virtual DSIGKeyInfoValue * appendRSAKeyValue(const XMLCh * modulus, 00260 const XMLCh * exponent) = 0; 00261 00273 virtual DSIGKeyInfoX509 * appendX509Data(void) = 0; 00274 00285 virtual DSIGKeyInfoName * appendKeyName(const XMLCh * name, bool isDName = false) = 0; 00286 00298 virtual DSIGKeyInfoPGPData * appendPGPData(const XMLCh * id, const XMLCh * packet) = 0; 00299 00309 virtual DSIGKeyInfoSPKIData * appendSPKIData(const XMLCh * sexp) = 0; 00310 00320 virtual DSIGKeyInfoMgmtData * appendMgmtData(const XMLCh * data) = 0; 00321 00323 00326 00333 virtual int getUseKeyWithSize(void) const = 0; 00334 00335 /* 00336 * \brief Obtain an UseKeyWith item 00337 * 00338 * @param item Index of the item to return (0 = first element) 00339 * @returns the UseKeyWith referenced by "item" 00340 */ 00341 00342 virtual XKMSUseKeyWith * getUseKeyWithItem(int item) const = 0; 00343 00344 /* 00345 * \brief Append a new UnverifiedKeyBinding element 00346 * 00347 * Allows callers to append a new UnverifiedKeyBinding item. 00348 * The item is initially empty of KeyInfo elements - these must be added 00349 * by the caller. 00350 * 00351 * @returns the newly created UnverifiedKeyBinding object (already inserted 00352 * in the LocateResult 00353 */ 00354 00355 virtual XKMSUseKeyWith * appendUseKeyWithItem( 00356 const XMLCh * application, 00357 const XMLCh * identifier) = 0; 00358 00360 00361 private: 00362 00363 // Unimplemented 00364 XKMSKeyBindingAbstractType(const XKMSKeyBindingAbstractType &); 00365 XKMSKeyBindingAbstractType & operator = (const XKMSKeyBindingAbstractType &); 00366 00367 }; 00368 00369 #endif /* XKMSKEYBINDINGABSTRACTTYPE_INCLUDE */