1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 /*
21  * XSEC
22  *
23  * XKMSRegisterRequestImpl := Implementation for RegisterRequest Messages
24  *
25  * $Id: XKMSRegisterRequestImpl.hpp 1820685 2018-01-09 17:48:51Z scantor $
26  *
27  */
28 
29 #ifndef XKMSREGISTERREQUESTIMPL_INCLUDE
30 #define XKMSREGISTERREQUESTIMPL_INCLUDE
31 
32 // XSEC Includes
33 
34 #include <xsec/framework/XSECDefs.hpp>
35 #include <xsec/xkms/XKMSRegisterRequest.hpp>
36 
37 #ifdef XSEC_XKMS_ENABLED
38 
39 #include "XKMSRequestAbstractTypeImpl.hpp"
40 
41 class XKMSAuthenticationImpl;
42 class XKMSPrototypeKeyBindingImpl;
43 class DSIGSignature;
44 
45 class XKMSRegisterRequestImpl : public XKMSRegisterRequest {
46 
47 public:
48 	XKMSRequestAbstractTypeImpl m_request;
49 	XKMSMessageAbstractTypeImpl &m_msg;
50 public:
51 
52 	XKMSRegisterRequestImpl(
53 		const XSECEnv * env
54 	);
55 
56 	XKMSRegisterRequestImpl(
57 		const XSECEnv * env,
58 		XERCES_CPP_NAMESPACE_QUALIFIER DOMElement * node
59 	);
60 
61 	virtual ~XKMSRegisterRequestImpl();
62 
63 	// Load elements
64 	void load();
65 
66 	// Creation
67 	XERCES_CPP_NAMESPACE_QUALIFIER DOMElement *
68 		createBlankRegisterRequest(
69 		const XMLCh * service,
70 		const XMLCh * id = NULL);
71 
72 
73 	/* Getter Interface Methods */
74 	virtual XKMSPrototypeKeyBinding * getPrototypeKeyBinding(void) const;
75 	virtual XKMSAuthentication * getAuthentication (void) const;
76 	virtual DSIGSignature * getProofOfPossessionSignature(void) const;
77 
78 	/* Setter Interface Methods */
79 
80 	virtual XKMSPrototypeKeyBinding * addPrototypeKeyBinding(void);
81 	virtual XKMSAuthentication * addAuthentication(void);
82 	virtual DSIGSignature * addProofOfPossessionSignature(
83 		const XMLCh* c14nAlgorithm,
84 		const XMLCh* signatureAlgorithm,
85 		const XMLCh* hashAlgorithm);
86 
87 	/* Implemented from MessageAbstractType */
88 	virtual messageType getMessageType(void);
89 
90 	/* Forced inheritance from XKMSMessageAbstractTypeImpl */
91 	XKMS_MESSAGEABSTRACTYPE_IMPL_METHODS
92 
93 	/* Forced inheritance from RequestAbstractType */
94 	XKMS_REQUESTABSTRACTYPE_IMPL_METHODS
95 
96 
97 private:
98 
99 	XKMSAuthenticationImpl		* mp_authentication;
100 	XKMSPrototypeKeyBindingImpl	* mp_prototypeKeyBinding;
101 	DSIGSignature				* mp_proofOfPossessionSignature;
102 
103 	XSECProvider				m_prov;		// For creating the signature
104 
105 	// Unimplemented
106 	XKMSRegisterRequestImpl(void);
107 	XKMSRegisterRequestImpl(const XKMSRegisterRequestImpl &);
108 	XKMSRegisterRequestImpl & operator = (const XKMSRegisterRequestImpl &);
109 
110 };
111 
112 #endif /* XSEC_XKMS_ENABLED */
113 #endif /* XKMSREGISTERREQUESTIMPL_INCLUDE */
114