blautenb 2003/12/28 17:14:51
Modified: c/src/xenc XENCCipherData.hpp
c/src/xenc/impl XENCCipherDataImpl.cpp
XENCCipherDataImpl.hpp
Log:
Encryption code cleanup and documentation
Revision Changes Path
1.5 +13 -2 xml-security/c/src/xenc/XENCCipherData.hpp
Index: XENCCipherData.hpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/xenc/XENCCipherData.hpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XENCCipherData.hpp 10 Nov 2003 22:10:37 -0000 1.4
+++ XENCCipherData.hpp 29 Dec 2003 01:14:50 -0000 1.5
@@ -92,6 +92,17 @@
* data, an XENCEncryptedType derivative object of XENCCipher object
* should be used.
*
+ * The schema for CipherData is as follows:
+ *
+ * \verbatim
+<element name='CipherData' type='xenc:CipherDataType'/>
+ <complexType name='CipherDataType'>
+ <choice>
+ <element name='CipherValue' type='base64Binary'/>
+ <element ref='xenc:CipherReference'/>
+ </choice>
+ </complexType>
+\endverbatim
*/
@@ -160,7 +171,7 @@
* @returns the DOM Node representing the <CipherData> element
*/
- virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getDOMNode(void) = 0;
+ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void) =
0;
//@}
1.10 +8 -8 xml-security/c/src/xenc/impl/XENCCipherDataImpl.cpp
Index: XENCCipherDataImpl.cpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/xenc/impl/XENCCipherDataImpl.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XENCCipherDataImpl.cpp 23 Nov 2003 09:12:44 -0000 1.9
+++ XENCCipherDataImpl.cpp 29 Dec 2003 01:14:50 -0000 1.10
@@ -140,16 +140,16 @@
XENCCipherDataImpl::XENCCipherDataImpl(const XSECEnv * env) :
mp_env(env),
-mp_cipherDataNode(NULL),
+mp_cipherDataElement(NULL),
mp_cipherValue(NULL),
mp_cipherReference(NULL) {
}
-XENCCipherDataImpl::XENCCipherDataImpl(const XSECEnv * env, DOMNode * node) :
+XENCCipherDataImpl::XENCCipherDataImpl(const XSECEnv * env, DOMElement *
node) :
mp_env(env),
-mp_cipherDataNode(node),
+mp_cipherDataElement(node),
mp_cipherValue(NULL),
mp_cipherReference(NULL) {
@@ -170,7 +170,7 @@
void XENCCipherDataImpl::load() {
- if (mp_cipherDataNode == NULL) {
+ if (mp_cipherDataElement == NULL) {
// Attempt to load an empty encryptedType element
throw XSECException(XSECException::CipherDataError,
@@ -178,7 +178,7 @@
}
- if (!strEquals(getXENCLocalName(mp_cipherDataNode), s_CipherData)) {
+ if (!strEquals(getXENCLocalName(mp_cipherDataElement), s_CipherData)) {
throw XSECException(XSECException::CipherDataError,
"XENCCipherData::load - called incorrect node");
@@ -188,7 +188,7 @@
// Find out whether this is a CipherValue or CipherReference and load
// appropriately
- DOMElement *tmpElt = findFirstElementChild(mp_cipherDataNode);
+ DOMElement *tmpElt = findFirstElementChild(mp_cipherDataElement);
if (tmpElt != NULL && strEquals(getXENCLocalName(tmpElt),
s_CipherValue)) {
@@ -239,7 +239,7 @@
makeQName(str, prefix, s_CipherData);
DOMElement *ret =
doc->createElementNS(DSIGConstants::s_unicodeStrURIXENC, str.rawXMLChBuffer());
- mp_cipherDataNode = ret;
+ mp_cipherDataElement = ret;
mp_env->doPrettyPrint(ret);
1.7 +6 -6 xml-security/c/src/xenc/impl/XENCCipherDataImpl.hpp
Index: XENCCipherDataImpl.hpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/xenc/impl/XENCCipherDataImpl.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XENCCipherDataImpl.hpp 10 Nov 2003 22:10:37 -0000 1.6
+++ XENCCipherDataImpl.hpp 29 Dec 2003 01:14:50 -0000 1.7
@@ -88,7 +88,7 @@
XENCCipherDataImpl(const XSECEnv * env);
XENCCipherDataImpl(
const XSECEnv * env,
- XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * node
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node
);
virtual ~XENCCipherDataImpl();
@@ -104,8 +104,8 @@
virtual XENCCipherDataType getCipherDataType(void);
virtual XENCCipherValue * getCipherValue(void);
virtual XENCCipherReference * getCipherReference(void);
- virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * getDOMNode(void)
- {return mp_cipherDataNode;}
+ virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * getElement(void)
+ {return mp_cipherDataElement;}
private:
@@ -114,8 +114,8 @@
XENCCipherDataImpl();
const XSECEnv * mp_env;
- XERCES_CPP_NAMESPACE_QUALIFIER DOMNode
- * mp_cipherDataNode;
// Node at head of structure
+ XERCES_CPP_NAMESPACE_QUALIFIER DOMElement
+ * mp_cipherDataElement;
// Node at head of structure
XENCCipherDataType m_cipherDataType;
// Is this a value or a reference?
XENCCipherValueImpl * mp_cipherValue;
// Cipher value node