You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2018/03/06 19:15:52 UTC
svn commit: r1826027 - in /santuario/xml-security-cpp/trunk/xsec/xenc: ./
impl/
Author: scantor
Date: Tue Mar 6 19:15:52 2018
New Revision: 1826027
URL: http://svn.apache.org/viewvc?rev=1826027&view=rev
Log:
Expose factory methods to allow creation of impl objects.
Modified:
santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherData.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherReference.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherValue.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedData.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedKey.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptionMethod.hpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherDataImpl.cpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherReferenceImpl.cpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherValueImpl.cpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedDataImpl.cpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedKeyImpl.cpp
santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptionMethodImpl.cpp
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherData.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherData.hpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherData.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherData.hpp Tue Mar 6 19:15:52 2018
@@ -36,6 +36,8 @@
#include <xsec/xenc/XENCCipherValue.hpp>
#include <xsec/xenc/XENCCipherReference.hpp>
+class XSECEnv;
+
/**
* @ingroup xenc
*/
@@ -92,6 +94,25 @@ public:
virtual ~XENCCipherData() {};
+
+ /**
+ * \brief Create a new object.
+ *
+ * Create a new object.
+ *
+ * @param env environment instance
+ * @param type type of cipher data
+ * @param algorithm algorithm to use
+ * @param value value to use
+ *
+ * @returns the new object
+ */
+ static XENCCipherData* create(
+ const XSECEnv* env,
+ XENCCipherData::XENCCipherDataType type,
+ const XMLCh * value);
+
+
/** @name Get Interface Methods */
//@{
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherReference.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherReference.hpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherReference.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherReference.hpp Tue Mar 6 19:15:52 2018
@@ -34,6 +34,7 @@
#include <xsec/framework/XSECDefs.hpp>
#include <xsec/dsig/DSIGConstants.hpp>
+class XSECEnv;
class DSIGTransformList;
class DSIGTransformBase64;
class DSIGTransformXPath;
@@ -93,6 +94,18 @@ public:
virtual ~XENCCipherReference() {};
+ /**
+ * \brief Create a new object.
+ *
+ * Create a new object.
+ *
+ * @param env environment instance
+ * @param URI reference
+ *
+ * @returns the new object
+ */
+ static XENCCipherReference* create(const XSECEnv* env, const XMLCh* URI);
+
/** @name Get Interface Methods */
//@{
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherValue.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherValue.hpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherValue.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/XENCCipherValue.hpp Tue Mar 6 19:15:52 2018
@@ -33,6 +33,8 @@
#include <xsec/framework/XSECDefs.hpp>
+class XSECEnv;
+
XSEC_DECLARE_XERCES_CLASS(DOMElement);
/**
@@ -61,6 +63,20 @@ public:
virtual ~XENCCipherValue() {};
+ /**
+ * \brief Create a new object.
+ *
+ * Create a new object.
+ *
+ * @param env environment instance
+ * @param value value to use
+ *
+ * @returns the new object
+ */
+ static XENCCipherValue* create(
+ const XSECEnv* env,
+ const XMLCh * value);
+
/** @name Get Interface Methods */
//@{
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedData.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedData.hpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedData.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedData.hpp Tue Mar 6 19:15:52 2018
@@ -36,6 +36,8 @@
#include <xsec/xenc/XENCEncryptedType.hpp>
#include <xsec/xenc/XENCCipherData.hpp>
+class XSECEnv;
+
/**
* @ingroup xenc
*/
@@ -78,6 +80,25 @@ public:
virtual ~XENCEncryptedData() {};
+
+ /**
+ * \brief Create a new object.
+ *
+ * Create a new object.
+ *
+ * @param env environment instance
+ * @param type type of cipher data
+ * @param algorithm algorithm to use
+ * @param value value to use
+ *
+ * @returns the new object
+ */
+ static XENCEncryptedData* create(
+ const XSECEnv* env,
+ XENCCipherData::XENCCipherDataType type,
+ const XMLCh * algorithm,
+ const XMLCh * value);
+
/** @name Get Interface Methods */
//@{
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedKey.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedKey.hpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedKey.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptedKey.hpp Tue Mar 6 19:15:52 2018
@@ -36,6 +36,8 @@
#include <xsec/xenc/XENCEncryptedType.hpp>
#include <xsec/xenc/XENCCipherData.hpp>
+class XSECEnv;
+
/**
* @ingroup xenc
*/
@@ -86,6 +88,24 @@ public:
virtual ~XENCEncryptedKey() {};
+ /**
+ * \brief Create a new object.
+ *
+ * Create a new object.
+ *
+ * @param env environment instance
+ * @param type type of cipher data
+ * @param algorithm algorithm to use
+ * @param value value to use
+ *
+ * @returns the new object
+ */
+ static XENCEncryptedKey* create(
+ const XSECEnv* env,
+ XENCCipherData::XENCCipherDataType type,
+ const XMLCh * algorithm,
+ const XMLCh * value);
+
/** @name EncryptedKey Specific Getter Methods */
//@{
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptionMethod.hpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptionMethod.hpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptionMethod.hpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/XENCEncryptionMethod.hpp Tue Mar 6 19:15:52 2018
@@ -33,6 +33,8 @@
#include <xsec/framework/XSECDefs.hpp>
+class XSECEnv;
+
/**
* @ingroup xenc
*/
@@ -70,6 +72,19 @@ public:
virtual ~XENCEncryptionMethod() {};
+
+ /**
+ * \brief Create a new object.
+ *
+ * Create a new object.
+ *
+ * @param env environment instance
+ * @param algorithm algorithm to use
+ *
+ * @returns the new object
+ */
+ static XENCEncryptionMethod* create(const XSECEnv* env, const XMLCh* algorithm);
+
/** @name Getter Methods */
//@{
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherDataImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherDataImpl.cpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherDataImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherDataImpl.cpp Tue Mar 6 19:15:52 2018
@@ -95,6 +95,19 @@ static XMLCh s_CipherReference[] = {
chNull,
};
+XENCCipherData* XENCCipherData::create(
+ const XSECEnv* env,
+ XENCCipherData::XENCCipherDataType type,
+ const XMLCh * value)
+{
+
+ XENCCipherDataImpl* ret = new XENCCipherDataImpl(env);
+ if (!ret)
+ throw XSECException(XSECException::MemoryAllocationFail);
+ ret->createBlankCipherData(type, value);
+ return ret;
+}
+
// --------------------------------------------------------------------------------
// Constructors and Destructors
// --------------------------------------------------------------------------------
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherReferenceImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherReferenceImpl.cpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherReferenceImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherReferenceImpl.cpp Tue Mar 6 19:15:52 2018
@@ -86,6 +86,16 @@ static XMLCh s_Transforms[] = {
chNull
};
+XENCCipherReference* XENCCipherReference::create(const XSECEnv* env, const XMLCh * URI)
+{
+
+ XENCCipherReferenceImpl* ret = new XENCCipherReferenceImpl(env);
+ if (!ret)
+ throw XSECException(XSECException::MemoryAllocationFail);
+ ret->createBlankCipherReference(URI);
+ return ret;
+}
+
// --------------------------------------------------------------------------------
// Constructors/Destructors
// --------------------------------------------------------------------------------
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherValueImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherValueImpl.cpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherValueImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCCipherValueImpl.cpp Tue Mar 6 19:15:52 2018
@@ -60,6 +60,18 @@ static XMLCh s_CipherValue[] = {
chNull,
};
+XENCCipherValue* XENCCipherValue::create(
+ const XSECEnv* env,
+ const XMLCh * value)
+{
+
+ XENCCipherValueImpl* ret = new XENCCipherValueImpl(env);
+ if (!ret)
+ throw XSECException(XSECException::MemoryAllocationFail);
+ ret->createBlankCipherValue(value);
+ return ret;
+}
+
// --------------------------------------------------------------------------------
// Constructors/Destructors
// --------------------------------------------------------------------------------
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedDataImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedDataImpl.cpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedDataImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedDataImpl.cpp Tue Mar 6 19:15:52 2018
@@ -61,6 +61,20 @@ static XMLCh s_EncryptedData[] = {
chNull,
};
+XENCEncryptedData* XENCEncryptedData::create(
+ const XSECEnv* env,
+ XENCCipherData::XENCCipherDataType type,
+ const XMLCh * algorithm,
+ const XMLCh * value)
+{
+
+ XENCEncryptedDataImpl* ret = new XENCEncryptedDataImpl(env);
+ if (!ret)
+ throw XSECException(XSECException::MemoryAllocationFail);
+ ret->createBlankEncryptedData(type, algorithm, value);
+ return ret;
+}
+
// --------------------------------------------------------------------------------
// Construct/Destruct
// --------------------------------------------------------------------------------
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedKeyImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedKeyImpl.cpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedKeyImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptedKeyImpl.cpp Tue Mar 6 19:15:52 2018
@@ -94,6 +94,20 @@ static XMLCh s_Recipient[] = {
chNull
};
+XENCEncryptedKey* XENCEncryptedKey::create(
+ const XSECEnv* env,
+ XENCCipherData::XENCCipherDataType type,
+ const XMLCh * algorithm,
+ const XMLCh * value)
+{
+
+ XENCEncryptedKeyImpl* ret = new XENCEncryptedKeyImpl(env);
+ if (!ret)
+ throw XSECException(XSECException::MemoryAllocationFail);
+ ret->createBlankEncryptedKey(type, algorithm, value);
+ return ret;
+}
+
// --------------------------------------------------------------------------------
// Construct/Destruct
// --------------------------------------------------------------------------------
Modified: santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptionMethodImpl.cpp
URL: http://svn.apache.org/viewvc/santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptionMethodImpl.cpp?rev=1826027&r1=1826026&r2=1826027&view=diff
==============================================================================
--- santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptionMethodImpl.cpp (original)
+++ santuario/xml-security-cpp/trunk/xsec/xenc/impl/XENCEncryptionMethodImpl.cpp Tue Mar 6 19:15:52 2018
@@ -114,6 +114,15 @@ static XMLCh s_KeySize [] = {
chNull
};
+XENCEncryptionMethod* XENCEncryptionMethod::create(const XSECEnv* env, const XMLCh* algorithm) {
+
+ XENCEncryptionMethodImpl* ret = new XENCEncryptionMethodImpl(env);
+ if (!ret)
+ throw XSECException(XSECException::MemoryAllocationFail);
+ ret->createBlankEncryptionMethod(algorithm);
+ return ret;
+}
+
// --------------------------------------------------------------------------------
// Constructors and Destructors
// --------------------------------------------------------------------------------