You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by bl...@apache.org on 2006/02/19 12:32:34 UTC
svn commit: r378878 - in /xml/security/trunk/c/src/xkms: ./ impl/
Author: blautenb
Date: Sun Feb 19 03:32:27 2006
New Revision: 378878
URL: http://svn.apache.org/viewcvs?rev=378878&view=rev
Log:
Add Revoke xkms message set
Added:
xml/security/trunk/c/src/xkms/XKMSRevokeKeyBinding.hpp
xml/security/trunk/c/src/xkms/XKMSRevokeRequest.hpp
xml/security/trunk/c/src/xkms/XKMSRevokeResult.hpp
xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.cpp
xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.hpp
xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.cpp
xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.hpp
xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.cpp
xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.hpp
Modified:
xml/security/trunk/c/src/xkms/XKMSCompoundRequest.hpp
xml/security/trunk/c/src/xkms/XKMSCompoundResult.hpp
xml/security/trunk/c/src/xkms/XKMSConstants.cpp
xml/security/trunk/c/src/xkms/XKMSConstants.hpp
xml/security/trunk/c/src/xkms/XKMSMessageAbstractType.hpp
xml/security/trunk/c/src/xkms/XKMSMessageFactory.hpp
xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.cpp
xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.hpp
xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.cpp
xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.hpp
xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.cpp
xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.hpp
Modified: xml/security/trunk/c/src/xkms/XKMSCompoundRequest.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSCompoundRequest.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSCompoundRequest.hpp (original)
+++ xml/security/trunk/c/src/xkms/XKMSCompoundRequest.hpp Sun Feb 19 03:32:27 2006
@@ -34,6 +34,7 @@
class XKMSLocateRequest;
class XKMSValidateRequest;
class XKMSRegisterRequest;
+class XKMSRevokeRequest;
/**
* @ingroup xkms
@@ -161,6 +162,21 @@
*/
virtual XKMSRegisterRequest * createRegisterRequest(
+ const XMLCh * service,
+ const XMLCh * id = NULL) = 0;
+
+ /** \brief Add a RevokeRequest item
+ *
+ * Appends a RevokeRequest to the CompoundRequest object and returns the newly
+ * created object
+ *
+ * @param service URI
+ * @param id Value to set in the Id field. If NULL, the library will
+ * generate a new Unique Id value.
+ * @returns the new XKMSRevokeRequest structure
+ */
+
+ virtual XKMSRevokeRequest * createRevokeRequest(
const XMLCh * service,
const XMLCh * id = NULL) = 0;
Modified: xml/security/trunk/c/src/xkms/XKMSCompoundResult.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSCompoundResult.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSCompoundResult.hpp (original)
+++ xml/security/trunk/c/src/xkms/XKMSCompoundResult.hpp Sun Feb 19 03:32:27 2006
@@ -39,6 +39,8 @@
class XKMSValidateRequest;
class XKMSRegisterRequest;
class XKMSRegisterResult;
+class XKMSRevokeRequest;
+class XKMSRevokeResult;
class XKMSResult;
class XKMSRequestAbstractType;
@@ -207,6 +209,27 @@
virtual XKMSRegisterResult * createRegisterResult(
XKMSRegisterRequest * request,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
+ const XMLCh * id = NULL) = 0;
+
+ /**
+ * \brief Create a new \<RevokeResult\> message.
+ *
+ * Generates a new RevokeResult message from scratch, building the DOM
+ * as it goes. The response will be based on a input RevokeRequest message
+ * which is used to provide Id etc.
+ *
+ * @param request Request to base response on
+ * @param id Value to set in the Id field. If NULL, the library will
+ * @param rmaj Major result code
+ * @param rmin Minor result code
+ * generate a new Unique Id value.
+ * @returns the new XKMSRevokeResult structure
+ */
+
+ virtual XKMSRevokeResult * createRevokeResult(
+ XKMSRevokeRequest * request,
XKMSResultType::ResultMajor rmaj,
XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
const XMLCh * id = NULL) = 0;
Modified: xml/security/trunk/c/src/xkms/XKMSConstants.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSConstants.cpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSConstants.cpp (original)
+++ xml/security/trunk/c/src/xkms/XKMSConstants.cpp Sun Feb 19 03:32:27 2006
@@ -820,6 +820,25 @@
chNull
};
+const XMLCh XKMSConstants::s_tagRevocationCode[] = {
+
+ chLatin_R,
+ chLatin_e,
+ chLatin_v,
+ chLatin_o,
+ chLatin_c,
+ chLatin_a,
+ chLatin_t,
+ chLatin_i,
+ chLatin_o,
+ chLatin_n,
+ chLatin_C,
+ chLatin_o,
+ chLatin_d,
+ chLatin_e,
+ chNull
+};
+
const XMLCh XKMSConstants::s_tagRevocationCodeIdentifier[] = {
chLatin_R,
@@ -846,6 +865,62 @@
chLatin_i,
chLatin_e,
chLatin_r,
+ chNull
+};
+
+const XMLCh XKMSConstants::s_tagRevokeKeyBinding[] = {
+
+ chLatin_R,
+ chLatin_e,
+ chLatin_v,
+ chLatin_o,
+ chLatin_k,
+ chLatin_e,
+ chLatin_K,
+ chLatin_e,
+ chLatin_y,
+ chLatin_B,
+ chLatin_i,
+ chLatin_n,
+ chLatin_d,
+ chLatin_i,
+ chLatin_n,
+ chLatin_g,
+ chNull
+};
+
+const XMLCh XKMSConstants::s_tagRevokeRequest[] = {
+
+ chLatin_R,
+ chLatin_e,
+ chLatin_v,
+ chLatin_o,
+ chLatin_k,
+ chLatin_e,
+ chLatin_R,
+ chLatin_e,
+ chLatin_q,
+ chLatin_u,
+ chLatin_e,
+ chLatin_s,
+ chLatin_t,
+ chNull
+};
+
+const XMLCh XKMSConstants::s_tagRevokeResult[] = {
+
+ chLatin_R,
+ chLatin_e,
+ chLatin_v,
+ chLatin_o,
+ chLatin_k,
+ chLatin_e,
+ chLatin_R,
+ chLatin_e,
+ chLatin_s,
+ chLatin_u,
+ chLatin_l,
+ chLatin_t,
chNull
};
Modified: xml/security/trunk/c/src/xkms/XKMSConstants.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSConstants.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSConstants.hpp (original)
+++ xml/security/trunk/c/src/xkms/XKMSConstants.hpp Sun Feb 19 03:32:27 2006
@@ -97,6 +97,10 @@
static const XMLCh s_tagResultMajor[];
static const XMLCh s_tagResultMinor[];
static const XMLCh s_tagRevocationCodeIdentifier[];
+ static const XMLCh s_tagRevocationCode[];
+ static const XMLCh s_tagRevokeKeyBinding[];
+ static const XMLCh s_tagRevokeRequest[];
+ static const XMLCh s_tagRevokeResult[];
static const XMLCh s_tagService[];
static const XMLCh s_tagSignature[];
static const XMLCh s_tagStatus[];
Modified: xml/security/trunk/c/src/xkms/XKMSMessageAbstractType.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSMessageAbstractType.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSMessageAbstractType.hpp (original)
+++ xml/security/trunk/c/src/xkms/XKMSMessageAbstractType.hpp Sun Feb 19 03:32:27 2006
@@ -112,7 +112,9 @@
/* X-KRSS messages */
RegisterRequest, /** A RegisterReqeust message */
- RegisterResult /** A RegisterResult message */
+ RegisterResult, /** A RegisterResult message */
+ RevokeRequest, /** A RevokeRequest message */
+ RevokeResult /** A RevokeResult message */
};
Modified: xml/security/trunk/c/src/xkms/XKMSMessageFactory.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSMessageFactory.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSMessageFactory.hpp (original)
+++ xml/security/trunk/c/src/xkms/XKMSMessageFactory.hpp Sun Feb 19 03:32:27 2006
@@ -46,6 +46,8 @@
class XKMSStatusResult;
class XKMSRegisterRequest;
class XKMSRegisterResult;
+class XKMSRevokeResult;
+class XKMSRevokeRequest;
XSEC_DECLARE_XERCES_CLASS(DOMElement);
@@ -651,6 +653,96 @@
virtual XKMSRegisterResult * createRegisterResult(
XKMSRegisterRequest * request,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
+ const XMLCh * id = NULL) = 0;
+
+ /**
+ * \brief Create a new \<RevokeRequest\> message.
+ *
+ * Generates a new RevokeRequest message from scratch, building the DOM
+ * as it goes.
+ *
+ * @param service URI
+ * @param doc Document to create the DOM structure within. The caller
+ * will need to embed the DOM structure at the appropriate place in the
+ * document (using a call to getElement to find the top level element)
+ * @param id Value to set in the Id field. If NULL, the library will
+ * generate a new Unique Id value.
+ * @returns the new XKMSRevokeRequest structure
+ */
+
+ virtual XKMSRevokeRequest * createRevokeRequest(
+ const XMLCh * service,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
+ const XMLCh * id = NULL) = 0;
+
+ /**
+ * \brief Create a new \<RevokeRequest\> message and surrounding document
+ *
+ * Generates a new RevokeRequest message from scratch, building the DOM
+ * as it goes.
+ *
+ * @param service URI
+ * @param doc Will be used to return the newly created document element in.
+ * @param id Value to set in the Id field. If NULL, the library will
+ * generate a new Unique Id value.
+ * @returns the new XKMSRevokeRequest structure
+ * @note Like all the xsec library functions, the document is owned by
+ * the calling application. Deleting the RevokeRequest object will not
+ * delete the DOM document as well.
+ */
+
+ virtual XKMSRevokeRequest * createRevokeRequest(
+ const XMLCh * service,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
+ const XMLCh * id = NULL) = 0;
+
+ /**
+ * \brief Create a new \<RevokeResult\> message.
+ *
+ * Generates a new RevokeResult message from scratch, building the DOM
+ * as it goes. The response will be based on a input RevokeRequest message
+ * which is used to provide Id etc.
+ *
+ * @param request Request to base response on
+ * @param doc Will be used to return the newly created document element in.
+ * @param id Value to set in the Id field. If NULL, the library will
+ * generate a new Unique Id value.
+ * @param rmaj Major result code
+ * @param rmin Minor result code
+ * @returns the new XKMSRevokeResponse structure
+ */
+
+ virtual XKMSRevokeResult * createRevokeResult(
+ XKMSRevokeRequest * request,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
+ const XMLCh * id = NULL) = 0;
+
+ /**
+ * \brief Create a new \<RevokeResult\> message and surrounding document
+ *
+ * Generates a new RevokeResult message from scratch, building the DOM
+ * as it goes. The response will be based on a input RevokeRequest message
+ * which is used to provide Id etc.
+ *
+ * @param request Request to base response on
+ * @param doc Will be used to return the newly created document element in.
+ * @param id Value to set in the Id field. If NULL, the library will
+ * generate a new Unique Id value.
+ * @param rmaj Major result code
+ * @param rmin Minor result code
+ * @returns the new XKMSRevokeResponse structure
+ * @note Like all the xsec library functions, the document is owned by
+ * the calling application. Deleting the RevokeRequest object will not
+ * delete the DOM document as well.
+ */
+
+ virtual XKMSRevokeResult * createRevokeResult(
+ XKMSRevokeRequest * request,
XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
XKMSResultType::ResultMajor rmaj,
XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
Added: xml/security/trunk/c/src/xkms/XKMSRevokeKeyBinding.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSRevokeKeyBinding.hpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSRevokeKeyBinding.hpp (added)
+++ xml/security/trunk/c/src/xkms/XKMSRevokeKeyBinding.hpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeKeyBinding := Interface for KeyBinding elements
+ *
+ * $Id:$
+ *
+ */
+
+#ifndef XKMSREVOKEKEYBINDING_INCLUDE
+#define XKMSREVOKEKEYBINDING_INCLUDE
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/xkms/XKMSKeyBindingAbstractType.hpp>
+
+/**
+ * @ingroup xkms
+ */
+
+/**
+ * @brief Interface definition for the RevokeKeyBinding elements
+ *
+ * The \<RevokeKeyBinding\> Element is used in a request to revoke
+ * a particular key from an XKRS service
+ *
+ * The schema definition for RevokeKeyBinding is as follows :
+ *
+ * \verbatim
+ <!-- RevokeKeyBinding -->
+ <element name="RevokeKeyBinding" type="xkms:KeyBindingType"/>
+ <!-- /RevokeKeyBinding -->\endverbatim
+ */
+
+class XKMSStatus;
+
+class XKMSRevokeKeyBinding : public XKMSKeyBindingAbstractType {
+
+ /** @name Constructors and Destructors */
+ //@{
+
+protected:
+
+ XKMSRevokeKeyBinding() {};
+
+public:
+
+ virtual ~XKMSRevokeKeyBinding() {};
+
+ //@}
+
+ /** @name Status handling */
+ //@{
+
+ /**
+ * \brief Obtain the status element for this KeyBinding
+ *
+ * The \<Status\> element is used to describe to the caller the
+ * validity of they key being described. This call is used to
+ * obtain the status element
+ *
+ * @return A pointer to the XKMSStatus element
+ */
+
+ virtual XKMSStatus * getStatus(void) const = 0;
+
+ //@}
+
+private:
+
+ // Unimplemented
+ XKMSRevokeKeyBinding(const XKMSRevokeKeyBinding &);
+ XKMSRevokeKeyBinding & operator = (const XKMSRevokeKeyBinding &);
+
+};
+
+#endif /* XKMSREVOKEKEYBINDING_INCLUDE */
Added: xml/security/trunk/c/src/xkms/XKMSRevokeRequest.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSRevokeRequest.hpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSRevokeRequest.hpp (added)
+++ xml/security/trunk/c/src/xkms/XKMSRevokeRequest.hpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,179 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeRequest := Interface for RegisterRequest Messages
+ *
+ * $Id$
+ *
+ */
+
+#ifndef XKMSREVOKEREQUEST_INCLUDE
+#define XKMSREVOKEREQUEST_INCLUDE
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/xkms/XKMSRequestAbstractType.hpp>
+#include <xsec/xkms/XKMSStatus.hpp>
+
+class DSIGSignature;
+class XKMSAuthentication;
+class XKMSRevokeKeyBinding;
+
+/**
+ * @ingroup xkms
+ */
+
+/**
+ * @brief Interface definition for the RevokeRequest elements
+ *
+ * The \<RevokeRequest\> is one of the message types of
+ * the X-KRMS service. It is used when a client wishes to revoke
+ * a key known to the service.
+ *
+ * The schema definition for RevokeRequest is as follows :
+ *
+ * \verbatim
+ <!-- RevokeRequest -->
+ <element name="RevokeRequest" type="xkms:RevokeRequestType"/>
+ <complexType name="RevokeRequestType">
+ <complexContent>
+ <extension base="xkms:RequestAbstractType">
+ <sequence>
+ <element ref="xkms:RevokeKeyBinding"/>
+ <choice>
+ <element ref="xkms:Authentication"/>
+ <element ref="xkms:RevocationCode"/>
+ </choice>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <element name="RevokeKeyBinding" type="xkms:KeyBindingType"/>
+ <!-- /RevokeRequest -->
+\endverbatim
+ */
+
+class XKMSRevokeRequest : public XKMSRequestAbstractType {
+
+ /** @name Constructors and Destructors */
+ //@{
+
+protected:
+
+ XKMSRevokeRequest() {};
+
+public:
+
+ virtual ~XKMSRevokeRequest() {};
+
+ /** @name Getter Interface Methods */
+ //@{
+
+ /**
+ * \brief Return the element at the base of the message
+ */
+
+ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0;
+
+ /**
+ * \brief Obtain the PrototypKeyBinding element
+ *
+ * The PrototypeKeyBinding element is the core of the RegisterRequest message, and
+ * defines the key information that will be sent to the server for registration.
+ *
+ * @returns A pointer to the XKMSPrototypeKeyBinding element
+ */
+
+ virtual XKMSRevokeKeyBinding * getRevokeKeyBinding(void) const = 0;
+
+ /**
+ * \brief Get the Authentication element
+ *
+ * The Authentication element of the RegisterRequest is used by the client to
+ * authenticate the request to the server.
+ *
+ * @return A pointer to the Authentication structure
+ */
+
+ virtual XKMSAuthentication * getAuthentication (void) const = 0;
+
+ /**
+ * \brief Get the revocation code for the request
+ *
+ * This element is used by the client to provide a MAC of a pass phrase that
+ * proves to the service tha the client has the authority to revoke this
+ * key.
+ *
+ * @return A pointer to string representing the base64 encoded
+ * revocation code, or NULL if none was defined
+ */
+
+ virtual const XMLCh * getRevocationCode(void) const = 0;
+
+ //@}
+
+ /** @name Setter Interface Methods */
+ //@{
+
+ /** \brief Add a RevokeKeyBinding element
+ *
+ * Set a RevokeKeyBinding element in the Request message. The returned
+ * object can be manipulated to add KeyInfo elements to the Request.
+ *
+ * @param status The status value to add into the RevokeKeyBinding structure
+ * @returns A pointer to the newly created RevokeKeyBinding object, or
+ * the pointer to extant object if one already existed.
+ */
+
+ virtual XKMSRevokeKeyBinding * addRevokeKeyBinding(XKMSStatus::StatusValue status) = 0;
+
+ /** \brief Add an Authentication element
+ *
+ * Set a Authentication element in the Request message. The returned
+ * object can be manipulated to add Authentication information to the request.
+ *
+ * @returns A pointer to the newly created Authenticaton object, or
+ * the pointer to extant object if one already existed.
+ */
+
+ virtual XKMSAuthentication * addAuthentication(void) = 0;
+
+ /**
+ * \brief Add a RevocationCode to the message
+ *
+ * Allows the client to add a new Revocation Code string
+ * RevokeRequest element
+ *
+ * @param code the base64 representation of the revocation code
+ */
+
+ virtual void addRevocationCode(const XMLCh * code) = 0;
+
+ //@}
+
+private:
+
+ // Unimplemented
+ XKMSRevokeRequest(const XKMSRevokeRequest &);
+ XKMSRevokeRequest & operator = (const XKMSRevokeRequest &);
+
+};
+
+#endif /* XKMSREVOKEREQUEST_INCLUDE */
Added: xml/security/trunk/c/src/xkms/XKMSRevokeResult.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/XKMSRevokeResult.hpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/XKMSRevokeResult.hpp (added)
+++ xml/security/trunk/c/src/xkms/XKMSRevokeResult.hpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,135 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeResult := Interface for RegisterResult Messages
+ *
+ * $Id:$
+ *
+ */
+
+#ifndef XKMSREVOKERESULT_INCLUDE
+#define XKMSREVOKERESULT_INCLUDE
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/xkms/XKMSResultType.hpp>
+#include <xsec/xkms/XKMSStatus.hpp>
+
+class XKMSKeyBinding;
+
+/**
+ * @ingroup xkms
+ */
+
+/**
+ * @brief Interface definition for the RegisterResult elements
+ *
+ * The \<RegisterResult\> is used by the X-KRSS service to response to
+ * a user request to register a new key with the service.
+ *
+ * The schema definition for RegisterResult is as follows :
+ *
+ * \verbatim
+ <!-- RevokeResult -->
+ <element name="RevokeResult" type="xkms:RevokeResultType"/>
+ <complexType name="RevokeResultType">
+ <complexContent>
+ <extension base="xkms:ResultType">
+ <sequence>
+ <element ref="xkms:KeyBinding" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <!-- /RevokeResult -->
+\endverbatim
+ */
+
+class XKMSRevokeResult : public XKMSResultType {
+
+ /** @name Constructors and Destructors */
+ //@{
+
+protected:
+
+ XKMSRevokeResult() {};
+
+public:
+
+ virtual ~XKMSRevokeResult() {};
+
+ /** @name Getter Interface Methods */
+ //@{
+
+ /**
+ * \brief Return the element at the base of the message
+ */
+
+ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) const = 0;
+
+ //@}
+
+ /** @name KeyBinding handling */
+ //@{
+
+ /**
+ * \brief Find number of KeyBinding elements
+ *
+ * @returns the number of KeyBinding items within the RegisterResult
+ */
+
+ virtual int getKeyBindingSize(void) const = 0;
+
+ /*
+ * \brief Obtain an KeyBinding item
+ *
+ * @param item Index of the item to return (0 = first element)
+ * @returns the KeyBinding referenced by "item"
+ */
+
+ virtual XKMSKeyBinding * getKeyBindingItem(int item) const = 0;
+
+ /*
+ * \brief Append a new KeyBinding element
+ *
+ * Allows callers to append a new KeyBinding item.
+ * The item is initially empty of KeyInfo elements - these must be added
+ * by the caller.
+ *
+ * @param status The status (Valid, Invalid or Indeterminate) of this
+ * key
+ * @returns the newly created KeyBinding object (already inserted
+ * in the RegisterResult
+ */
+
+ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status) = 0;
+
+ //@}
+
+private:
+
+ // Unimplemented
+ XKMSRevokeResult(const XKMSRevokeResult &);
+ XKMSRevokeResult & operator = (const XKMSRevokeResult &);
+
+};
+
+#endif /* XKMSREVOKERESULT_INCLUDE */
Modified: xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.cpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.cpp (original)
+++ xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.cpp Sun Feb 19 03:32:27 2006
@@ -33,6 +33,7 @@
#include "XKMSLocateRequestImpl.hpp"
#include "XKMSValidateRequestImpl.hpp"
#include "XKMSRegisterRequestImpl.hpp"
+#include "XKMSRevokeRequestImpl.hpp"
#include <xercesc/dom/DOM.hpp>
@@ -203,3 +204,17 @@
return r;
}
+
+XKMSRevokeRequest * XKMSCompoundRequestImpl::createRevokeRequest(
+ const XMLCh * service,
+ const XMLCh * id) {
+
+ XKMSRevokeRequest * r = m_factory.createRevokeRequest(service, m_msg.mp_env->getParentDocument(), id);
+ m_requestList.push_back((XKMSRequestAbstractTypeImpl*) r);
+
+ m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement());
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+
+ return r;
+}
+
Modified: xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.hpp (original)
+++ xml/security/trunk/c/src/xkms/impl/XKMSCompoundRequestImpl.hpp Sun Feb 19 03:32:27 2006
@@ -85,6 +85,9 @@
virtual XKMSRegisterRequest * createRegisterRequest(
const XMLCh * service,
const XMLCh * id = NULL);
+ virtual XKMSRevokeRequest * createRevokeRequest(
+ const XMLCh * service,
+ const XMLCh * id = NULL);
/* Forced inheritance from XKMSMessageAbstractTypeImpl */
XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS
Modified: xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.cpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.cpp (original)
+++ xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.cpp Sun Feb 19 03:32:27 2006
@@ -34,6 +34,7 @@
#include "XKMSStatusResultImpl.hpp"
#include "XKMSValidateResultImpl.hpp"
#include "XKMSRegisterResultImpl.hpp"
+#include "XKMSRevokeResultImpl.hpp"
#include "XKMSResultImpl.hpp"
#include <xercesc/dom/DOM.hpp>
@@ -223,6 +224,22 @@
const XMLCh * id) {
XKMSRegisterResult * r = m_factory.createRegisterResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id);
+ m_resultList.push_back((XKMSResultTypeImpl*) r);
+
+ m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement());
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+
+ return r;
+
+}
+
+XKMSRevokeResult * XKMSCompoundResultImpl::createRevokeResult(
+ XKMSRevokeRequest * request,
+ ResultMajor rmaj,
+ ResultMinor rmin,
+ const XMLCh * id) {
+
+ XKMSRevokeResult * r = m_factory.createRevokeResult(request, m_msg.mp_env->getParentDocument(), rmaj, rmin, id);
m_resultList.push_back((XKMSResultTypeImpl*) r);
m_msg.mp_messageAbstractTypeElement->appendChild(r->getElement());
Modified: xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.hpp (original)
+++ xml/security/trunk/c/src/xkms/impl/XKMSCompoundResultImpl.hpp Sun Feb 19 03:32:27 2006
@@ -97,6 +97,11 @@
ResultMajor rmaj,
ResultMinor rmin = XKMSResultTypeImpl::NoneMinor,
const XMLCh * id = NULL);
+ virtual XKMSRevokeResult * createRevokeResult(
+ XKMSRevokeRequest * request,
+ ResultMajor rmaj,
+ ResultMinor rmin = XKMSResultTypeImpl::NoneMinor,
+ const XMLCh * id = NULL);
/* Implemented from MessageAbstractType */
virtual messageType getMessageType(void);
Modified: xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.cpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.cpp (original)
+++ xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.cpp Sun Feb 19 03:32:27 2006
@@ -45,6 +45,8 @@
#include "XKMSPendingRequestImpl.hpp"
#include "XKMSRegisterRequestImpl.hpp"
#include "XKMSRegisterResultImpl.hpp"
+#include "XKMSRevokeResultImpl.hpp"
+#include "XKMSRevokeRequestImpl.hpp"
XERCES_CPP_NAMESPACE_USE
@@ -562,6 +564,46 @@
return rri;
}
+XKMSRevokeRequest * XKMSMessageFactoryImpl::createRevokeRequest(
+ const XMLCh * service,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
+ const XMLCh * id) {
+
+ XKMSRevokeRequestImpl * rri;
+
+ XSECEnv * tenv;
+ XSECnew(tenv, XSECEnv(*mp_env));
+ tenv->setParentDocument(doc);
+
+ XSECnew(rri, XKMSRevokeRequestImpl(tenv));
+ rri->createBlankRevokeRequest(service, id);
+
+ return rri;
+
+}
+
+
+XKMSRevokeRequest * XKMSMessageFactoryImpl::createRevokeRequest(
+ const XMLCh * service,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
+ const XMLCh * id) {
+
+
+ // Create a document to put the element in
+
+ XMLCh tempStr[100];
+ XMLString::transcode("Core", tempStr, 99);
+ DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
+
+ *doc = impl->createDocument();
+
+ // Embed the new structure in the document
+ XKMSRevokeRequest * rri = createRevokeRequest(service, *doc, id);
+ (*doc)->appendChild(rri->getElement());
+
+ return rri;
+}
+
// --------------------------------------------------------------------------------
// Create a result based on a request
// --------------------------------------------------------------------------------
@@ -830,6 +872,50 @@
return rr;
}
+
+XKMSRevokeResult * XKMSMessageFactoryImpl::createRevokeResult(
+ XKMSRevokeRequest * request,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin,
+ const XMLCh * id) {
+
+ XKMSRevokeResultImpl * rri;
+
+ XSECEnv * tenv;
+ XSECnew(tenv, XSECEnv(*mp_env));
+ tenv->setParentDocument(doc);
+
+ XSECnew(rri, XKMSRevokeResultImpl(tenv));
+ rri->createBlankRevokeResult(request->getService(), id, rmaj, rmin);
+
+ copyRequestToResult(request, (XKMSResultTypeImpl*) rri);
+
+ return rri;
+
+}
+
+XKMSRevokeResult * XKMSMessageFactoryImpl::createRevokeResult(
+ XKMSRevokeRequest * request,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin,
+ const XMLCh * id) {
+
+ // Create a document to put the element in
+
+ XMLCh tempStr[100];
+ XMLString::transcode("Core", tempStr, 99);
+ DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
+
+ *doc = impl->createDocument();
+
+ // Embed the new structure in the document
+ XKMSRevokeResult * rr = createRevokeResult(request, *doc, rmaj, rmin, id);
+ (*doc)->appendChild(rr->getElement());
+
+ return rr;
+}
// --------------------------------------------------------------------------------
// Message Conversions
Modified: xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.hpp?rev=378878&r1=378877&r2=378878&view=diff
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.hpp (original)
+++ xml/security/trunk/c/src/xkms/impl/XKMSMessageFactoryImpl.hpp Sun Feb 19 03:32:27 2006
@@ -180,6 +180,28 @@
const XMLCh * id = NULL);
+ virtual XKMSRevokeRequest * createRevokeRequest(
+ const XMLCh * service,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
+ const XMLCh * id = NULL);
+ virtual XKMSRevokeRequest * createRevokeRequest(
+ const XMLCh * service,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
+ const XMLCh * id = NULL);
+
+ virtual XKMSRevokeResult * createRevokeResult(
+ XKMSRevokeRequest * request,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * doc,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
+ const XMLCh * id = NULL);
+ virtual XKMSRevokeResult * createRevokeResult(
+ XKMSRevokeRequest * request,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument **doc,
+ XKMSResultType::ResultMajor rmaj,
+ XKMSResultType::ResultMinor rmin = XKMSResultType::NoneMinor,
+ const XMLCh * id = NULL);
+
/* Conversions */
virtual XKMSRequestAbstractType * toRequestAbstractType(XKMSMessageAbstractType *msg);
virtual XKMSResultType * toResultType(XKMSMessageAbstractType *msg);
Added: xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.cpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.cpp (added)
+++ xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.cpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeKeyBindingImpl := Implementation for RevokeKeyBinding
+ *
+ * $Id:$
+ *
+ */
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/framework/XSECError.hpp>
+#include <xsec/framework/XSECEnv.hpp>
+#include <xsec/xkms/XKMSConstants.hpp>
+
+#include <xercesc/dom/DOM.hpp>
+
+#include "XKMSRevokeKeyBindingImpl.hpp"
+#include "XKMSStatusImpl.hpp"
+
+XERCES_CPP_NAMESPACE_USE
+
+// --------------------------------------------------------------------------------
+// Construct/Destruct
+// --------------------------------------------------------------------------------
+
+XKMSRevokeKeyBindingImpl::XKMSRevokeKeyBindingImpl(
+ const XSECEnv * env
+ ) :
+XKMSKeyBindingAbstractTypeImpl(env) {
+ mp_status = NULL;
+}
+
+XKMSRevokeKeyBindingImpl::XKMSRevokeKeyBindingImpl(
+ const XSECEnv * env,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node
+ ) :
+XKMSKeyBindingAbstractTypeImpl(env, node) {
+
+ mp_status = NULL;
+}
+
+XKMSRevokeKeyBindingImpl::~XKMSRevokeKeyBindingImpl() {
+
+ if (mp_status != NULL)
+ delete mp_status;
+
+}
+
+// --------------------------------------------------------------------------------
+// Load from DOM
+// --------------------------------------------------------------------------------
+
+void XKMSRevokeKeyBindingImpl::load(void) {
+
+ if (mp_keyBindingAbstractTypeElement == NULL) {
+ throw XSECException(XSECException::ExpectedXKMSChildNotFound,
+ "XKMSRevokeKeyBindingImpl::load - called on empty DOM");
+ }
+
+ XKMSKeyBindingAbstractTypeImpl::load();
+
+ /* Find the status element */
+ DOMNodeList * nl = mp_keyBindingAbstractTypeElement->getElementsByTagNameNS(
+ XKMSConstants::s_unicodeStrURIXKMS,
+ XKMSConstants::s_tagStatus);
+
+ if (nl == NULL || nl->getLength() != 1) {
+ throw XSECException(XSECException::ExpectedXKMSChildNotFound,
+ "XKMSRevokeKeyBinding::load - Status value not found");
+ }
+
+ XSECnew(mp_status, XKMSStatusImpl(mp_env, (DOMElement*) nl->item(0)));
+ mp_status->load();
+
+}
+
+// --------------------------------------------------------------------------------
+// Create
+// --------------------------------------------------------------------------------
+
+DOMElement * XKMSRevokeKeyBindingImpl::createBlankRevokeKeyBinding(XKMSStatus::StatusValue status) {
+
+ DOMElement * ret = XKMSKeyBindingAbstractTypeImpl::
+ createBlankKeyBindingAbstractType(XKMSConstants::s_tagRevokeKeyBinding);
+
+ mp_env->doPrettyPrint(ret);
+
+ // Create the status element
+ XSECnew(mp_status, XKMSStatusImpl(mp_env));
+ ret->appendChild(mp_status->createBlankStatus(status));
+ mp_env->doPrettyPrint(ret);
+
+ return ret;
+
+}
+
+// --------------------------------------------------------------------------------
+// Status handling
+// --------------------------------------------------------------------------------
+
+XKMSStatus * XKMSRevokeKeyBindingImpl::getStatus(void) const {
+
+ return mp_status;
+
+}
+
Added: xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.hpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.hpp (added)
+++ xml/security/trunk/c/src/xkms/impl/XKMSRevokeKeyBindingImpl.hpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeKeyBinding := Implementation for RevokeKeyBinding
+ *
+ * $Id:$
+ *
+ */
+
+#ifndef XKMSREVOKEKEYBINDINGIMPL_INCLUDE
+#define XKMSREVOKEKEYBINDINGIMPL_INCLUDE
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/xkms/XKMSRevokeKeyBinding.hpp>
+#include <xsec/xkms/XKMSStatus.hpp>
+
+#include "XKMSKeyBindingAbstractTypeImpl.hpp"
+
+class XKMSStatusImpl;
+
+class XKMSRevokeKeyBindingImpl : public XKMSRevokeKeyBinding, public XKMSKeyBindingAbstractTypeImpl {
+
+public:
+
+ XKMSRevokeKeyBindingImpl(
+ const XSECEnv * env
+ );
+
+ XKMSRevokeKeyBindingImpl(
+ const XSECEnv * env,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node
+ );
+
+ virtual ~XKMSRevokeKeyBindingImpl() ;
+
+ // Load
+ void load(void);
+
+ // Create
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
+ createBlankRevokeKeyBinding(XKMSStatus::StatusValue status);
+
+ // Interface
+ virtual XKMSStatus * getStatus(void) const;
+
+ // Import methods from XKMSKeyBindingAbstractType
+ XKMS_KEYBINDINGABSTRACTYPE_IMPL_METHODS
+
+private:
+
+ XKMSStatusImpl * mp_status;
+
+ // Unimplemented
+ XKMSRevokeKeyBindingImpl(void);
+ XKMSRevokeKeyBindingImpl(const XKMSRevokeKeyBindingImpl &);
+ XKMSRevokeKeyBindingImpl & operator = (const XKMSRevokeKeyBindingImpl &);
+
+};
+
+#endif /* XKMSREVOKEKEYBINDINGIMPL_INCLUDE */
Added: xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.cpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.cpp (added)
+++ xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.cpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,296 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeRequestImpl := Implementation for RegisterRequest Messages
+ *
+ * $Id:$
+ *
+ */
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+
+#include <xsec/dsig/DSIGReference.hpp>
+#include <xsec/framework/XSECEnv.hpp>
+#include <xsec/framework/XSECError.hpp>
+#include <xsec/utils/XSECDOMUtils.hpp>
+#include <xsec/xkms/XKMSConstants.hpp>
+#include <xsec/xkms/XKMSStatus.hpp>
+
+#include "XKMSRevokeRequestImpl.hpp"
+#include "XKMSRevokeKeyBindingImpl.hpp"
+#include "XKMSAuthenticationImpl.hpp"
+
+#include <xercesc/dom/DOM.hpp>
+#include <xercesc/util/XMLUniDefs.hpp>
+
+XERCES_CPP_NAMESPACE_USE
+
+// --------------------------------------------------------------------------------
+// Construct/Destruct
+// --------------------------------------------------------------------------------
+
+XKMSRevokeRequestImpl::XKMSRevokeRequestImpl(const XSECEnv * env) :
+m_request(env),
+m_msg(m_request.m_msg),
+mp_authentication(NULL),
+mp_revokeKeyBinding(NULL),
+mp_revocationCodeElement(NULL) {
+}
+
+XKMSRevokeRequestImpl::XKMSRevokeRequestImpl(const XSECEnv * env, DOMElement * node) :
+m_request(env, node),
+m_msg(m_request.m_msg),
+mp_authentication(NULL),
+mp_revokeKeyBinding(NULL),
+mp_revocationCodeElement(NULL) {
+}
+
+XKMSRevokeRequestImpl::~XKMSRevokeRequestImpl() {
+
+ if (mp_authentication != NULL)
+ delete mp_authentication;
+ if (mp_revokeKeyBinding != NULL)
+ delete mp_revokeKeyBinding;
+
+}
+
+// --------------------------------------------------------------------------------
+// Load
+// --------------------------------------------------------------------------------
+
+void XKMSRevokeRequestImpl::load(void) {
+
+ if (m_msg.mp_messageAbstractTypeElement == NULL) {
+
+ // Attempt to load an empty element
+ throw XSECException(XSECException::XKMSError,
+ "XKMSRevokeRequest::load - called on empty DOM");
+
+ }
+
+ if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement),
+ XKMSConstants::s_tagRevokeRequest)) {
+
+ throw XSECException(XSECException::XKMSError,
+ "XKMSRevokeRequest::load - called on incorrect node");
+
+ }
+
+ // Load the base message
+ m_request.load();
+
+ // Now check for any RevokeKeyBinding elements
+ DOMElement * tmpElt = findFirstElementChild(m_msg.mp_messageAbstractTypeElement);
+ while (tmpElt != NULL && !strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRevokeKeyBinding)) {
+ tmpElt = findNextElementChild(tmpElt);
+ }
+
+ if (tmpElt != NULL) {
+
+ XSECnew(mp_revokeKeyBinding, XKMSRevokeKeyBindingImpl(m_msg.mp_env, tmpElt));
+ mp_revokeKeyBinding->load();
+
+ tmpElt = findNextElementChild(tmpElt);
+
+ }
+ else {
+
+ throw XSECException(XSECException::ExpectedXKMSChildNotFound,
+ "XKMSRevokeRequest::load - Expected RevokeKeyBinding node");
+
+ }
+
+ // Authentication Element | RevocationCode Element
+
+ if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagAuthentication)) {
+
+ XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env, tmpElt));
+ mp_authentication->load(mp_revokeKeyBinding->getId());
+
+ }
+ else if (tmpElt != NULL && strEquals(getXKMSLocalName(tmpElt), XKMSConstants::s_tagRevocationCode)) {
+
+ mp_revocationCodeElement = tmpElt;
+
+ }
+ else {
+
+ throw XSECException(XSECException::ExpectedXKMSChildNotFound,
+ "XKMSRevokeRequest::load - Expected Authentication or RevocationCode nodes");
+
+ }
+
+}
+
+
+// --------------------------------------------------------------------------------
+// Create
+// --------------------------------------------------------------------------------
+
+DOMElement * XKMSRevokeRequestImpl::
+ createBlankRevokeRequest(const XMLCh * service, const XMLCh * id) {
+
+ return m_request.createBlankRequestAbstractType(
+ XKMSConstants::s_tagRevokeRequest, service, id);
+
+}
+
+// --------------------------------------------------------------------------------
+// MessageType
+// --------------------------------------------------------------------------------
+
+XKMSMessageAbstractType::messageType XKMSRevokeRequestImpl::getMessageType(void) {
+
+ return XKMSMessageAbstractTypeImpl::RevokeRequest;
+
+}
+
+// --------------------------------------------------------------------------------
+// Get Methods
+// --------------------------------------------------------------------------------
+
+XKMSRevokeKeyBinding * XKMSRevokeRequestImpl::getRevokeKeyBinding(void) const {
+
+ return mp_revokeKeyBinding;
+
+}
+
+XKMSAuthentication * XKMSRevokeRequestImpl::getAuthentication (void) const {
+
+ return mp_authentication;
+
+}
+
+const XMLCh * XKMSRevokeRequestImpl::getRevocationCode(void) const {
+
+ if (mp_revocationCodeElement == NULL)
+ return NULL;
+
+ DOMNode * t = findFirstChildOfType(mp_revocationCodeElement, DOMNode::TEXT_NODE);
+
+ if (t == NULL) {
+ throw XSECException(XSECException::ExpectedXKMSChildNotFound,
+ "XKMSRevokeRequestImpl::getRevocationCode - expected TEXT node");
+ }
+
+ return t->getNodeValue();
+}
+
+// --------------------------------------------------------------------------------
+// Set Methods
+// --------------------------------------------------------------------------------
+
+XKMSRevokeKeyBinding * XKMSRevokeRequestImpl::addRevokeKeyBinding(XKMSStatus::StatusValue status) {
+
+ if (mp_revokeKeyBinding != NULL)
+ return mp_revokeKeyBinding;
+
+
+ // OK - Nothing exists, so we need to create from scratch
+
+ XSECnew(mp_revokeKeyBinding, XKMSRevokeKeyBindingImpl(m_msg.mp_env));
+ DOMElement * elt = mp_revokeKeyBinding->createBlankRevokeKeyBinding(status);
+
+ // Insert
+
+ DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement);
+
+ while (be != NULL &&
+ !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagAuthentication) &&
+ !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagRevocationCode)) {
+ be = findNextElementChild(be);
+ }
+
+ if (be == NULL) {
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+ m_msg.mp_messageAbstractTypeElement->appendChild(elt);
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+ return mp_revokeKeyBinding;
+ }
+
+ m_msg.mp_messageAbstractTypeElement->insertBefore(elt, be);
+ if (m_msg.mp_env->getPrettyPrintFlag() == true) {
+ m_msg.mp_messageAbstractTypeElement->insertBefore(
+ m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL),
+ be);
+ }
+
+ return mp_revokeKeyBinding;
+
+}
+
+XKMSAuthentication * XKMSRevokeRequestImpl::addAuthentication(void) {
+
+ if (mp_authentication != NULL)
+ return mp_authentication;
+
+ if (mp_revokeKeyBinding == NULL) {
+ throw XSECException(XSECException::XKMSError,
+ "XKMSRevokeRequestImpl::addAuthentication - called prior to key infos being added");
+ }
+
+ XSECnew(mp_authentication, XKMSAuthenticationImpl(m_msg.mp_env));
+ DOMElement * e =
+ mp_authentication->createBlankAuthentication(mp_revokeKeyBinding->getId());
+
+ DOMElement * be = findFirstElementChild(m_msg.mp_messageAbstractTypeElement);
+
+ while (be != NULL && !strEquals(getXKMSLocalName(be), XKMSConstants::s_tagRevocationCode))
+ be = findNextElementChild(be);
+
+ if (be == NULL) {
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+ m_msg.mp_messageAbstractTypeElement->appendChild(e);
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+ return mp_authentication;
+ }
+
+ m_msg.mp_messageAbstractTypeElement->insertBefore(e, be);
+ if (m_msg.mp_env->getPrettyPrintFlag() == true) {
+ m_msg.mp_messageAbstractTypeElement->insertBefore(
+ m_msg.mp_env->getParentDocument()->createTextNode(DSIGConstants::s_unicodeStrNL),
+ be);
+ }
+
+ return mp_authentication;
+
+}
+
+void XKMSRevokeRequestImpl::addRevocationCode(const XMLCh * code) {
+
+ safeBuffer str;
+ DOMDocument *doc = m_msg.mp_env->getParentDocument();
+ const XMLCh * prefix = m_msg.mp_env->getXKMSNSPrefix();
+
+ makeQName(str, prefix, XKMSConstants::s_tagRevocationCode);
+
+ mp_revocationCodeElement = doc->createElementNS(XKMSConstants::s_unicodeStrURIXKMS,
+ str.rawXMLChBuffer());
+
+ m_msg.mp_messageAbstractTypeElement->appendChild(mp_revocationCodeElement);
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+
+ mp_revocationCodeElement->appendChild(
+ m_msg.mp_env->getParentDocument()->createTextNode(code));
+
+}
+
+
Added: xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.hpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.hpp (added)
+++ xml/security/trunk/c/src/xkms/impl/XKMSRevokeRequestImpl.hpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeRequestImpl := Implementation for RevokeRequest Messages
+ *
+ * $Id:$
+ *
+ */
+
+#ifndef XKMSREVOKEREQUESTIMPL_INCLUDE
+#define XKMSREVOKEREQUESTIMPL_INCLUDE
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/xkms/XKMSRevokeRequest.hpp>
+#include "XKMSRequestAbstractTypeImpl.hpp"
+
+class XKMSAuthenticationImpl;
+class DSIGSignature;
+class XKMSRevokeKeyBindingImpl;
+
+class XKMSRevokeRequestImpl : public XKMSRevokeRequest {
+
+public:
+ XKMSRequestAbstractTypeImpl m_request;
+ XKMSMessageAbstractTypeImpl &m_msg;
+public:
+
+ XKMSRevokeRequestImpl(
+ const XSECEnv * env
+ );
+
+ XKMSRevokeRequestImpl(
+ const XSECEnv * env,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node
+ );
+
+ virtual ~XKMSRevokeRequestImpl();
+
+ // Load elements
+ void load();
+
+ // Creation
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
+ createBlankRevokeRequest(
+ const XMLCh * service,
+ const XMLCh * id = NULL);
+
+
+ /* Getter Interface Methods */
+ virtual XKMSRevokeKeyBinding * getRevokeKeyBinding(void) const;
+ virtual XKMSAuthentication * getAuthentication (void) const;
+ virtual const XMLCh * getRevocationCode(void) const;
+
+ /* Setter Interface Methods */
+
+ virtual XKMSRevokeKeyBinding * addRevokeKeyBinding(XKMSStatus::StatusValue status);
+ virtual XKMSAuthentication * addAuthentication(void);
+ virtual void addRevocationCode(const XMLCh * code);
+
+
+ /* Implemented from MessageAbstractType */
+ virtual messageType getMessageType(void);
+
+ /* Forced inheritance from XKMSMessageAbstractTypeImpl */
+ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS
+
+ /* Forced inheritance from RequestAbstractType */
+ XKMS_REQUESTABSTRACTYPE_IMPL_METHODS
+
+
+private:
+
+ XKMSAuthenticationImpl * mp_authentication;
+ XKMSRevokeKeyBindingImpl * mp_revokeKeyBinding;
+ XERCES_CPP_NAMESPACE_QUALIFIER
+ DOMElement * mp_revocationCodeElement;
+
+ XSECProvider m_prov; // For creating the signature
+
+ // Unimplemented
+ XKMSRevokeRequestImpl(void);
+ XKMSRevokeRequestImpl(const XKMSRevokeRequestImpl &);
+ XKMSRevokeRequestImpl & operator = (const XKMSRevokeRequestImpl &);
+
+};
+
+#endif /* XKMSREVOKEREQUESTIMPL_INCLUDE */
+
Added: xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.cpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.cpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.cpp (added)
+++ xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.cpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeResultImpl := Implementation of RegisterResult Messages
+ *
+ * $Id:$
+ *
+ */
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/framework/XSECError.hpp>
+#include <xsec/framework/XSECEnv.hpp>
+#include <xsec/utils/XSECDOMUtils.hpp>
+#include <xsec/xkms/XKMSConstants.hpp>
+
+#include "XKMSRevokeResultImpl.hpp"
+#include "XKMSKeyBindingImpl.hpp"
+
+#include <xercesc/dom/DOM.hpp>
+
+XERCES_CPP_NAMESPACE_USE
+
+// --------------------------------------------------------------------------------
+// Construct/Destruct
+// --------------------------------------------------------------------------------
+
+XKMSRevokeResultImpl::XKMSRevokeResultImpl(
+ const XSECEnv * env) :
+m_result(env),
+m_msg(m_result.m_msg) {
+
+}
+
+XKMSRevokeResultImpl::XKMSRevokeResultImpl(
+ const XSECEnv * env,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node) :
+m_result(env, node),
+m_msg(m_result.m_msg) {
+
+}
+
+XKMSRevokeResultImpl::~XKMSRevokeResultImpl() {
+
+ XKMSRevokeResultImpl::KeyBindingVectorType::iterator i;
+
+ for (i = m_keyBindingList.begin() ; i < m_keyBindingList.end(); i++) {
+
+ delete (*i);
+
+ }
+
+}
+
+
+// --------------------------------------------------------------------------------
+// Load from DOM
+// --------------------------------------------------------------------------------
+
+// Load elements
+void XKMSRevokeResultImpl::load() {
+
+ if (m_msg.mp_messageAbstractTypeElement == NULL) {
+
+ // Attempt to load an empty element
+ throw XSECException(XSECException::XKMSError,
+ "XKMSRevokeResult::load - called on empty DOM");
+
+ }
+
+ if (!strEquals(getXKMSLocalName(m_msg.mp_messageAbstractTypeElement),
+ XKMSConstants::s_tagRevokeResult)) {
+
+ throw XSECException(XSECException::XKMSError,
+ "XKMSRevokeResult::load - called incorrect node");
+
+ }
+
+ // Get any UnverifiedKeyBinding elements
+ DOMNodeList * nl = m_msg.mp_messageAbstractTypeElement->getElementsByTagNameNS(
+ XKMSConstants::s_unicodeStrURIXKMS,
+ XKMSConstants::s_tagKeyBinding);
+
+ if (nl != NULL) {
+
+ XKMSKeyBindingImpl * kb;
+ for (unsigned int i = 0; i < nl->getLength() ; ++ i) {
+
+ XSECnew(kb, XKMSKeyBindingImpl(m_msg.mp_env, (DOMElement *) nl->item(i)));
+ m_keyBindingList.push_back(kb);
+ kb->load();
+
+ }
+
+ }
+
+
+ // Load the base message
+ m_result.load();
+
+}
+
+// --------------------------------------------------------------------------------
+// Create a blank one
+// --------------------------------------------------------------------------------
+DOMElement * XKMSRevokeResultImpl::createBlankRevokeResult(
+ const XMLCh * service,
+ const XMLCh * id,
+ ResultMajor rmaj,
+ ResultMinor rmin) {
+
+ return m_result.createBlankResultType(
+ XKMSConstants::s_tagRevokeResult, service, id, rmaj, rmin);
+
+}
+
+// --------------------------------------------------------------------------------
+// Get interface methods
+// --------------------------------------------------------------------------------
+
+XKMSMessageAbstractType::messageType XKMSRevokeResultImpl::getMessageType(void) {
+
+ return XKMSMessageAbstractTypeImpl::RevokeResult;
+
+}
+
+// --------------------------------------------------------------------------------
+// UnverifiedKeyBinding handling
+// --------------------------------------------------------------------------------
+
+
+int XKMSRevokeResultImpl::getKeyBindingSize(void) const {
+
+ return (int) m_keyBindingList.size();
+
+}
+
+XKMSKeyBinding * XKMSRevokeResultImpl::getKeyBindingItem(int item) const {
+
+ if (item < 0 || item >= (int) m_keyBindingList.size()) {
+ throw XSECException(XSECException::XKMSError,
+ "XKMSRevokeResult::getKeyBindingItem - item out of range");
+ }
+
+ return m_keyBindingList[item];
+
+}
+
+XKMSKeyBinding * XKMSRevokeResultImpl::appendKeyBindingItem(XKMSStatus::StatusValue status) {
+
+ XKMSKeyBindingImpl * u;
+
+ XSECnew(u, XKMSKeyBindingImpl(m_msg.mp_env));
+
+ m_keyBindingList.push_back(u);
+
+ DOMElement * e = u->createBlankKeyBinding(status);
+
+ // Append the element
+
+ m_msg.mp_messageAbstractTypeElement->appendChild(e);
+ m_msg.mp_env->doPrettyPrint(m_msg.mp_messageAbstractTypeElement);
+
+ return u;
+
+}
+
Added: xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.hpp
URL: http://svn.apache.org/viewcvs/xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.hpp?rev=378878&view=auto
==============================================================================
--- xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.hpp (added)
+++ xml/security/trunk/c/src/xkms/impl/XKMSRevokeResultImpl.hpp Sun Feb 19 03:32:27 2006
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * XSEC
+ *
+ * XKMSRevokeResultImpl := Implementation of RegisterResult Messages
+ *
+ * $Id: XKMSRevokeResultImpl.hpp 351366 2005-06-04 11:44:55Z blautenb $
+ *
+ */
+
+#ifndef XKMSREVOKERESULTIMPL_INCLUDE
+#define XKMSREVOKERESULTIMPL_INCLUDE
+
+// XSEC Includes
+
+#include <xsec/framework/XSECDefs.hpp>
+#include <xsec/xkms/XKMSRevokeResult.hpp>
+
+#include "XKMSResultTypeImpl.hpp"
+
+#include <vector>
+
+class XKMSKeyBindingImpl;
+
+class XKMSRevokeResultImpl : public XKMSRevokeResult {
+
+public:
+ XKMSResultTypeImpl m_result;
+ XKMSMessageAbstractTypeImpl &m_msg;
+public:
+
+ XKMSRevokeResultImpl(
+ const XSECEnv * env
+ );
+
+ XKMSRevokeResultImpl(
+ const XSECEnv * env,
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node
+ );
+
+ virtual ~XKMSRevokeResultImpl();
+
+ // Load elements
+ void load();
+
+ // Creation
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
+ createBlankRevokeResult(
+ const XMLCh * service,
+ const XMLCh * id,
+ ResultMajor rmaj,
+ ResultMinor rmin);
+
+ // Interface methods
+ virtual int getKeyBindingSize(void) const;
+ virtual XKMSKeyBinding * getKeyBindingItem(int item) const;
+ virtual XKMSKeyBinding * appendKeyBindingItem(XKMSStatus::StatusValue status);
+
+
+ /* Implemented from MessageAbstractType */
+ virtual messageType getMessageType(void);
+
+ /* Forced inheritance from XKMSMessageAbstractTypeImpl */
+ XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS
+
+ /* Forced inheritance from XKMSResultTypeImpl */
+ XKMS_RESULTTYPE_IMPL_METHODS
+
+private:
+
+#if defined(XSEC_NO_NAMESPACES)
+ typedef vector<XKMSKeyBindingImpl *> KeyBindingVectorType;
+#else
+ typedef std::vector<XKMSKeyBindingImpl *> KeyBindingVectorType;
+#endif
+
+ KeyBindingVectorType m_keyBindingList;
+
+ // Unimplemented
+ XKMSRevokeResultImpl(void);
+ XKMSRevokeResultImpl(const XKMSRevokeResultImpl &);
+ XKMSRevokeResultImpl & operator = (const XKMSRevokeResultImpl &);
+
+};
+
+#endif /* XKMSREVOKERESULTIMPL_INCLUDE */