2 * Copyright 2001-2007 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 * Implementation classes for XML Encryption schema
24 #include "AbstractAttributeExtensibleXMLObject.h"
25 #include "AbstractComplexElement.h"
26 #include "AbstractSimpleElement.h"
27 #include "exceptions.h"
28 #include "encryption/Encryption.h"
29 #include "io/AbstractXMLObjectMarshaller.h"
30 #include "io/AbstractXMLObjectUnmarshaller.h"
31 #include "util/XMLHelper.h"
33 #include <xercesc/util/XMLUniDefs.hpp>
35 using namespace xmlencryption;
36 using namespace xmltooling;
37 using namespace xercesc;
39 using xmlconstants::XMLENC_NS;
40 using xmlconstants::XMLSIG_NS;
42 #if defined (_MSC_VER)
43 #pragma warning( push )
44 #pragma warning( disable : 4250 4251 )
47 namespace xmlencryption {
49 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CarriedKeyName);
50 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CipherValue);
51 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,KeySize);
52 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,OAEPparams);
54 class XMLTOOL_DLLLOCAL EncryptionMethodImpl : public virtual EncryptionMethod,
55 public AbstractComplexElement,
56 public AbstractDOMCachingXMLObject,
57 public AbstractXMLObjectMarshaller,
58 public AbstractXMLObjectUnmarshaller
64 m_children.push_back(NULL);
65 m_children.push_back(NULL);
66 m_pos_KeySize=m_children.begin();
67 m_pos_OAEPparams=m_pos_KeySize;
71 virtual ~EncryptionMethodImpl() {
72 XMLString::release(&m_Algorithm);
75 EncryptionMethodImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
76 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
80 EncryptionMethodImpl(const EncryptionMethodImpl& src)
81 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
83 setAlgorithm(src.getAlgorithm());
85 setKeySize(src.getKeySize()->cloneKeySize());
86 if (src.getOAEPparams())
87 setOAEPparams(src.getOAEPparams()->cloneOAEPparams());
88 VectorOf(XMLObject) v=getUnknownXMLObjects();
89 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
90 v.push_back((*i)->clone());
93 IMPL_XMLOBJECT_CLONE(EncryptionMethod);
94 IMPL_STRING_ATTRIB(Algorithm);
95 IMPL_TYPED_CHILD(KeySize);
96 IMPL_TYPED_CHILD(OAEPparams);
97 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
100 void marshallAttributes(DOMElement* domElement) const {
101 MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,NULL);
104 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
105 PROC_TYPED_CHILD(KeySize,XMLENC_NS,false);
106 PROC_TYPED_CHILD(OAEPparams,XMLENC_NS,false);
109 const XMLCh* nsURI=root->getNamespaceURI();
110 if (!XMLString::equals(nsURI,XMLENC_NS) && nsURI && *nsURI) {
111 getUnknownXMLObjects().push_back(childXMLObject);
115 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
118 void processAttribute(const DOMAttr* attribute) {
119 PROC_STRING_ATTRIB(Algorithm,ALGORITHM,NULL);
120 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
124 class XMLTOOL_DLLLOCAL TransformsImpl : public virtual Transforms,
125 public AbstractComplexElement,
126 public AbstractDOMCachingXMLObject,
127 public AbstractXMLObjectMarshaller,
128 public AbstractXMLObjectUnmarshaller
131 virtual ~TransformsImpl() {}
133 TransformsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
134 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
137 TransformsImpl(const TransformsImpl& src)
138 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
139 VectorOf(xmlsignature::Transform) v=getTransforms();
140 for (vector<xmlsignature::Transform*>::const_iterator i=src.m_Transforms.begin(); i!=src.m_Transforms.end(); i++) {
142 v.push_back((*i)->cloneTransform());
147 IMPL_XMLOBJECT_CLONE(Transforms);
148 IMPL_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,m_children.end());
151 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
152 PROC_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,XMLSIG_NS,false);
153 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
157 class XMLTOOL_DLLLOCAL CipherReferenceImpl : public virtual CipherReference,
158 public AbstractComplexElement,
159 public AbstractDOMCachingXMLObject,
160 public AbstractXMLObjectMarshaller,
161 public AbstractXMLObjectUnmarshaller
166 m_children.push_back(NULL);
167 m_pos_Transforms=m_children.begin();
170 virtual ~CipherReferenceImpl() {
171 XMLString::release(&m_URI);
174 CipherReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
175 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
179 CipherReferenceImpl(const CipherReferenceImpl& src)
180 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
182 setURI(src.getURI());
183 if (src.getTransforms())
184 setTransforms(src.getTransforms()->cloneTransforms());
187 IMPL_XMLOBJECT_CLONE(CipherReference);
188 IMPL_STRING_ATTRIB(URI);
189 IMPL_TYPED_CHILD(Transforms);
192 void marshallAttributes(DOMElement* domElement) const {
193 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
196 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
197 PROC_TYPED_CHILD(Transforms,XMLENC_NS,false);
198 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
201 void processAttribute(const DOMAttr* attribute) {
202 PROC_STRING_ATTRIB(URI,URI,NULL);
203 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
207 class XMLTOOL_DLLLOCAL CipherDataImpl : public virtual CipherData,
208 public AbstractComplexElement,
209 public AbstractDOMCachingXMLObject,
210 public AbstractXMLObjectMarshaller,
211 public AbstractXMLObjectUnmarshaller
215 m_CipherReference=NULL;
216 m_children.push_back(NULL);
217 m_children.push_back(NULL);
218 m_pos_CipherValue=m_children.begin();
219 m_pos_CipherReference=m_pos_CipherValue;
220 ++m_pos_CipherReference;
223 virtual ~CipherDataImpl() {}
225 CipherDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
226 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
230 CipherDataImpl(const CipherDataImpl& src)
231 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
233 if (src.getCipherValue())
234 setCipherValue(src.getCipherValue()->cloneCipherValue());
235 if (src.getCipherReference())
236 setCipherReference(src.getCipherReference()->cloneCipherReference());
239 IMPL_XMLOBJECT_CLONE(CipherData);
240 IMPL_TYPED_CHILD(CipherValue);
241 IMPL_TYPED_CHILD(CipherReference);
244 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
245 PROC_TYPED_CHILD(CipherValue,XMLENC_NS,false);
246 PROC_TYPED_CHILD(CipherReference,XMLENC_NS,false);
247 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
251 class XMLTOOL_DLLLOCAL EncryptionPropertyImpl : public virtual EncryptionProperty,
252 public AbstractAttributeExtensibleXMLObject,
253 public AbstractComplexElement,
254 public AbstractDOMCachingXMLObject,
255 public AbstractXMLObjectMarshaller,
256 public AbstractXMLObjectUnmarshaller
262 virtual ~EncryptionPropertyImpl() {
263 XMLString::release(&m_Id);
264 XMLString::release(&m_Target);
267 EncryptionPropertyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
268 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
272 EncryptionPropertyImpl(const EncryptionPropertyImpl& src)
273 : AbstractXMLObject(src),
274 AbstractAttributeExtensibleXMLObject(src),
275 AbstractComplexElement(src),
276 AbstractDOMCachingXMLObject(src) {
279 setTarget(src.getTarget());
280 VectorOf(XMLObject) v=getUnknownXMLObjects();
281 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
282 v.push_back((*i)->clone());
285 IMPL_XMLOBJECT_CLONE(EncryptionProperty);
287 IMPL_STRING_ATTRIB(Target);
288 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
290 void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
291 if (!qualifiedName.hasNamespaceURI()) {
292 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
296 else if (XMLString::equals(qualifiedName.getLocalPart(),TARGET_ATTRIB_NAME)) {
301 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
305 void marshallAttributes(DOMElement* domElement) const {
306 MARSHALL_ID_ATTRIB(Id,ID,NULL);
307 MARSHALL_STRING_ATTRIB(Target,TARGET,NULL);
308 marshallExtensionAttributes(domElement);
311 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
312 getUnknownXMLObjects().push_back(childXMLObject);
315 void processAttribute(const DOMAttr* attribute) {
316 PROC_ID_ATTRIB(Id,ID,NULL);
317 unmarshallExtensionAttribute(attribute);
321 class XMLTOOL_DLLLOCAL EncryptionPropertiesImpl : public virtual EncryptionProperties,
322 public AbstractComplexElement,
323 public AbstractDOMCachingXMLObject,
324 public AbstractXMLObjectMarshaller,
325 public AbstractXMLObjectUnmarshaller
331 virtual ~EncryptionPropertiesImpl() {
332 XMLString::release(&m_Id);
335 EncryptionPropertiesImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
336 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
340 EncryptionPropertiesImpl(const EncryptionPropertiesImpl& src)
341 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
344 VectorOf(EncryptionProperty) v=getEncryptionPropertys();
345 for (vector<EncryptionProperty*>::const_iterator i=src.m_EncryptionPropertys.begin(); i!=src.m_EncryptionPropertys.end(); i++) {
347 v.push_back((*i)->cloneEncryptionProperty());
352 IMPL_XMLOBJECT_CLONE(EncryptionProperties);
354 IMPL_TYPED_CHILDREN(EncryptionProperty,m_children.end());
357 void marshallAttributes(DOMElement* domElement) const {
358 MARSHALL_ID_ATTRIB(Id,ID,NULL);
361 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
362 PROC_TYPED_CHILDREN(EncryptionProperty,XMLENC_NS,false);
363 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
366 void processAttribute(const DOMAttr* attribute) {
367 PROC_ID_ATTRIB(Id,ID,NULL);
368 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
372 class XMLTOOL_DLLLOCAL ReferenceTypeImpl : public virtual ReferenceType,
373 public AbstractComplexElement,
374 public AbstractDOMCachingXMLObject,
375 public AbstractXMLObjectMarshaller,
376 public AbstractXMLObjectUnmarshaller
383 ReferenceTypeImpl() {
388 virtual ~ReferenceTypeImpl() {
389 XMLString::release(&m_URI);
392 ReferenceTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
393 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
397 ReferenceTypeImpl(const ReferenceTypeImpl& src)
398 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
400 setURI(src.getURI());
401 VectorOf(XMLObject) v=getUnknownXMLObjects();
402 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
403 v.push_back((*i)->clone());
406 IMPL_XMLOBJECT_CLONE(ReferenceType);
407 IMPL_STRING_ATTRIB(URI);
408 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
411 void marshallAttributes(DOMElement* domElement) const {
412 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
415 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
416 getUnknownXMLObjects().push_back(childXMLObject);
419 void processAttribute(const DOMAttr* attribute) {
420 PROC_STRING_ATTRIB(URI,URI,NULL);
421 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
425 class XMLTOOL_DLLLOCAL DataReferenceImpl : public virtual DataReference, public ReferenceTypeImpl
428 virtual ~DataReferenceImpl() {}
430 DataReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
431 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
433 DataReferenceImpl(const DataReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
435 IMPL_XMLOBJECT_CLONE(DataReference);
436 ReferenceType* cloneReferenceType() const {
437 return new DataReferenceImpl(*this);
441 class XMLTOOL_DLLLOCAL KeyReferenceImpl : public virtual KeyReference, public ReferenceTypeImpl
444 virtual ~KeyReferenceImpl() {}
446 KeyReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
447 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
449 KeyReferenceImpl(const KeyReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
451 IMPL_XMLOBJECT_CLONE(KeyReference);
452 ReferenceType* cloneReferenceType() const {
453 return new KeyReferenceImpl(*this);
457 class XMLTOOL_DLLLOCAL ReferenceListImpl : public virtual ReferenceList,
458 public AbstractComplexElement,
459 public AbstractDOMCachingXMLObject,
460 public AbstractXMLObjectMarshaller,
461 public AbstractXMLObjectUnmarshaller
464 virtual ~ReferenceListImpl() {}
466 ReferenceListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
467 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
470 ReferenceListImpl(const ReferenceListImpl& src)
471 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
472 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
474 DataReference* data=dynamic_cast<DataReference*>(*i);
476 getDataReferences().push_back(data->cloneDataReference());
480 KeyReference* key=dynamic_cast<KeyReference*>(*i);
482 getKeyReferences().push_back(key->cloneKeyReference());
489 IMPL_XMLOBJECT_CLONE(ReferenceList);
490 IMPL_TYPED_CHILDREN(DataReference,m_children.end());
491 IMPL_TYPED_CHILDREN(KeyReference,m_children.end());
494 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
495 PROC_TYPED_CHILDREN(DataReference,XMLENC_NS,false);
496 PROC_TYPED_CHILDREN(KeyReference,XMLENC_NS,false);
497 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
501 class XMLTOOL_DLLLOCAL EncryptedTypeImpl : public virtual EncryptedType,
502 public AbstractComplexElement,
503 public AbstractDOMCachingXMLObject,
504 public AbstractXMLObjectMarshaller,
505 public AbstractXMLObjectUnmarshaller
508 m_Id=m_Type=m_MimeType=m_Encoding=NULL;
509 m_EncryptionMethod=NULL;
512 m_EncryptionProperties=NULL;
513 m_children.push_back(NULL);
514 m_children.push_back(NULL);
515 m_children.push_back(NULL);
516 m_children.push_back(NULL);
517 m_pos_EncryptionMethod=m_children.begin();
518 m_pos_KeyInfo=m_pos_EncryptionMethod;
520 m_pos_CipherData=m_pos_KeyInfo;
522 m_pos_EncryptionProperties=m_pos_CipherData;
523 ++m_pos_EncryptionProperties;
526 EncryptedTypeImpl() {
531 virtual ~EncryptedTypeImpl() {
532 XMLString::release(&m_Id);
533 XMLString::release(&m_Type);
534 XMLString::release(&m_MimeType);
535 XMLString::release(&m_Encoding);
538 EncryptedTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
539 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
543 EncryptedTypeImpl(const EncryptedTypeImpl& src)
544 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
547 setType(src.getType());
548 setMimeType(src.getMimeType());
549 setEncoding(src.getEncoding());
550 if (src.getEncryptionMethod())
551 setEncryptionMethod(src.getEncryptionMethod()->cloneEncryptionMethod());
552 if (src.getKeyInfo())
553 setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
554 if (src.getCipherData())
555 setCipherData(src.getCipherData()->cloneCipherData());
556 if (src.getEncryptionProperties())
557 setEncryptionProperties(src.getEncryptionProperties()->cloneEncryptionProperties());
560 IMPL_XMLOBJECT_CLONE(EncryptedType);
562 IMPL_STRING_ATTRIB(Type);
563 IMPL_STRING_ATTRIB(MimeType);
564 IMPL_STRING_ATTRIB(Encoding);
565 IMPL_TYPED_CHILD(EncryptionMethod);
566 IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
567 IMPL_TYPED_CHILD(CipherData);
568 IMPL_TYPED_CHILD(EncryptionProperties);
571 void marshallAttributes(DOMElement* domElement) const {
572 MARSHALL_ID_ATTRIB(Id,ID,NULL);
573 MARSHALL_STRING_ATTRIB(Type,TYPE,NULL);
574 MARSHALL_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
575 MARSHALL_STRING_ATTRIB(Encoding,ENCODING,NULL);
578 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
579 PROC_TYPED_CHILD(EncryptionMethod,XMLENC_NS,false);
580 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLSIG_NS,false);
581 PROC_TYPED_CHILD(CipherData,XMLENC_NS,false);
582 PROC_TYPED_CHILD(EncryptionProperties,XMLENC_NS,false);
583 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
586 void processAttribute(const DOMAttr* attribute) {
587 PROC_ID_ATTRIB(Id,ID,NULL);
588 PROC_STRING_ATTRIB(Type,TYPE,NULL);
589 PROC_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
590 PROC_STRING_ATTRIB(Encoding,ENCODING,NULL);
591 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
595 class XMLTOOL_DLLLOCAL EncryptedDataImpl : public virtual EncryptedData, public EncryptedTypeImpl
598 virtual ~EncryptedDataImpl() {}
600 EncryptedDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
601 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
603 EncryptedDataImpl(const EncryptedDataImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {}
605 IMPL_XMLOBJECT_CLONE(EncryptedData);
606 EncryptedType* cloneEncryptedType() const {
607 return new EncryptedDataImpl(*this);
611 class XMLTOOL_DLLLOCAL EncryptedKeyImpl : public virtual EncryptedKey, public EncryptedTypeImpl
615 m_ReferenceList=NULL;
616 m_CarriedKeyName=NULL;
617 m_children.push_back(NULL);
618 m_children.push_back(NULL);
619 m_pos_ReferenceList=m_pos_EncryptionProperties;
620 ++m_pos_ReferenceList;
621 m_pos_CarriedKeyName=m_pos_ReferenceList;
622 ++m_pos_CarriedKeyName;
626 virtual ~EncryptedKeyImpl() {
627 XMLString::release(&m_Recipient);
630 EncryptedKeyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
631 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
635 EncryptedKeyImpl(const EncryptedKeyImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {
639 IMPL_XMLOBJECT_CLONE(EncryptedKey);
640 EncryptedType* cloneEncryptedType() const {
641 return new EncryptedKeyImpl(*this);
643 IMPL_STRING_ATTRIB(Recipient);
644 IMPL_TYPED_CHILD(ReferenceList);
645 IMPL_TYPED_CHILD(CarriedKeyName);
648 void marshallAttributes(DOMElement* domElement) const {
649 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
650 EncryptedTypeImpl::marshallAttributes(domElement);
653 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
654 PROC_TYPED_CHILD(ReferenceList,XMLENC_NS,false);
655 PROC_TYPED_CHILD(CarriedKeyName,XMLENC_NS,false);
656 EncryptedTypeImpl::processChildElement(childXMLObject,root);
659 void processAttribute(const DOMAttr* attribute) {
660 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
661 EncryptedTypeImpl::processAttribute(attribute);
667 #if defined (_MSC_VER)
668 #pragma warning( pop )
671 // Builder Implementations
673 IMPL_XMLOBJECTBUILDER(CarriedKeyName);
674 IMPL_XMLOBJECTBUILDER(CipherData);
675 IMPL_XMLOBJECTBUILDER(CipherReference);
676 IMPL_XMLOBJECTBUILDER(CipherValue);
677 IMPL_XMLOBJECTBUILDER(DataReference);
678 IMPL_XMLOBJECTBUILDER(EncryptedData);
679 IMPL_XMLOBJECTBUILDER(EncryptedKey);
680 IMPL_XMLOBJECTBUILDER(EncryptionMethod);
681 IMPL_XMLOBJECTBUILDER(EncryptionProperties);
682 IMPL_XMLOBJECTBUILDER(EncryptionProperty);
683 IMPL_XMLOBJECTBUILDER(KeyReference);
684 IMPL_XMLOBJECTBUILDER(KeySize);
685 IMPL_XMLOBJECTBUILDER(OAEPparams);
686 IMPL_XMLOBJECTBUILDER(ReferenceList);
687 IMPL_XMLOBJECTBUILDER(Transforms);
691 const XMLCh CarriedKeyName::LOCAL_NAME[] = UNICODE_LITERAL_14(C,a,r,r,i,e,d,K,e,y,N,a,m,e);
692 const XMLCh CipherData::LOCAL_NAME[] = UNICODE_LITERAL_10(C,i,p,h,e,r,D,a,t,a);
693 const XMLCh CipherData::TYPE_NAME[] = UNICODE_LITERAL_14(C,i,p,h,e,r,D,a,t,a,T,y,p,e);
694 const XMLCh CipherReference::LOCAL_NAME[] = UNICODE_LITERAL_15(C,i,p,h,e,r,R,e,f,e,r,e,n,c,e);
695 const XMLCh CipherReference::TYPE_NAME[] = UNICODE_LITERAL_19(C,i,p,h,e,r,R,e,f,e,r,e,n,c,e,T,y,p,e);
696 const XMLCh CipherReference::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
697 const XMLCh CipherValue::LOCAL_NAME[] = UNICODE_LITERAL_11(C,i,p,h,e,r,V,a,l,u,e);
698 const XMLCh DataReference::LOCAL_NAME[] = UNICODE_LITERAL_13(D,a,t,a,R,e,f,e,r,e,n,c,e);
699 const XMLCh EncryptedData::LOCAL_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,D,a,t,a);
700 const XMLCh EncryptedData::TYPE_NAME[] = UNICODE_LITERAL_17(E,n,c,r,y,p,t,e,d,D,a,t,a,T,y,p,e);
701 const XMLCh EncryptedKey::LOCAL_NAME[] = UNICODE_LITERAL_12(E,n,c,r,y,p,t,e,d,K,e,y);
702 const XMLCh EncryptedKey::TYPE_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,e,d,K,e,y,T,y,p,e);
703 const XMLCh EncryptedKey::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
704 const XMLCh EncryptedType::LOCAL_NAME[] = {chNull};
705 const XMLCh EncryptedType::TYPE_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,T,y,p,e);
706 const XMLCh EncryptedType::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
707 const XMLCh EncryptedType::TYPE_ATTRIB_NAME[] = UNICODE_LITERAL_4(T,y,p,e);
708 const XMLCh EncryptedType::MIMETYPE_ATTRIB_NAME[] = UNICODE_LITERAL_8(M,i,m,e,T,y,p,e);
709 const XMLCh EncryptedType::ENCODING_ATTRIB_NAME[] = UNICODE_LITERAL_8(E,n,c,o,d,i,n,g);
710 const XMLCh EncryptionMethod::LOCAL_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,i,o,n,M,e,t,h,o,d);
711 const XMLCh EncryptionMethod::TYPE_NAME[] = UNICODE_LITERAL_20(E,n,c,r,y,p,t,i,o,n,M,e,t,h,o,d,T,y,p,e);
712 const XMLCh EncryptionMethod::ALGORITHM_ATTRIB_NAME[] = UNICODE_LITERAL_9(A,l,g,o,r,i,t,h,m);
713 const XMLCh EncryptionProperties::LOCAL_NAME[] = UNICODE_LITERAL_20(E,n,c,r,y,p,t,i,o,n,P,r,o,p,e,r,t,i,e,s);
714 const XMLCh EncryptionProperties::TYPE_NAME[] = UNICODE_LITERAL_24(E,n,c,r,y,p,t,i,o,n,P,r,o,p,e,r,t,i,e,s,T,y,p,e);
715 const XMLCh EncryptionProperties::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
716 const XMLCh EncryptionProperty::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,i,o,n,P,r,o,p,e,r,t,y);
717 const XMLCh EncryptionProperty::TYPE_NAME[] = UNICODE_LITERAL_22(E,n,c,r,y,p,t,i,o,n,P,r,o,p,e,r,t,y,T,y,p,e);
718 const XMLCh EncryptionProperty::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
719 const XMLCh EncryptionProperty::TARGET_ATTRIB_NAME[] = UNICODE_LITERAL_6(T,a,r,g,e,t);
720 const XMLCh KeyReference::LOCAL_NAME[] = UNICODE_LITERAL_12(K,e,y,R,e,f,e,r,e,n,c,e);
721 const XMLCh KeySize::LOCAL_NAME[] = UNICODE_LITERAL_7(K,e,y,S,i,z,e);
722 const XMLCh OAEPparams::LOCAL_NAME[] = UNICODE_LITERAL_10(O,A,E,P,p,a,r,a,m,s);
723 const XMLCh ReferenceList::LOCAL_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,L,i,s,t);
724 const XMLCh ReferenceType::LOCAL_NAME[] = {chNull};
725 const XMLCh ReferenceType::TYPE_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,T,y,p,e);
726 const XMLCh ReferenceType::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
727 const XMLCh Transforms::LOCAL_NAME[] = UNICODE_LITERAL_10(T,r,a,n,s,f,o,r,m,s);
728 const XMLCh Transforms::TYPE_NAME[] = UNICODE_LITERAL_14(T,r,a,n,s,f,o,r,m,s,T,y,p,e);