1*ec61c6edSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ec61c6edSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ec61c6edSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ec61c6edSAndrew Rist  * distributed with this work for additional information
6*ec61c6edSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ec61c6edSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ec61c6edSAndrew Rist  * "License"); you may not use this file except in compliance
9*ec61c6edSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ec61c6edSAndrew Rist  *
11*ec61c6edSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ec61c6edSAndrew Rist  *
13*ec61c6edSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ec61c6edSAndrew Rist  * software distributed under the License is distributed on an
15*ec61c6edSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ec61c6edSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ec61c6edSAndrew Rist  * specific language governing permissions and limitations
18*ec61c6edSAndrew Rist  * under the License.
19*ec61c6edSAndrew Rist  *
20*ec61c6edSAndrew Rist  *************************************************************/
21*ec61c6edSAndrew Rist 
22*ec61c6edSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <tools/link.hxx>
25cdf0e10cSrcweir #include <rtl/ustring.hxx>
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx>
28cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
31cdf0e10cSrcweir #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
32cdf0e10cSrcweir #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace com {
35cdf0e10cSrcweir namespace sun {
36cdf0e10cSrcweir namespace star {
37cdf0e10cSrcweir namespace io {
38cdf0e10cSrcweir     class XStream;
39cdf0e10cSrcweir     class XOutputStream;
40cdf0e10cSrcweir     class XInputStream; }
41cdf0e10cSrcweir namespace embed {
42cdf0e10cSrcweir     class XStorage; }
43cdf0e10cSrcweir }}}
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 
46cdf0e10cSrcweir // MT: Not needed any more, remove later...
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class ImplXMLSignatureListener : public cppu::WeakImplHelper3
49cdf0e10cSrcweir <
50cdf0e10cSrcweir 	com::sun::star::xml::crypto::sax::XSignatureCreationResultListener,
51cdf0e10cSrcweir 	com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener,
52cdf0e10cSrcweir 	com::sun::star::xml::sax::XDocumentHandler
53cdf0e10cSrcweir >
54cdf0e10cSrcweir {
55cdf0e10cSrcweir private:
56cdf0e10cSrcweir     Link        maCreationResultListenerListener;
57cdf0e10cSrcweir     Link        maVerifyResultListenerListener;
58cdf0e10cSrcweir     Link        maStartVerifySignatureElementListener;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir 	com::sun::star::uno::Reference<
61cdf0e10cSrcweir 		com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir public:
64cdf0e10cSrcweir 	ImplXMLSignatureListener( const Link& rCreationResultListenerListener, const Link rVerifyResultListenerListener, const Link rStartVerifySignatureElement );
65cdf0e10cSrcweir 	~ImplXMLSignatureListener();
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	void setNextHandler(com::sun::star::uno::Reference<
68cdf0e10cSrcweir 		com::sun::star::xml::sax::XDocumentHandler > xNextHandler);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	// com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
71cdf0e10cSrcweir 	virtual void SAL_CALL signatureCreated( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus creationResult )
72cdf0e10cSrcweir 		throw (com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir 
74cdf0e10cSrcweir     // com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
75cdf0e10cSrcweir     virtual void SAL_CALL signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus verifyResult )
76cdf0e10cSrcweir 		throw (com::sun::star::uno::RuntimeException);
77cdf0e10cSrcweir 
78cdf0e10cSrcweir     // com::sun::star::xml::sax::XDocumentHandler
79cdf0e10cSrcweir 	virtual void SAL_CALL startElement( const rtl::OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs )
80cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	virtual void SAL_CALL startDocument(  )
83cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	virtual void SAL_CALL endDocument(  )
86cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	virtual void SAL_CALL endElement( const rtl::OUString& aName )
89cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	virtual void SAL_CALL characters( const rtl::OUString& aChars )
92cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	virtual void SAL_CALL ignorableWhitespace( const rtl::OUString& aWhitespaces )
95cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	virtual void SAL_CALL processingInstruction( const rtl::OUString& aTarget, const rtl::OUString& aData )
98cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 	virtual void SAL_CALL setDocumentLocator( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XLocator >& xLocator )
101cdf0e10cSrcweir 		throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException);
102cdf0e10cSrcweir };
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
105cdf0e10cSrcweir // ---------------------------------------------------------------------------------
106cdf0e10cSrcweir // XUriBinding
107cdf0e10cSrcweir // ---------------------------------------------------------------------------------
108cdf0e10cSrcweir 
109cdf0e10cSrcweir class UriBindingHelper : public cppu::WeakImplHelper1
110cdf0e10cSrcweir <
111cdf0e10cSrcweir 	com::sun::star::xml::crypto::XUriBinding
112cdf0e10cSrcweir >
113cdf0e10cSrcweir {
114cdf0e10cSrcweir private:
115cdf0e10cSrcweir     com::sun::star::uno::Reference < com::sun::star::embed::XStorage > mxStorage;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 
118cdf0e10cSrcweir public:
119cdf0e10cSrcweir     UriBindingHelper();
120cdf0e10cSrcweir     UriBindingHelper( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStorage );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     void SAL_CALL setUriBinding( const rtl::OUString& uri, const com::sun::star::uno::Reference< com::sun::star::io::XInputStream >& aInputStream )
123cdf0e10cSrcweir 		throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL getUriBinding( const rtl::OUString& uri )
126cdf0e10cSrcweir 		throw (com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
127cdf0e10cSrcweir 
128cdf0e10cSrcweir     static com::sun::star::uno::Reference < com::sun::star::io::XInputStream > OpenInputStream( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rxStore, const rtl::OUString& rURI );
129cdf0e10cSrcweir };
130cdf0e10cSrcweir 
131