DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::XMLENC_NS,xmlconstants::XMLENC_PREFIX)
/**
+ * Macro for declaring encryption 1.1 builders.
+ *
+ * @param cname name of class being built
+ */
+#define DECL_XMLENC11OBJECTBUILDER(cname) \
+ DECL_XMLOBJECTBUILDER(XMLTOOL_API,cname,xmlconstants::XMLENC11_NS,xmlconstants::XMLENC11_PREFIX)
+
+/**
* @namespace xmlencryption
* Namespace for XML Encryption schema objects
*/
static const XMLCh TYPE_NAME[];
END_XMLOBJECT;
+ BEGIN_XMLOBJECT(XMLTOOL_API,MGF,xmltooling::XMLObject,XML Encryption 1.1 MGF element);
+ DECL_STRING_ATTRIB(Algorithm,ALGORITHM);
+ /** MGFType local name */
+ static const XMLCh TYPE_NAME[];
+ END_XMLOBJECT;
+
DECL_XMLENCOBJECTBUILDER(CarriedKeyName);
DECL_XMLENCOBJECTBUILDER(CipherData);
DECL_XMLENCOBJECTBUILDER(CipherReference);
DECL_XMLENCOBJECTBUILDER(ReferenceList);
DECL_XMLENCOBJECTBUILDER(Transforms);
+ DECL_XMLENC11OBJECTBUILDER(MGF);
+
/**
* Registers builders and validators for XML Encryption classes into the runtime.
*/
}
};
+ class XMLTOOL_DLLLOCAL MGFImpl : public virtual MGF,
+ public AbstractSimpleElement,
+ public AbstractDOMCachingXMLObject,
+ public AbstractXMLObjectMarshaller,
+ public AbstractXMLObjectUnmarshaller
+ {
+ void init() {
+ m_Algorithm = nullptr;
+ }
+
+ public:
+ virtual ~MGFImpl() {
+ XMLString::release(&m_Algorithm);
+ }
+
+ MGFImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
+ : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
+ init();
+ }
+
+ MGFImpl(const MGFImpl& src)
+ : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
+ init();
+ IMPL_CLONE_ATTRIB(Algorithm);
+ }
+
+ IMPL_XMLOBJECT_CLONE(MGF);
+ IMPL_STRING_ATTRIB(Algorithm);
+
+ protected:
+ void marshallAttributes(DOMElement* domElement) const {
+ MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,nullptr);
+ }
+
+ void processAttribute(const DOMAttr* attribute) {
+ PROC_STRING_ATTRIB(Algorithm,ALGORITHM,nullptr);
+ AbstractXMLObjectUnmarshaller::processAttribute(attribute);
+ }
+ };
+
};
#if defined (_MSC_VER)
IMPL_XMLOBJECTBUILDER(ReferenceList);
IMPL_XMLOBJECTBUILDER(Transforms);
+IMPL_XMLOBJECTBUILDER(MGF);
+
// Unicode literals
const XMLCh CarriedKeyName::LOCAL_NAME[] = UNICODE_LITERAL_14(C,a,r,r,i,e,d,K,e,y,N,a,m,e);
const XMLCh ReferenceType::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
const XMLCh Transforms::LOCAL_NAME[] = UNICODE_LITERAL_10(T,r,a,n,s,f,o,r,m,s);
const XMLCh Transforms::TYPE_NAME[] = UNICODE_LITERAL_14(T,r,a,n,s,f,o,r,m,s,T,y,p,e);
+
+const XMLCh MGF::LOCAL_NAME[] = UNICODE_LITERAL_3(M,G,F);
+const XMLCh MGF::TYPE_NAME[] = UNICODE_LITERAL_7(M,G,F,T,y,p,e);
+const XMLCh MGF::ALGORITHM_ATTRIB_NAME[] = UNICODE_LITERAL_9(A,l,g,o,r,i,t,h,m);
\ No newline at end of file
using namespace xmltooling;
using namespace std;
using xmlconstants::XMLENC_NS;
+using xmlconstants::XMLENC11_NS;
namespace xmlencryption {
BEGIN_XMLOBJECTVALIDATOR_SUB(XMLTOOL_DLLLOCAL,EncryptedKey,EncryptedType);
EncryptedTypeSchemaValidator::validate(xmlObject);
END_XMLOBJECTVALIDATOR;
-
+
+ BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,MGF);
+ XMLOBJECTVALIDATOR_REQUIRE(MGF,Algorithm);
+ END_XMLOBJECTVALIDATOR;
+
};
#define REGISTER_ELEMENT(namespaceURI,cname) \
REGISTER_TYPE(XMLENC_NS,EncryptionProperties);
REGISTER_TYPE(XMLENC_NS,EncryptionProperty);
REGISTER_TYPE(XMLENC_NS,Transforms);
+
+ REGISTER_ELEMENT(XMLENC11_NS,MGF);
+ REGISTER_TYPE(XMLENC11_NS,MGF);
}
const XMLCh xmlconstants::XMLENC_PREFIX[] = { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chNull };
+const XMLCh xmlconstants::XMLENC11_NS[] = // http://www.w3.org/2009/xmlenc11#
+{ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
+ chLatin_w, chLatin_w, chLatin_w, chPeriod, chLatin_w, chDigit_3, chPeriod, chLatin_o, chLatin_r, chLatin_g, chForwardSlash,
+ chDigit_2, chDigit_0, chDigit_0, chDigit_9, chForwardSlash,
+ chLatin_x, chLatin_m, chLatin_l, chLatin_e, chLatin_n, chLatin_c, chDigit_1, chDigit_1, chPound, chNull
+};
+
+const XMLCh xmlconstants::XMLENC11_PREFIX[] = { chLatin_x, chLatin_e, chLatin_n, chLatin_c, chDigit_1, chDigit_1, chNull };
+
const XMLCh xmlconstants::SOAP11ENV_NS[] = // http://schemas.xmlsoap.org/soap/envelope/
{ chLatin_h, chLatin_t, chLatin_t, chLatin_p, chColon, chForwardSlash, chForwardSlash,
chLatin_s, chLatin_c, chLatin_h, chLatin_e, chLatin_m, chLatin_a, chLatin_s, chPeriod,
/** XML Signature QName prefix ("ds") */
extern XMLTOOL_API const XMLCh XMLSIG_PREFIX[];
- /** XML Signature namespace ("http://www.w3.org/2009/xmldsig11#") */
+ /** XML Signature 1.1 namespace ("http://www.w3.org/2009/xmldsig11#") */
extern XMLTOOL_API const XMLCh XMLSIG11_NS[];
- /** XML Signature QName prefix ("ds11") */
+ /** XML Signature 1.1 QName prefix ("ds11") */
extern XMLTOOL_API const XMLCh XMLSIG11_PREFIX[];
/** XML Encryption namespace ("http://www.w3.org/2001/04/xmlenc#") */
/** XML Encryption QName prefix ("xenc") */
extern XMLTOOL_API const XMLCh XMLENC_PREFIX[];
+ /** XML Encryption 1.1 namespace ("http://www.w3.org/2009/xmlenc11#") */
+ extern XMLTOOL_API const XMLCh XMLENC11_NS[];
+
+ /** XML Encryption 1.1 QName prefix ("xenc11") */
+ extern XMLTOOL_API const XMLCh XMLENC11_PREFIX[];
+
/** SOAP 1.1 Envelope XML namespace ("http://schemas.xmlsoap.org/soap/envelope/") */
extern XMLTOOL_API const XMLCh SOAP11ENV_NS[];