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"
32 #include "validation/AbstractValidatingXMLObject.h"
34 #include <xercesc/util/XMLUniDefs.hpp>
36 using namespace xmlencryption;
37 using namespace xmltooling;
40 #if defined (_MSC_VER)
41 #pragma warning( push )
42 #pragma warning( disable : 4250 4251 )
45 namespace xmlencryption {
47 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CarriedKeyName);
48 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,CipherValue);
49 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,KeySize);
50 DECL_XMLOBJECTIMPL_SIMPLE(XMLTOOL_DLLLOCAL,OAEPparams);
52 class XMLTOOL_DLLLOCAL EncryptionMethodImpl : public virtual EncryptionMethod,
53 public AbstractComplexElement,
54 public AbstractDOMCachingXMLObject,
55 public AbstractValidatingXMLObject,
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), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
82 setAlgorithm(src.getAlgorithm());
84 setKeySize(src.getKeySize()->cloneKeySize());
85 if (src.getOAEPparams())
86 setOAEPparams(src.getOAEPparams()->cloneOAEPparams());
87 VectorOf(XMLObject) v=getOtherParameters();
88 for (vector<XMLObject*>::const_iterator i=src.m_OtherParameters.begin(); i!=src.m_OtherParameters.end(); i++) {
90 v.push_back((*i)->clone());
95 IMPL_XMLOBJECT_CLONE(EncryptionMethod);
96 IMPL_STRING_ATTRIB(Algorithm);
97 IMPL_TYPED_CHILD(KeySize);
98 IMPL_TYPED_CHILD(OAEPparams);
99 IMPL_XMLOBJECT_CHILDREN(OtherParameter,m_children.end());
102 void marshallAttributes(DOMElement* domElement) const {
103 MARSHALL_STRING_ATTRIB(Algorithm,ALGORITHM,NULL);
106 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
107 PROC_TYPED_CHILD(KeySize,XMLConstants::XMLENC_NS,false);
108 PROC_TYPED_CHILD(OAEPparams,XMLConstants::XMLENC_NS,false);
111 const XMLCh* nsURI=root->getNamespaceURI();
112 if (!XMLString::equals(nsURI,XMLConstants::XMLENC_NS) && nsURI && *nsURI) {
113 getOtherParameters().push_back(childXMLObject);
117 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
120 void processAttribute(const DOMAttr* attribute) {
121 PROC_STRING_ATTRIB(Algorithm,ALGORITHM,NULL);
122 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
126 class XMLTOOL_DLLLOCAL TransformsImpl : public virtual Transforms,
127 public AbstractComplexElement,
128 public AbstractDOMCachingXMLObject,
129 public AbstractValidatingXMLObject,
130 public AbstractXMLObjectMarshaller,
131 public AbstractXMLObjectUnmarshaller
134 virtual ~TransformsImpl() {}
136 TransformsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
137 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
140 TransformsImpl(const TransformsImpl& src)
141 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
142 VectorOf(xmlsignature::Transform) v=getTransforms();
143 for (vector<xmlsignature::Transform*>::const_iterator i=src.m_Transforms.begin(); i!=src.m_Transforms.end(); i++) {
145 v.push_back((*i)->cloneTransform());
150 IMPL_XMLOBJECT_CLONE(Transforms);
151 IMPL_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,m_children.end());
154 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
155 PROC_TYPED_FOREIGN_CHILDREN(Transform,xmlsignature,XMLConstants::XMLSIG_NS,false);
156 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
160 class XMLTOOL_DLLLOCAL CipherReferenceImpl : public virtual CipherReference,
161 public AbstractComplexElement,
162 public AbstractDOMCachingXMLObject,
163 public AbstractValidatingXMLObject,
164 public AbstractXMLObjectMarshaller,
165 public AbstractXMLObjectUnmarshaller
170 m_children.push_back(NULL);
171 m_pos_Transforms=m_children.begin();
174 virtual ~CipherReferenceImpl() {
175 XMLString::release(&m_URI);
178 CipherReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
179 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
183 CipherReferenceImpl(const CipherReferenceImpl& src)
184 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
186 setURI(src.getURI());
187 if (src.getTransforms())
188 setTransforms(src.getTransforms()->cloneTransforms());
191 IMPL_XMLOBJECT_CLONE(CipherReference);
192 IMPL_STRING_ATTRIB(URI);
193 IMPL_TYPED_CHILD(Transforms);
196 void marshallAttributes(DOMElement* domElement) const {
197 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
200 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
201 PROC_TYPED_CHILD(Transforms,XMLConstants::XMLENC_NS,false);
202 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
205 void processAttribute(const DOMAttr* attribute) {
206 PROC_STRING_ATTRIB(URI,URI,NULL);
207 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
211 class XMLTOOL_DLLLOCAL CipherDataImpl : public virtual CipherData,
212 public AbstractComplexElement,
213 public AbstractDOMCachingXMLObject,
214 public AbstractValidatingXMLObject,
215 public AbstractXMLObjectMarshaller,
216 public AbstractXMLObjectUnmarshaller
220 m_CipherReference=NULL;
221 m_children.push_back(NULL);
222 m_children.push_back(NULL);
223 m_pos_CipherValue=m_children.begin();
224 m_pos_CipherReference=m_pos_CipherValue;
225 ++m_pos_CipherReference;
228 virtual ~CipherDataImpl() {}
230 CipherDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
231 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
235 CipherDataImpl(const CipherDataImpl& src)
236 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
238 if (src.getCipherValue())
239 setCipherValue(src.getCipherValue()->cloneCipherValue());
240 if (src.getCipherReference())
241 setCipherReference(src.getCipherReference()->cloneCipherReference());
244 IMPL_XMLOBJECT_CLONE(CipherData);
245 IMPL_TYPED_CHILD(CipherValue);
246 IMPL_TYPED_CHILD(CipherReference);
249 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
250 PROC_TYPED_CHILD(CipherValue,XMLConstants::XMLENC_NS,false);
251 PROC_TYPED_CHILD(CipherReference,XMLConstants::XMLENC_NS,false);
252 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
256 class XMLTOOL_DLLLOCAL EncryptionPropertyImpl : public virtual EncryptionProperty,
257 public AbstractElementProxy,
258 public AbstractAttributeExtensibleXMLObject,
259 public AbstractDOMCachingXMLObject,
260 public AbstractValidatingXMLObject,
261 public AbstractXMLObjectMarshaller,
262 public AbstractXMLObjectUnmarshaller
268 virtual ~EncryptionPropertyImpl() {
269 XMLString::release(&m_Id);
270 XMLString::release(&m_Target);
273 EncryptionPropertyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
274 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
278 EncryptionPropertyImpl(const EncryptionPropertyImpl& src)
279 : AbstractXMLObject(src),
280 AbstractElementProxy(src),
281 AbstractAttributeExtensibleXMLObject(src),
282 AbstractDOMCachingXMLObject(src),
283 AbstractValidatingXMLObject(src) {
286 setTarget(src.getTarget());
287 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
289 getXMLObjects().push_back((*i)->clone());
294 IMPL_XMLOBJECT_CLONE(EncryptionProperty);
295 IMPL_STRING_ATTRIB(Id);
296 IMPL_STRING_ATTRIB(Target);
298 void setAttribute(QName& qualifiedName, const XMLCh* value) {
299 if (!qualifiedName.hasNamespaceURI()) {
300 if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME))
302 else if (XMLString::equals(qualifiedName.getLocalPart(),TARGET_ATTRIB_NAME))
305 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value);
309 void marshallAttributes(DOMElement* domElement) const {
310 MARSHALL_ID_ATTRIB(Id,ID,NULL);
311 MARSHALL_STRING_ATTRIB(Target,TARGET,NULL);
313 // Take care of wildcard.
314 for (map<QName,XMLCh*>::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) {
315 DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart());
316 if (i->first.hasPrefix())
317 attr->setPrefix(i->first.getPrefix());
318 attr->setNodeValue(i->second);
319 domElement->setAttributeNode(attr);
323 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
324 getXMLObjects().push_back(childXMLObject);
327 void processAttribute(const DOMAttr* attribute) {
328 PROC_ID_ATTRIB(Id,ID,NULL);
329 QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix());
330 setAttribute(q,attribute->getNodeValue());
334 class XMLTOOL_DLLLOCAL EncryptionPropertiesImpl : public virtual EncryptionProperties,
335 public AbstractComplexElement,
336 public AbstractDOMCachingXMLObject,
337 public AbstractValidatingXMLObject,
338 public AbstractXMLObjectMarshaller,
339 public AbstractXMLObjectUnmarshaller
345 virtual ~EncryptionPropertiesImpl() {
346 XMLString::release(&m_Id);
349 EncryptionPropertiesImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
350 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
354 EncryptionPropertiesImpl(const EncryptionPropertiesImpl& src)
355 : AbstractXMLObject(src),
356 AbstractDOMCachingXMLObject(src),
357 AbstractValidatingXMLObject(src) {
360 VectorOf(EncryptionProperty) v=getEncryptionPropertys();
361 for (vector<EncryptionProperty*>::const_iterator i=src.m_EncryptionPropertys.begin(); i!=src.m_EncryptionPropertys.end(); i++) {
363 v.push_back((*i)->cloneEncryptionProperty());
368 IMPL_XMLOBJECT_CLONE(EncryptionProperties);
369 IMPL_STRING_ATTRIB(Id);
370 IMPL_TYPED_CHILDREN(EncryptionProperty,m_children.end());
373 void marshallAttributes(DOMElement* domElement) const {
374 MARSHALL_ID_ATTRIB(Id,ID,NULL);
377 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
378 PROC_TYPED_CHILDREN(EncryptionProperty,XMLConstants::XMLENC_NS,false);
379 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
382 void processAttribute(const DOMAttr* attribute) {
383 PROC_ID_ATTRIB(Id,ID,NULL);
384 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
388 class XMLTOOL_DLLLOCAL ReferenceTypeImpl : public virtual ReferenceType,
389 public AbstractElementProxy,
390 public AbstractDOMCachingXMLObject,
391 public AbstractValidatingXMLObject,
392 public AbstractXMLObjectMarshaller,
393 public AbstractXMLObjectUnmarshaller
400 ReferenceTypeImpl() {
405 virtual ~ReferenceTypeImpl() {
406 XMLString::release(&m_URI);
409 ReferenceTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
410 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
414 ReferenceTypeImpl(const ReferenceTypeImpl& src)
415 : AbstractXMLObject(src),
416 AbstractElementProxy(src),
417 AbstractDOMCachingXMLObject(src),
418 AbstractValidatingXMLObject(src) {
420 setURI(src.getURI());
421 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
423 getXMLObjects().push_back((*i)->clone());
428 IMPL_XMLOBJECT_CLONE(ReferenceType);
429 IMPL_STRING_ATTRIB(URI);
432 void marshallAttributes(DOMElement* domElement) const {
433 MARSHALL_STRING_ATTRIB(URI,URI,NULL);
436 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
437 getXMLObjects().push_back(childXMLObject);
440 void processAttribute(const DOMAttr* attribute) {
441 PROC_STRING_ATTRIB(URI,URI,NULL);
442 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
446 class XMLTOOL_DLLLOCAL DataReferenceImpl : public virtual DataReference, public ReferenceTypeImpl
449 virtual ~DataReferenceImpl() {}
451 DataReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
452 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
454 DataReferenceImpl(const DataReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
456 IMPL_XMLOBJECT_CLONE(DataReference);
457 ReferenceType* cloneReferenceType() const {
458 return new DataReferenceImpl(*this);
462 class XMLTOOL_DLLLOCAL KeyReferenceImpl : public virtual KeyReference, public ReferenceTypeImpl
465 virtual ~KeyReferenceImpl() {}
467 KeyReferenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
468 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
470 KeyReferenceImpl(const KeyReferenceImpl& src) : AbstractXMLObject(src), ReferenceTypeImpl(src) {}
472 IMPL_XMLOBJECT_CLONE(KeyReference);
473 ReferenceType* cloneReferenceType() const {
474 return new KeyReferenceImpl(*this);
478 class XMLTOOL_DLLLOCAL ReferenceListImpl : public virtual ReferenceList,
479 public AbstractComplexElement,
480 public AbstractDOMCachingXMLObject,
481 public AbstractValidatingXMLObject,
482 public AbstractXMLObjectMarshaller,
483 public AbstractXMLObjectUnmarshaller
486 virtual ~ReferenceListImpl() {}
488 ReferenceListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
489 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
492 ReferenceListImpl(const ReferenceListImpl& src)
493 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
494 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
496 DataReference* data=dynamic_cast<DataReference*>(*i);
498 getDataReferences().push_back(data->cloneDataReference());
502 KeyReference* key=dynamic_cast<KeyReference*>(*i);
504 getKeyReferences().push_back(key->cloneKeyReference());
511 IMPL_XMLOBJECT_CLONE(ReferenceList);
512 IMPL_TYPED_CHILDREN(DataReference,m_children.end());
513 IMPL_TYPED_CHILDREN(KeyReference,m_children.end());
516 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
517 PROC_TYPED_CHILDREN(DataReference,XMLConstants::XMLENC_NS,false);
518 PROC_TYPED_CHILDREN(KeyReference,XMLConstants::XMLENC_NS,false);
519 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
523 class XMLTOOL_DLLLOCAL EncryptedTypeImpl : public virtual EncryptedType,
524 public AbstractComplexElement,
525 public AbstractDOMCachingXMLObject,
526 public AbstractValidatingXMLObject,
527 public AbstractXMLObjectMarshaller,
528 public AbstractXMLObjectUnmarshaller
531 m_Id=m_Type=m_MimeType=m_Encoding=NULL;
532 m_EncryptionMethod=NULL;
535 m_EncryptionProperties=NULL;
536 m_children.push_back(NULL);
537 m_children.push_back(NULL);
538 m_children.push_back(NULL);
539 m_children.push_back(NULL);
540 m_pos_EncryptionMethod=m_children.begin();
541 m_pos_KeyInfo=m_pos_EncryptionMethod;
543 m_pos_CipherData=m_pos_KeyInfo;
545 m_pos_EncryptionProperties=m_pos_CipherData;
546 ++m_pos_EncryptionProperties;
549 EncryptedTypeImpl() {
554 virtual ~EncryptedTypeImpl() {
555 XMLString::release(&m_Id);
556 XMLString::release(&m_Type);
557 XMLString::release(&m_MimeType);
558 XMLString::release(&m_Encoding);
561 EncryptedTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
562 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
566 EncryptedTypeImpl(const EncryptedTypeImpl& src)
567 : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src), AbstractValidatingXMLObject(src) {
570 setType(src.getType());
571 setMimeType(src.getMimeType());
572 setEncoding(src.getEncoding());
573 if (src.getEncryptionMethod())
574 setEncryptionMethod(src.getEncryptionMethod()->cloneEncryptionMethod());
575 if (src.getKeyInfo())
576 setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
577 if (src.getCipherData())
578 setCipherData(src.getCipherData()->cloneCipherData());
579 if (src.getEncryptionProperties())
580 setEncryptionProperties(src.getEncryptionProperties()->cloneEncryptionProperties());
583 IMPL_XMLOBJECT_CLONE(EncryptedType);
584 IMPL_STRING_ATTRIB(Id);
585 IMPL_STRING_ATTRIB(Type);
586 IMPL_STRING_ATTRIB(MimeType);
587 IMPL_STRING_ATTRIB(Encoding);
588 IMPL_TYPED_CHILD(EncryptionMethod);
589 IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
590 IMPL_TYPED_CHILD(CipherData);
591 IMPL_TYPED_CHILD(EncryptionProperties);
594 void marshallAttributes(DOMElement* domElement) const {
595 MARSHALL_ID_ATTRIB(Id,ID,NULL);
596 MARSHALL_STRING_ATTRIB(Type,TYPE,NULL);
597 MARSHALL_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
598 MARSHALL_STRING_ATTRIB(Encoding,ENCODING,NULL);
601 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
602 PROC_TYPED_CHILD(EncryptionMethod,XMLConstants::XMLENC_NS,false);
603 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLConstants::XMLSIG_NS,false);
604 PROC_TYPED_CHILD(CipherData,XMLConstants::XMLENC_NS,false);
605 PROC_TYPED_CHILD(EncryptionProperties,XMLConstants::XMLENC_NS,false);
606 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
609 void processAttribute(const DOMAttr* attribute) {
610 PROC_ID_ATTRIB(Id,ID,NULL);
611 PROC_STRING_ATTRIB(Type,TYPE,NULL);
612 PROC_STRING_ATTRIB(MimeType,MIMETYPE,NULL);
613 PROC_STRING_ATTRIB(Encoding,ENCODING,NULL);
614 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
618 class XMLTOOL_DLLLOCAL EncryptedDataImpl : public virtual EncryptedData, public EncryptedTypeImpl
621 virtual ~EncryptedDataImpl() {}
623 EncryptedDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
624 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
626 EncryptedDataImpl(const EncryptedDataImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {}
628 IMPL_XMLOBJECT_CLONE(EncryptedData);
629 EncryptedType* cloneEncryptedType() const {
630 return new EncryptedDataImpl(*this);
634 class XMLTOOL_DLLLOCAL EncryptedKeyImpl : public virtual EncryptedKey, public EncryptedTypeImpl
638 m_ReferenceList=NULL;
639 m_CarriedKeyName=NULL;
640 m_children.push_back(NULL);
641 m_children.push_back(NULL);
642 m_pos_ReferenceList=m_pos_EncryptionProperties;
643 ++m_pos_ReferenceList;
644 m_pos_CarriedKeyName=m_pos_ReferenceList;
645 ++m_pos_CarriedKeyName;
649 virtual ~EncryptedKeyImpl() {
650 XMLString::release(&m_Recipient);
653 EncryptedKeyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
654 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
658 EncryptedKeyImpl(const EncryptedKeyImpl& src) : AbstractXMLObject(src), EncryptedTypeImpl(src) {
662 IMPL_XMLOBJECT_CLONE(EncryptedKey);
663 EncryptedType* cloneEncryptedType() const {
664 return new EncryptedKeyImpl(*this);
666 IMPL_STRING_ATTRIB(Recipient);
667 IMPL_TYPED_CHILD(ReferenceList);
668 IMPL_TYPED_CHILD(CarriedKeyName);
671 void marshallAttributes(DOMElement* domElement) const {
672 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
673 EncryptedTypeImpl::marshallAttributes(domElement);
676 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
677 PROC_TYPED_CHILD(ReferenceList,XMLConstants::XMLENC_NS,false);
678 PROC_TYPED_CHILD(CarriedKeyName,XMLConstants::XMLENC_NS,false);
679 EncryptedTypeImpl::processChildElement(childXMLObject,root);
682 void processAttribute(const DOMAttr* attribute) {
683 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
684 EncryptedTypeImpl::processAttribute(attribute);
690 #if defined (_MSC_VER)
691 #pragma warning( pop )
694 // Builder Implementations
696 IMPL_XMLOBJECTBUILDER(CarriedKeyName);
697 IMPL_XMLOBJECTBUILDER(CipherData);
698 IMPL_XMLOBJECTBUILDER(CipherReference);
699 IMPL_XMLOBJECTBUILDER(CipherValue);
700 IMPL_XMLOBJECTBUILDER(DataReference);
701 IMPL_XMLOBJECTBUILDER(EncryptedData);
702 IMPL_XMLOBJECTBUILDER(EncryptedKey);
703 IMPL_XMLOBJECTBUILDER(EncryptionMethod);
704 IMPL_XMLOBJECTBUILDER(EncryptionProperties);
705 IMPL_XMLOBJECTBUILDER(EncryptionProperty);
706 IMPL_XMLOBJECTBUILDER(KeyReference);
707 IMPL_XMLOBJECTBUILDER(KeySize);
708 IMPL_XMLOBJECTBUILDER(OAEPparams);
709 IMPL_XMLOBJECTBUILDER(ReferenceList);
710 IMPL_XMLOBJECTBUILDER(Transforms);
714 const XMLCh CarriedKeyName::LOCAL_NAME[] = UNICODE_LITERAL_14(C,a,r,r,i,e,d,K,e,y,N,a,m,e);
715 const XMLCh CipherData::LOCAL_NAME[] = UNICODE_LITERAL_10(C,i,p,h,e,r,D,a,t,a);
716 const XMLCh CipherData::TYPE_NAME[] = UNICODE_LITERAL_14(C,i,p,h,e,r,D,a,t,a,T,y,p,e);
717 const XMLCh CipherReference::LOCAL_NAME[] = UNICODE_LITERAL_15(C,i,p,h,e,r,R,e,f,e,r,e,n,c,e);
718 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);
719 const XMLCh CipherReference::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
720 const XMLCh CipherValue::LOCAL_NAME[] = UNICODE_LITERAL_11(C,i,p,h,e,r,V,a,l,u,e);
721 const XMLCh DataReference::LOCAL_NAME[] = UNICODE_LITERAL_13(D,a,t,a,R,e,f,e,r,e,n,c,e);
722 const XMLCh EncryptedData::LOCAL_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,D,a,t,a);
723 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);
724 const XMLCh EncryptedKey::LOCAL_NAME[] = UNICODE_LITERAL_12(E,n,c,r,y,p,t,e,d,K,e,y);
725 const XMLCh EncryptedKey::TYPE_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,e,d,K,e,y,T,y,p,e);
726 const XMLCh EncryptedKey::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
727 const XMLCh EncryptedType::LOCAL_NAME[] = {chNull};
728 const XMLCh EncryptedType::TYPE_NAME[] = UNICODE_LITERAL_13(E,n,c,r,y,p,t,e,d,T,y,p,e);
729 const XMLCh EncryptedType::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
730 const XMLCh EncryptedType::TYPE_ATTRIB_NAME[] = UNICODE_LITERAL_4(T,y,p,e);
731 const XMLCh EncryptedType::MIMETYPE_ATTRIB_NAME[] = UNICODE_LITERAL_8(M,i,m,e,T,y,p,e);
732 const XMLCh EncryptedType::ENCODING_ATTRIB_NAME[] = UNICODE_LITERAL_8(E,n,c,o,d,i,n,g);
733 const XMLCh EncryptionMethod::LOCAL_NAME[] = UNICODE_LITERAL_16(E,n,c,r,y,p,t,i,o,n,M,e,t,h,o,d);
734 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);
735 const XMLCh EncryptionMethod::ALGORITHM_ATTRIB_NAME[] = UNICODE_LITERAL_9(A,l,g,o,r,i,t,h,m);
736 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);
737 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);
738 const XMLCh EncryptionProperties::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
739 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);
740 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);
741 const XMLCh EncryptionProperty::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,d);
742 const XMLCh EncryptionProperty::TARGET_ATTRIB_NAME[] = UNICODE_LITERAL_6(T,a,r,g,e,t);
743 const XMLCh KeyReference::LOCAL_NAME[] = UNICODE_LITERAL_12(K,e,y,R,e,f,e,r,e,n,c,e);
744 const XMLCh KeySize::LOCAL_NAME[] = UNICODE_LITERAL_7(K,e,y,S,i,z,e);
745 const XMLCh OAEPparams::LOCAL_NAME[] = UNICODE_LITERAL_10(O,A,E,P,p,a,r,a,m,s);
746 const XMLCh ReferenceList::LOCAL_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,L,i,s,t);
747 const XMLCh ReferenceType::LOCAL_NAME[] = {chNull};
748 const XMLCh ReferenceType::TYPE_NAME[] = UNICODE_LITERAL_13(R,e,f,e,r,e,n,c,e,T,y,p,e);
749 const XMLCh ReferenceType::URI_ATTRIB_NAME[] = UNICODE_LITERAL_3(U,R,I);
750 const XMLCh Transforms::LOCAL_NAME[] = UNICODE_LITERAL_10(T,r,a,n,s,f,o,r,m,s);
751 const XMLCh Transforms::TYPE_NAME[] = UNICODE_LITERAL_14(T,r,a,n,s,f,o,r,m,s,T,y,p,e);