2 * Copyright 2001-2006 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 "AbstractChildlessElement.h"
26 #include "AbstractElementProxy.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;
39 #if defined (_MSC_VER)
40 #pragma warning( push )
41 #pragma warning( disable : 4250 4251 )
44 namespace xmlencryption {
46 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CarriedKeyName);
47 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CipherValue);
48 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,KeySize);
49 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,OAEPparams);
51 class XMLTOOL_DLLLOCAL EncryptionMethodImpl : public virtual EncryptionMethod,
52 public AbstractComplexElement,
53 public AbstractDOMCachingXMLObject,
54 public AbstractXMLObjectMarshaller,
55 public AbstractXMLObjectUnmarshaller
61 m_children.push_back(NULL);
62 m_children.push_back(NULL);
63 m_pos_KeySize=m_children.begin();
64 m_pos_OAEPparams=m_pos_KeySize;
68 virtual ~EncryptionMethodImpl() {
69 XMLString::release(&m_Algorithm);
72 EncryptionMethodImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
73 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
77 EncryptionMethodImpl(const EncryptionMethodImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
79 setAlgorithm(src.getAlgorithm());
81 setKeySize(src.getKeySize()->cloneKeySize());
82 if (src.getOAEPparams())
83 setOAEPparams(src.getOAEPparams()->cloneOAEPparams());
84 VectorOf(XMLObject) v=getOtherParameters();
85 for (vector<XMLObject*>::const_iterator i=src.m_OtherParameters.begin(); i!=src.m_OtherParameters.end(); i++) {
87 v.push_back((*i)->clone());
92 IMPL_XMLOBJECT_CLONE(EncryptionMethod);
93 IMPL_STRING_ATTRIB(Algorithm);
94 IMPL_TYPED_CHILD(KeySize);
95 IMPL_TYPED_CHILD(OAEPparams);
96 IMPL_XMLOBJECT_CHILDREN(OtherParameter,m_children.end());
99 void marshallAttributes(DOMElement* domElement) const {
100 MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,NULL);
103 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
104 PROC_TYPED_CHILD(KeySize,XMLConstants::XMLENC_NS,false);
105 PROC_TYPED_CHILD(OAEPparams,XMLConstants::XMLENC_NS,false);
108 const XMLCh* nsURI=root->getNamespaceURI();
109 if (!XMLString::equals(nsURI,XMLConstants::XMLENC_NS) && nsURI && *nsURI) {
110 getOtherParameters().push_back(childXMLObject);
114 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
117 void processAttribute(const DOMAttr* attribute) {
118 PROC_STRING_ATTRIB(Algorithm,ALGORITHM,NULL);
119 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
123 class XMLTOOL_DLLLOCAL TransformsImpl : public virtual Transforms,
124 public AbstractComplexElement,
125 public AbstractDOMCachingXMLObject,
126 public AbstractXMLObjectMarshaller,
127 public AbstractXMLObjectUnmarshaller
130 virtual ~TransformsImpl() {}
132 TransformsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
133 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
136 TransformsImpl(const TransformsImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
137 VectorOf(xmlsignature::Transform) v=getTransforms();
138 for (vector<xmlsignature::Transform*>::const_iterator i=src.m_Transforms.begin(); i!=src.m_Transforms.end(); i++) {
140 v.push_back((*i)->cloneTransform());
145 IMPL_XMLOBJECT_CLONE(Transforms);
146 IMPL_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,m_children.end());
149 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
150 PROC_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,XMLConstants::XMLSIG_NS,false);
151 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
155 class XMLTOOL_DLLLOCAL CipherReferenceImpl : public virtual CipherReference,
156 public AbstractComplexElement,
157 public AbstractDOMCachingXMLObject,
158 public AbstractXMLObjectMarshaller,
159 public AbstractXMLObjectUnmarshaller
164 m_children.push_back(NULL);
165 m_pos_Transforms=m_children.begin();
168 virtual ~CipherReferenceImpl() {
169 XMLString::release(&m_URI);
172 CipherReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
173 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
177 CipherReferenceImpl(const CipherReferenceImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
179 setURI(src.getURI());
180 if (src.getTransforms())
181 setTransforms(src.getTransforms()->cloneTransforms());
184 IMPL_XMLOBJECT_CLONE(CipherReference);
185 IMPL_STRING_ATTRIB(URI);
186 IMPL_TYPED_CHILD(Transforms);
189 void marshallAttributes(DOMElement* domElement) const {
190 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
193 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
194 PROC_TYPED_CHILD(Transforms,XMLConstants::XMLENC_NS,false);
195 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
198 void processAttribute(const DOMAttr* attribute) {
199 PROC_STRING_ATTRIB(URI,URI,NULL);
200 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
204 class XMLTOOL_DLLLOCAL CipherDataImpl : public virtual CipherData,
205 public AbstractComplexElement,
206 public AbstractDOMCachingXMLObject,
207 public AbstractXMLObjectMarshaller,
208 public AbstractXMLObjectUnmarshaller
212 m_CipherReference=NULL;
213 m_children.push_back(NULL);
214 m_children.push_back(NULL);
215 m_pos_CipherValue=m_children.begin();
216 m_pos_CipherReference=m_pos_CipherValue;
217 ++m_pos_CipherReference;
220 virtual ~CipherDataImpl() {}
222 CipherDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
223 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
227 CipherDataImpl(const CipherDataImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
229 if (src.getCipherValue())
230 setCipherValue(src.getCipherValue()->cloneCipherValue());
231 if (src.getCipherReference())
232 setCipherReference(src.getCipherReference()->cloneCipherReference());
235 IMPL_XMLOBJECT_CLONE(CipherData);
236 IMPL_TYPED_CHILD(CipherValue);
237 IMPL_TYPED_CHILD(CipherReference);
240 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
241 PROC_TYPED_CHILD(CipherValue,XMLConstants::XMLENC_NS,false);
242 PROC_TYPED_CHILD(CipherReference,XMLConstants::XMLENC_NS,false);
243 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
247 class XMLTOOL_DLLLOCAL EncryptionPropertyImpl : public virtual EncryptionProperty,
248 public AbstractElementProxy,
249 public AbstractAttributeExtensibleXMLObject,
250 public AbstractDOMCachingXMLObject,
251 public AbstractXMLObjectMarshaller,
252 public AbstractXMLObjectUnmarshaller
258 virtual ~EncryptionPropertyImpl() {
259 XMLString::release(&m_Id);
260 XMLString::release(&m_Target);
263 EncryptionPropertyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
264 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
268 EncryptionPropertyImpl(const EncryptionPropertyImpl& src)
269 : AbstractXMLObject(src),
270 AbstractElementProxy(src),
271 AbstractAttributeExtensibleXMLObject(src),
272 AbstractDOMCachingXMLObject(src) {
275 setTarget(src.getTarget());
276 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
278 getXMLObjects().push_back((*i)->clone());
283 IMPL_XMLOBJECT_CLONE(EncryptionProperty);
284 IMPL_STRING_ATTRIB(Id);
285 IMPL_STRING_ATTRIB(Target);
287 void setAttribute(QName& qualifiedName, const XMLCh* value) {
288 if (!qualifiedName.hasNamespaceURI()) {
289 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
293 else if (XMLString::equals(qualifiedName.getLocalPart(),TARGET_ATTRIB_NAME)) {
298 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
302 void marshallAttributes(DOMElement* domElement) const {
303 MARSHALL_ID_ATTRIB(Id,ID,NULL);
304 MARSHALL_STRING_ATTRIB(Target,TARGET,NULL);
306 // Take care of wildcard.
307 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
308 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
309 if (i->first.hasPrefix())
310 attr->setPrefix(i->first.getPrefix());
311 attr->setNodeValue(i->second);
312 domElement->setAttributeNode(attr);
316 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
317 getXMLObjects().push_back(childXMLObject);
320 void processAttribute(const DOMAttr* attribute) {
321 PROC_ID_ATTRIB(Id,ID,NULL);
322 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
323 setAttribute(q,attribute->getNodeValue());
327 class XMLTOOL_DLLLOCAL EncryptionPropertiesImpl : public virtual EncryptionProperties,
328 public AbstractComplexElement,
329 public AbstractDOMCachingXMLObject,
330 public AbstractXMLObjectMarshaller,
331 public AbstractXMLObjectUnmarshaller
337 virtual ~EncryptionPropertiesImpl() {
338 XMLString::release(&m_Id);
341 EncryptionPropertiesImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
342 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
346 EncryptionPropertiesImpl(const EncryptionPropertiesImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
349 VectorOf(EncryptionProperty) v=getEncryptionPropertys();
350 for (vector<EncryptionProperty*>::const_iterator i=src.m_EncryptionPropertys.begin(); i!=src.m_EncryptionPropertys.end(); i++) {
352 v.push_back((*i)->cloneEncryptionProperty());
357 IMPL_XMLOBJECT_CLONE(EncryptionProperties);
358 IMPL_STRING_ATTRIB(Id);
359 IMPL_TYPED_CHILDREN(EncryptionProperty,m_children.end());
362 void marshallAttributes(DOMElement* domElement) const {
363 MARSHALL_ID_ATTRIB(Id,ID,NULL);
366 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
367 PROC_TYPED_CHILDREN(EncryptionProperty,XMLConstants::XMLENC_NS,false);
368 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
371 void processAttribute(const DOMAttr* attribute) {
372 PROC_ID_ATTRIB(Id,ID,NULL);
373 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
377 class XMLTOOL_DLLLOCAL ReferenceTypeImpl : public virtual ReferenceType,
378 public AbstractElementProxy,
379 public AbstractDOMCachingXMLObject,
380 public AbstractXMLObjectMarshaller,
381 public AbstractXMLObjectUnmarshaller
388 ReferenceTypeImpl() {
393 virtual ~ReferenceTypeImpl() {
394 XMLString::release(&m_URI);
397 ReferenceTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
398 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
402 ReferenceTypeImpl(const ReferenceTypeImpl& src)
403 : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) {
405 setURI(src.getURI());
406 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
408 getXMLObjects().push_back((*i)->clone());
413 IMPL_XMLOBJECT_CLONE(ReferenceType);
414 IMPL_STRING_ATTRIB(URI);
417 void marshallAttributes(DOMElement* domElement) const {
418 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
421 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
422 getXMLObjects().push_back(childXMLObject);
425 void processAttribute(const DOMAttr* attribute) {
426 PROC_STRING_ATTRIB(URI,URI,NULL);
427 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
431 class XMLTOOL_DLLLOCAL DataReferenceImpl : public virtual DataReference, public ReferenceTypeImpl
434 virtual ~DataReferenceImpl() {}
436 DataReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
437 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
439 DataReferenceImpl(const DataReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
441 IMPL_XMLOBJECT_CLONE(DataReference);
442 ReferenceType* cloneReferenceType() const {
443 return new DataReferenceImpl(*this);
447 class XMLTOOL_DLLLOCAL KeyReferenceImpl : public virtual KeyReference, public ReferenceTypeImpl
450 virtual ~KeyReferenceImpl() {}
452 KeyReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
453 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
455 KeyReferenceImpl(const KeyReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
457 IMPL_XMLOBJECT_CLONE(KeyReference);
458 ReferenceType* cloneReferenceType() const {
459 return new KeyReferenceImpl(*this);
463 class XMLTOOL_DLLLOCAL ReferenceListImpl : public virtual ReferenceList,
464 public AbstractComplexElement,
465 public AbstractDOMCachingXMLObject,
466 public AbstractXMLObjectMarshaller,
467 public AbstractXMLObjectUnmarshaller
470 virtual ~ReferenceListImpl() {}
472 ReferenceListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
473 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
476 ReferenceListImpl(const ReferenceListImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
477 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
479 DataReference* data=dynamic_cast<DataReference*>(*i);
481 getDataReferences().push_back(data->cloneDataReference());
485 KeyReference* key=dynamic_cast<KeyReference*>(*i);
487 getKeyReferences().push_back(key->cloneKeyReference());
494 IMPL_XMLOBJECT_CLONE(ReferenceList);
495 IMPL_TYPED_CHILDREN(DataReference,m_children.end());
496 IMPL_TYPED_CHILDREN(KeyReference,m_children.end());
499 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
500 PROC_TYPED_CHILDREN(DataReference,XMLConstants::XMLENC_NS,false);
501 PROC_TYPED_CHILDREN(KeyReference,XMLConstants::XMLENC_NS,false);
502 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
506 class XMLTOOL_DLLLOCAL EncryptedTypeImpl : public virtual EncryptedType,
507 public AbstractComplexElement,
508 public AbstractDOMCachingXMLObject,
509 public AbstractXMLObjectMarshaller,
510 public AbstractXMLObjectUnmarshaller
513 m_Id=m_Type=m_MimeType=m_Encoding=NULL;
514 m_EncryptionMethod=NULL;
517 m_EncryptionProperties=NULL;
518 m_children.push_back(NULL);
519 m_children.push_back(NULL);
520 m_children.push_back(NULL);
521 m_children.push_back(NULL);
522 m_pos_EncryptionMethod=m_children.begin();
523 m_pos_KeyInfo=m_pos_EncryptionMethod;
525 m_pos_CipherData=m_pos_KeyInfo;
527 m_pos_EncryptionProperties=m_pos_CipherData;
528 ++m_pos_EncryptionProperties;
531 EncryptedTypeImpl() {
536 virtual ~EncryptedTypeImpl() {
537 XMLString::release(&m_Id);
538 XMLString::release(&m_Type);
539 XMLString::release(&m_MimeType);
540 XMLString::release(&m_Encoding);
543 EncryptedTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
544 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
548 EncryptedTypeImpl(const EncryptedTypeImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
551 setType(src.getType());
552 setMimeType(src.getMimeType());
553 setEncoding(src.getEncoding());
554 if (src.getEncryptionMethod())
555 setEncryptionMethod(src.getEncryptionMethod()->cloneEncryptionMethod());
556 if (src.getKeyInfo())
557 setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
558 if (src.getCipherData())
559 setCipherData(src.getCipherData()->cloneCipherData());
560 if (src.getEncryptionProperties())
561 setEncryptionProperties(src.getEncryptionProperties()->cloneEncryptionProperties());
564 IMPL_XMLOBJECT_CLONE(EncryptedType);
565 IMPL_STRING_ATTRIB(Id);
566 IMPL_STRING_ATTRIB(Type);
567 IMPL_STRING_ATTRIB(MimeType);
568 IMPL_STRING_ATTRIB(Encoding);
569 IMPL_TYPED_CHILD(EncryptionMethod);
570 IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
571 IMPL_TYPED_CHILD(CipherData);
572 IMPL_TYPED_CHILD(EncryptionProperties);
575 void marshallAttributes(DOMElement* domElement) const {
576 MARSHALL_ID_ATTRIB(Id,ID,NULL);
577 MARSHALL_STRING_ATTRIB(Type,TYPE,NULL);
578 MARSHALL_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
579 MARSHALL_STRING_ATTRIB(Encoding,ENCODING,NULL);
582 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
583 PROC_TYPED_CHILD(EncryptionMethod,XMLConstants::XMLENC_NS,false);
584 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLConstants::XMLSIG_NS,false);
585 PROC_TYPED_CHILD(CipherData,XMLConstants::XMLENC_NS,false);
586 PROC_TYPED_CHILD(EncryptionProperties,XMLConstants::XMLENC_NS,false);
587 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
590 void processAttribute(const DOMAttr* attribute) {
591 PROC_ID_ATTRIB(Id,ID,NULL);
592 PROC_STRING_ATTRIB(Type,TYPE,NULL);
593 PROC_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
594 PROC_STRING_ATTRIB(Encoding,ENCODING,NULL);
595 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
599 class XMLTOOL_DLLLOCAL EncryptedDataImpl : public virtual EncryptedData, public EncryptedTypeImpl
602 virtual ~EncryptedDataImpl() {}
604 EncryptedDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
605 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
607 EncryptedDataImpl(const EncryptedDataImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {}
609 IMPL_XMLOBJECT_CLONE(EncryptedData);
610 EncryptedType* cloneEncryptedType() const {
611 return new EncryptedDataImpl(*this);
615 class XMLTOOL_DLLLOCAL EncryptedKeyImpl : public virtual EncryptedKey, public EncryptedTypeImpl
619 m_ReferenceList=NULL;
620 m_CarriedKeyName=NULL;
621 m_children.push_back(NULL);
622 m_children.push_back(NULL);
623 m_pos_ReferenceList=m_pos_EncryptionProperties;
624 ++m_pos_ReferenceList;
625 m_pos_CarriedKeyName=m_pos_ReferenceList;
626 ++m_pos_CarriedKeyName;
630 virtual ~EncryptedKeyImpl() {
631 XMLString::release(&m_Recipient);
634 EncryptedKeyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
635 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
639 EncryptedKeyImpl(const EncryptedKeyImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {
643 IMPL_XMLOBJECT_CLONE(EncryptedKey);
644 EncryptedType* cloneEncryptedType() const {
645 return new EncryptedKeyImpl(*this);
647 IMPL_STRING_ATTRIB(Recipient);
648 IMPL_TYPED_CHILD(ReferenceList);
649 IMPL_TYPED_CHILD(CarriedKeyName);
652 void marshallAttributes(DOMElement* domElement) const {
653 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
654 EncryptedTypeImpl::marshallAttributes(domElement);
657 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
658 PROC_TYPED_CHILD(ReferenceList,XMLConstants::XMLENC_NS,false);
659 PROC_TYPED_CHILD(CarriedKeyName,XMLConstants::XMLENC_NS,false);
660 EncryptedTypeImpl::processChildElement(childXMLObject,root);
663 void processAttribute(const DOMAttr* attribute) {
664 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
665 EncryptedTypeImpl::processAttribute(attribute);
671 #if defined (_MSC_VER)
672 #pragma warning( pop )
675 // Builder Implementations
677 IMPL_XMLOBJECTBUILDER(CarriedKeyName);
678 IMPL_XMLOBJECTBUILDER(CipherData);
679 IMPL_XMLOBJECTBUILDER(CipherReference);
680 IMPL_XMLOBJECTBUILDER(CipherValue);
681 IMPL_XMLOBJECTBUILDER(DataReference);
682 IMPL_XMLOBJECTBUILDER(EncryptedData);
683 IMPL_XMLOBJECTBUILDER(EncryptedKey);
684 IMPL_XMLOBJECTBUILDER(EncryptionMethod);
685 IMPL_XMLOBJECTBUILDER(EncryptionProperties);
686 IMPL_XMLOBJECTBUILDER(EncryptionProperty);
687 IMPL_XMLOBJECTBUILDER(KeyReference);
688 IMPL_XMLOBJECTBUILDER(KeySize);
689 IMPL_XMLOBJECTBUILDER(OAEPparams);
690 IMPL_XMLOBJECTBUILDER(ReferenceList);
691 IMPL_XMLOBJECTBUILDER(Transforms);
695 const XMLCh CarriedKeyName::LOCAL_NAME[] = UNICODE_LITERAL_14(C,a,r,r,i,e,d,K,e,y,N,a,m,e);
696 const XMLCh CipherData::LOCAL_NAME[] = UNICODE_LITERAL_10(C,i,p,h,e,r,D,a,t,a);
697 const XMLCh CipherData::TYPE_NAME[] = UNICODE_LITERAL_14(C,i,p,h,e,r,D,a,t,a,T,y,p,e);
698 const XMLCh CipherReference::LOCAL_NAME[] = UNICODE_LITERAL_15(C,i,p,h,e,r,R,e,f,e,r,e,n,c,e);
699 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);
700 const XMLCh CipherReference::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
701 const XMLCh CipherValue::LOCAL_NAME[] = UNICODE_LITERAL_11(C,i,p,h,e,r,V,a,l,u,e);
702 const XMLCh DataReference::LOCAL_NAME[] = UNICODE_LITERAL_13(D,a,t,a,R,e,f,e,r,e,n,c,e);
703 const XMLCh EncryptedData::LOCAL_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,D,a,t,a);
704 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);
705 const XMLCh EncryptedKey::LOCAL_NAME[] = UNICODE_LITERAL_12(E,n,c,r,y,p,t,e,d,K,e,y);
706 const XMLCh EncryptedKey::TYPE_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,e,d,K,e,y,T,y,p,e);
707 const XMLCh EncryptedKey::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
708 const XMLCh EncryptedType::LOCAL_NAME[] = {chNull};
709 const XMLCh EncryptedType::TYPE_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,T,y,p,e);
710 const XMLCh EncryptedType::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
711 const XMLCh EncryptedType::TYPE_ATTRIB_NAME[] = UNICODE_LITERAL_4(T,y,p,e);
712 const XMLCh EncryptedType::MIMETYPE_ATTRIB_NAME[] = UNICODE_LITERAL_8(M,i,m,e,T,y,p,e);
713 const XMLCh EncryptedType::ENCODING_ATTRIB_NAME[] = UNICODE_LITERAL_8(E,n,c,o,d,i,n,g);
714 const XMLCh EncryptionMethod::LOCAL_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,i,o,n,M,e,t,h,o,d);
715 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);
716 const XMLCh EncryptionMethod::ALGORITHM_ATTRIB_NAME[] = UNICODE_LITERAL_9(A,l,g,o,r,i,t,h,m);
717 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);
718 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);
719 const XMLCh EncryptionProperties::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
720 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);
721 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);
722 const XMLCh EncryptionProperty::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
723 const XMLCh EncryptionProperty::TARGET_ATTRIB_NAME[] = UNICODE_LITERAL_6(T,a,r,g,e,t);
724 const XMLCh KeyReference::LOCAL_NAME[] = UNICODE_LITERAL_12(K,e,y,R,e,f,e,r,e,n,c,e);
725 const XMLCh KeySize::LOCAL_NAME[] = UNICODE_LITERAL_7(K,e,y,S,i,z,e);
726 const XMLCh OAEPparams::LOCAL_NAME[] = UNICODE_LITERAL_10(O,A,E,P,p,a,r,a,m,s);
727 const XMLCh ReferenceList::LOCAL_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,L,i,s,t);
728 const XMLCh ReferenceType::LOCAL_NAME[] = {chNull};
729 const XMLCh ReferenceType::TYPE_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,T,y,p,e);
730 const XMLCh ReferenceType::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
731 const XMLCh Transforms::LOCAL_NAME[] = UNICODE_LITERAL_10(T,r,a,n,s,f,o,r,m,s);
732 const XMLCh Transforms::TYPE_NAME[] = UNICODE_LITERAL_14(T,r,a,n,s,f,o,r,m,s,T,y,p,e);