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;
38 using xmlconstants::XMLENC_NS;
39 using xmlconstants::XMLSIG_NS;
41 #if defined (_MSC_VER)
42 #pragma warning( push )
43 #pragma warning( disable : 4250 4251 )
46 namespace xmlencryption {
48 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CarriedKeyName);
49 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CipherValue);
50 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,KeySize);
51 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,OAEPparams);
53 class XMLTOOL_DLLLOCAL EncryptionMethodImpl : public virtual EncryptionMethod,
54 public AbstractComplexElement,
55 public AbstractDOMCachingXMLObject,
56 public AbstractXMLObjectMarshaller,
57 public AbstractXMLObjectUnmarshaller
63 m_children.push_back(NULL);
64 m_children.push_back(NULL);
65 m_pos_KeySize=m_children.begin();
66 m_pos_OAEPparams=m_pos_KeySize;
70 virtual ~EncryptionMethodImpl() {
71 XMLString::release(&m_Algorithm);
74 EncryptionMethodImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
75 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
79 EncryptionMethodImpl(const EncryptionMethodImpl& src)
80 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
82 setAlgorithm(src.getAlgorithm());
84 setKeySize(src.getKeySize()->cloneKeySize());
85 if (src.getOAEPparams())
86 setOAEPparams(src.getOAEPparams()->cloneOAEPparams());
87 VectorOf(XMLObject) v=getUnknownXMLObjects();
88 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
89 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(UnknownXMLObject,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,XMLENC_NS,false);
105 PROC_TYPED_CHILD(OAEPparams,XMLENC_NS,false);
108 const XMLCh* nsURI=root->getNamespaceURI();
109 if (!XMLString::equals(nsURI,XMLENC_NS) && nsURI && *nsURI) {
110 getUnknownXMLObjects().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)
137 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
138 VectorOf(xmlsignature::Transform) v=getTransforms();
139 for (vector<xmlsignature::Transform*>::const_iterator i=src.m_Transforms.begin(); i!=src.m_Transforms.end(); i++) {
141 v.push_back((*i)->cloneTransform());
146 IMPL_XMLOBJECT_CLONE(Transforms);
147 IMPL_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,m_children.end());
150 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
151 PROC_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,XMLSIG_NS,false);
152 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
156 class XMLTOOL_DLLLOCAL CipherReferenceImpl : public virtual CipherReference,
157 public AbstractComplexElement,
158 public AbstractDOMCachingXMLObject,
159 public AbstractXMLObjectMarshaller,
160 public AbstractXMLObjectUnmarshaller
165 m_children.push_back(NULL);
166 m_pos_Transforms=m_children.begin();
169 virtual ~CipherReferenceImpl() {
170 XMLString::release(&m_URI);
173 CipherReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
174 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
178 CipherReferenceImpl(const CipherReferenceImpl& src)
179 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
181 setURI(src.getURI());
182 if (src.getTransforms())
183 setTransforms(src.getTransforms()->cloneTransforms());
186 IMPL_XMLOBJECT_CLONE(CipherReference);
187 IMPL_STRING_ATTRIB(URI);
188 IMPL_TYPED_CHILD(Transforms);
191 void marshallAttributes(DOMElement* domElement) const {
192 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
195 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
196 PROC_TYPED_CHILD(Transforms,XMLENC_NS,false);
197 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
200 void processAttribute(const DOMAttr* attribute) {
201 PROC_STRING_ATTRIB(URI,URI,NULL);
202 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
206 class XMLTOOL_DLLLOCAL CipherDataImpl : public virtual CipherData,
207 public AbstractComplexElement,
208 public AbstractDOMCachingXMLObject,
209 public AbstractXMLObjectMarshaller,
210 public AbstractXMLObjectUnmarshaller
214 m_CipherReference=NULL;
215 m_children.push_back(NULL);
216 m_children.push_back(NULL);
217 m_pos_CipherValue=m_children.begin();
218 m_pos_CipherReference=m_pos_CipherValue;
219 ++m_pos_CipherReference;
222 virtual ~CipherDataImpl() {}
224 CipherDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
225 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
229 CipherDataImpl(const CipherDataImpl& src)
230 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
232 if (src.getCipherValue())
233 setCipherValue(src.getCipherValue()->cloneCipherValue());
234 if (src.getCipherReference())
235 setCipherReference(src.getCipherReference()->cloneCipherReference());
238 IMPL_XMLOBJECT_CLONE(CipherData);
239 IMPL_TYPED_CHILD(CipherValue);
240 IMPL_TYPED_CHILD(CipherReference);
243 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
244 PROC_TYPED_CHILD(CipherValue,XMLENC_NS,false);
245 PROC_TYPED_CHILD(CipherReference,XMLENC_NS,false);
246 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
250 class XMLTOOL_DLLLOCAL EncryptionPropertyImpl : public virtual EncryptionProperty,
251 public AbstractAttributeExtensibleXMLObject,
252 public AbstractComplexElement,
253 public AbstractDOMCachingXMLObject,
254 public AbstractXMLObjectMarshaller,
255 public AbstractXMLObjectUnmarshaller
261 virtual ~EncryptionPropertyImpl() {
262 XMLString::release(&m_Id);
263 XMLString::release(&m_Target);
266 EncryptionPropertyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
267 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
271 EncryptionPropertyImpl(const EncryptionPropertyImpl& src)
272 : AbstractXMLObject(src),
273 AbstractAttributeExtensibleXMLObject(src),
274 AbstractComplexElement(src),
275 AbstractDOMCachingXMLObject(src) {
278 setTarget(src.getTarget());
279 VectorOf(XMLObject) v=getUnknownXMLObjects();
280 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
281 v.push_back((*i)->clone());
284 IMPL_XMLOBJECT_CLONE(EncryptionProperty);
286 IMPL_STRING_ATTRIB(Target);
287 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject, m_children.end());
289 void setAttribute(QName& qualifiedName, const XMLCh* value) {
290 if (!qualifiedName.hasNamespaceURI()) {
291 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
295 else if (XMLString::equals(qualifiedName.getLocalPart(),TARGET_ATTRIB_NAME)) {
300 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
304 void marshallAttributes(DOMElement* domElement) const {
305 MARSHALL_ID_ATTRIB(Id,ID,NULL);
306 MARSHALL_STRING_ATTRIB(Target,TARGET,NULL);
307 marshallExtensionAttributes(domElement);
310 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
311 getUnknownXMLObjects().push_back(childXMLObject);
314 void processAttribute(const DOMAttr* attribute) {
315 PROC_ID_ATTRIB(Id,ID,NULL);
316 unmarshallExtensionAttribute(attribute);
320 class XMLTOOL_DLLLOCAL EncryptionPropertiesImpl : public virtual EncryptionProperties,
321 public AbstractComplexElement,
322 public AbstractDOMCachingXMLObject,
323 public AbstractXMLObjectMarshaller,
324 public AbstractXMLObjectUnmarshaller
330 virtual ~EncryptionPropertiesImpl() {
331 XMLString::release(&m_Id);
334 EncryptionPropertiesImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
335 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
339 EncryptionPropertiesImpl(const EncryptionPropertiesImpl& src)
340 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
343 VectorOf(EncryptionProperty) v=getEncryptionPropertys();
344 for (vector<EncryptionProperty*>::const_iterator i=src.m_EncryptionPropertys.begin(); i!=src.m_EncryptionPropertys.end(); i++) {
346 v.push_back((*i)->cloneEncryptionProperty());
351 IMPL_XMLOBJECT_CLONE(EncryptionProperties);
353 IMPL_TYPED_CHILDREN(EncryptionProperty,m_children.end());
356 void marshallAttributes(DOMElement* domElement) const {
357 MARSHALL_ID_ATTRIB(Id,ID,NULL);
360 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
361 PROC_TYPED_CHILDREN(EncryptionProperty,XMLENC_NS,false);
362 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
365 void processAttribute(const DOMAttr* attribute) {
366 PROC_ID_ATTRIB(Id,ID,NULL);
367 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
371 class XMLTOOL_DLLLOCAL ReferenceTypeImpl : public virtual ReferenceType,
372 public AbstractComplexElement,
373 public AbstractDOMCachingXMLObject,
374 public AbstractXMLObjectMarshaller,
375 public AbstractXMLObjectUnmarshaller
382 ReferenceTypeImpl() {
387 virtual ~ReferenceTypeImpl() {
388 XMLString::release(&m_URI);
391 ReferenceTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
392 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
396 ReferenceTypeImpl(const ReferenceTypeImpl& src)
397 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
399 setURI(src.getURI());
400 VectorOf(XMLObject) v=getUnknownXMLObjects();
401 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
402 v.push_back((*i)->clone());
405 IMPL_XMLOBJECT_CLONE(ReferenceType);
406 IMPL_STRING_ATTRIB(URI);
407 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
410 void marshallAttributes(DOMElement* domElement) const {
411 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
414 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
415 getUnknownXMLObjects().push_back(childXMLObject);
418 void processAttribute(const DOMAttr* attribute) {
419 PROC_STRING_ATTRIB(URI,URI,NULL);
420 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
424 class XMLTOOL_DLLLOCAL DataReferenceImpl : public virtual DataReference, public ReferenceTypeImpl
427 virtual ~DataReferenceImpl() {}
429 DataReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
430 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
432 DataReferenceImpl(const DataReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
434 IMPL_XMLOBJECT_CLONE(DataReference);
435 ReferenceType* cloneReferenceType() const {
436 return new DataReferenceImpl(*this);
440 class XMLTOOL_DLLLOCAL KeyReferenceImpl : public virtual KeyReference, public ReferenceTypeImpl
443 virtual ~KeyReferenceImpl() {}
445 KeyReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
446 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
448 KeyReferenceImpl(const KeyReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
450 IMPL_XMLOBJECT_CLONE(KeyReference);
451 ReferenceType* cloneReferenceType() const {
452 return new KeyReferenceImpl(*this);
456 class XMLTOOL_DLLLOCAL ReferenceListImpl : public virtual ReferenceList,
457 public AbstractComplexElement,
458 public AbstractDOMCachingXMLObject,
459 public AbstractXMLObjectMarshaller,
460 public AbstractXMLObjectUnmarshaller
463 virtual ~ReferenceListImpl() {}
465 ReferenceListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
466 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
469 ReferenceListImpl(const ReferenceListImpl& src)
470 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
471 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
473 DataReference* data=dynamic_cast<DataReference*>(*i);
475 getDataReferences().push_back(data->cloneDataReference());
479 KeyReference* key=dynamic_cast<KeyReference*>(*i);
481 getKeyReferences().push_back(key->cloneKeyReference());
488 IMPL_XMLOBJECT_CLONE(ReferenceList);
489 IMPL_TYPED_CHILDREN(DataReference,m_children.end());
490 IMPL_TYPED_CHILDREN(KeyReference,m_children.end());
493 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
494 PROC_TYPED_CHILDREN(DataReference,XMLENC_NS,false);
495 PROC_TYPED_CHILDREN(KeyReference,XMLENC_NS,false);
496 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
500 class XMLTOOL_DLLLOCAL EncryptedTypeImpl : public virtual EncryptedType,
501 public AbstractComplexElement,
502 public AbstractDOMCachingXMLObject,
503 public AbstractXMLObjectMarshaller,
504 public AbstractXMLObjectUnmarshaller
507 m_Id=m_Type=m_MimeType=m_Encoding=NULL;
508 m_EncryptionMethod=NULL;
511 m_EncryptionProperties=NULL;
512 m_children.push_back(NULL);
513 m_children.push_back(NULL);
514 m_children.push_back(NULL);
515 m_children.push_back(NULL);
516 m_pos_EncryptionMethod=m_children.begin();
517 m_pos_KeyInfo=m_pos_EncryptionMethod;
519 m_pos_CipherData=m_pos_KeyInfo;
521 m_pos_EncryptionProperties=m_pos_CipherData;
522 ++m_pos_EncryptionProperties;
525 EncryptedTypeImpl() {
530 virtual ~EncryptedTypeImpl() {
531 XMLString::release(&m_Id);
532 XMLString::release(&m_Type);
533 XMLString::release(&m_MimeType);
534 XMLString::release(&m_Encoding);
537 EncryptedTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
538 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
542 EncryptedTypeImpl(const EncryptedTypeImpl& src)
543 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
546 setType(src.getType());
547 setMimeType(src.getMimeType());
548 setEncoding(src.getEncoding());
549 if (src.getEncryptionMethod())
550 setEncryptionMethod(src.getEncryptionMethod()->cloneEncryptionMethod());
551 if (src.getKeyInfo())
552 setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
553 if (src.getCipherData())
554 setCipherData(src.getCipherData()->cloneCipherData());
555 if (src.getEncryptionProperties())
556 setEncryptionProperties(src.getEncryptionProperties()->cloneEncryptionProperties());
559 IMPL_XMLOBJECT_CLONE(EncryptedType);
561 IMPL_STRING_ATTRIB(Type);
562 IMPL_STRING_ATTRIB(MimeType);
563 IMPL_STRING_ATTRIB(Encoding);
564 IMPL_TYPED_CHILD(EncryptionMethod);
565 IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
566 IMPL_TYPED_CHILD(CipherData);
567 IMPL_TYPED_CHILD(EncryptionProperties);
570 void marshallAttributes(DOMElement* domElement) const {
571 MARSHALL_ID_ATTRIB(Id,ID,NULL);
572 MARSHALL_STRING_ATTRIB(Type,TYPE,NULL);
573 MARSHALL_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
574 MARSHALL_STRING_ATTRIB(Encoding,ENCODING,NULL);
577 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
578 PROC_TYPED_CHILD(EncryptionMethod,XMLENC_NS,false);
579 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLSIG_NS,false);
580 PROC_TYPED_CHILD(CipherData,XMLENC_NS,false);
581 PROC_TYPED_CHILD(EncryptionProperties,XMLENC_NS,false);
582 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
585 void processAttribute(const DOMAttr* attribute) {
586 PROC_ID_ATTRIB(Id,ID,NULL);
587 PROC_STRING_ATTRIB(Type,TYPE,NULL);
588 PROC_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
589 PROC_STRING_ATTRIB(Encoding,ENCODING,NULL);
590 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
594 class XMLTOOL_DLLLOCAL EncryptedDataImpl : public virtual EncryptedData, public EncryptedTypeImpl
597 virtual ~EncryptedDataImpl() {}
599 EncryptedDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
600 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
602 EncryptedDataImpl(const EncryptedDataImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {}
604 IMPL_XMLOBJECT_CLONE(EncryptedData);
605 EncryptedType* cloneEncryptedType() const {
606 return new EncryptedDataImpl(*this);
610 class XMLTOOL_DLLLOCAL EncryptedKeyImpl : public virtual EncryptedKey, public EncryptedTypeImpl
614 m_ReferenceList=NULL;
615 m_CarriedKeyName=NULL;
616 m_children.push_back(NULL);
617 m_children.push_back(NULL);
618 m_pos_ReferenceList=m_pos_EncryptionProperties;
619 ++m_pos_ReferenceList;
620 m_pos_CarriedKeyName=m_pos_ReferenceList;
621 ++m_pos_CarriedKeyName;
625 virtual ~EncryptedKeyImpl() {
626 XMLString::release(&m_Recipient);
629 EncryptedKeyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
630 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
634 EncryptedKeyImpl(const EncryptedKeyImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {
638 IMPL_XMLOBJECT_CLONE(EncryptedKey);
639 EncryptedType* cloneEncryptedType() const {
640 return new EncryptedKeyImpl(*this);
642 IMPL_STRING_ATTRIB(Recipient);
643 IMPL_TYPED_CHILD(ReferenceList);
644 IMPL_TYPED_CHILD(CarriedKeyName);
647 void marshallAttributes(DOMElement* domElement) const {
648 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
649 EncryptedTypeImpl::marshallAttributes(domElement);
652 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
653 PROC_TYPED_CHILD(ReferenceList,XMLENC_NS,false);
654 PROC_TYPED_CHILD(CarriedKeyName,XMLENC_NS,false);
655 EncryptedTypeImpl::processChildElement(childXMLObject,root);
658 void processAttribute(const DOMAttr* attribute) {
659 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
660 EncryptedTypeImpl::processAttribute(attribute);
666 #if defined (_MSC_VER)
667 #pragma warning( pop )
670 // Builder Implementations
672 IMPL_XMLOBJECTBUILDER(CarriedKeyName);
673 IMPL_XMLOBJECTBUILDER(CipherData);
674 IMPL_XMLOBJECTBUILDER(CipherReference);
675 IMPL_XMLOBJECTBUILDER(CipherValue);
676 IMPL_XMLOBJECTBUILDER(DataReference);
677 IMPL_XMLOBJECTBUILDER(EncryptedData);
678 IMPL_XMLOBJECTBUILDER(EncryptedKey);
679 IMPL_XMLOBJECTBUILDER(EncryptionMethod);
680 IMPL_XMLOBJECTBUILDER(EncryptionProperties);
681 IMPL_XMLOBJECTBUILDER(EncryptionProperty);
682 IMPL_XMLOBJECTBUILDER(KeyReference);
683 IMPL_XMLOBJECTBUILDER(KeySize);
684 IMPL_XMLOBJECTBUILDER(OAEPparams);
685 IMPL_XMLOBJECTBUILDER(ReferenceList);
686 IMPL_XMLOBJECTBUILDER(Transforms);
690 const XMLCh CarriedKeyName::LOCAL_NAME[] = UNICODE_LITERAL_14(C,a,r,r,i,e,d,K,e,y,N,a,m,e);
691 const XMLCh CipherData::LOCAL_NAME[] = UNICODE_LITERAL_10(C,i,p,h,e,r,D,a,t,a);
692 const XMLCh CipherData::TYPE_NAME[] = UNICODE_LITERAL_14(C,i,p,h,e,r,D,a,t,a,T,y,p,e);
693 const XMLCh CipherReference::LOCAL_NAME[] = UNICODE_LITERAL_15(C,i,p,h,e,r,R,e,f,e,r,e,n,c,e);
694 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);
695 const XMLCh CipherReference::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
696 const XMLCh CipherValue::LOCAL_NAME[] = UNICODE_LITERAL_11(C,i,p,h,e,r,V,a,l,u,e);
697 const XMLCh DataReference::LOCAL_NAME[] = UNICODE_LITERAL_13(D,a,t,a,R,e,f,e,r,e,n,c,e);
698 const XMLCh EncryptedData::LOCAL_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,D,a,t,a);
699 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);
700 const XMLCh EncryptedKey::LOCAL_NAME[] = UNICODE_LITERAL_12(E,n,c,r,y,p,t,e,d,K,e,y);
701 const XMLCh EncryptedKey::TYPE_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,e,d,K,e,y,T,y,p,e);
702 const XMLCh EncryptedKey::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
703 const XMLCh EncryptedType::LOCAL_NAME[] = {chNull};
704 const XMLCh EncryptedType::TYPE_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,T,y,p,e);
705 const XMLCh EncryptedType::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
706 const XMLCh EncryptedType::TYPE_ATTRIB_NAME[] = UNICODE_LITERAL_4(T,y,p,e);
707 const XMLCh EncryptedType::MIMETYPE_ATTRIB_NAME[] = UNICODE_LITERAL_8(M,i,m,e,T,y,p,e);
708 const XMLCh EncryptedType::ENCODING_ATTRIB_NAME[] = UNICODE_LITERAL_8(E,n,c,o,d,i,n,g);
709 const XMLCh EncryptionMethod::LOCAL_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,i,o,n,M,e,t,h,o,d);
710 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);
711 const XMLCh EncryptionMethod::ALGORITHM_ATTRIB_NAME[] = UNICODE_LITERAL_9(A,l,g,o,r,i,t,h,m);
712 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);
713 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);
714 const XMLCh EncryptionProperties::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
715 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);
716 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);
717 const XMLCh EncryptionProperty::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
718 const XMLCh EncryptionProperty::TARGET_ATTRIB_NAME[] = UNICODE_LITERAL_6(T,a,r,g,e,t);
719 const XMLCh KeyReference::LOCAL_NAME[] = UNICODE_LITERAL_12(K,e,y,R,e,f,e,r,e,n,c,e);
720 const XMLCh KeySize::LOCAL_NAME[] = UNICODE_LITERAL_7(K,e,y,S,i,z,e);
721 const XMLCh OAEPparams::LOCAL_NAME[] = UNICODE_LITERAL_10(O,A,E,P,p,a,r,a,m,s);
722 const XMLCh ReferenceList::LOCAL_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,L,i,s,t);
723 const XMLCh ReferenceType::LOCAL_NAME[] = {chNull};
724 const XMLCh ReferenceType::TYPE_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,T,y,p,e);
725 const XMLCh ReferenceType::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
726 const XMLCh Transforms::LOCAL_NAME[] = UNICODE_LITERAL_10(T,r,a,n,s,f,o,r,m,s);
727 const XMLCh Transforms::TYPE_NAME[] = UNICODE_LITERAL_14(T,r,a,n,s,f,o,r,m,s,T,y,p,e);