1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlsignaturehelper2.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <tools/link.hxx>
32 #include <rtl/ustring.hxx>
34 #include <cppuhelper/implbase1.hxx>
35 #include <cppuhelper/implbase3.hxx>
37 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
38 #include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
39 #include <com/sun/star/xml/crypto/sax/XSignatureVerifyResultListener.hpp>
53 // MT: Not needed any more, remove later...
55 class ImplXMLSignatureListener
: public cppu::WeakImplHelper3
57 com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
,
58 com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
,
59 com::sun::star::xml::sax::XDocumentHandler
63 Link maCreationResultListenerListener
;
64 Link maVerifyResultListenerListener
;
65 Link maStartVerifySignatureElementListener
;
67 com::sun::star::uno::Reference
<
68 com::sun::star::xml::sax::XDocumentHandler
> m_xNextHandler
;
71 ImplXMLSignatureListener( const Link
& rCreationResultListenerListener
, const Link rVerifyResultListenerListener
, const Link rStartVerifySignatureElement
);
72 ~ImplXMLSignatureListener();
74 void setNextHandler(com::sun::star::uno::Reference
<
75 com::sun::star::xml::sax::XDocumentHandler
> xNextHandler
);
77 // com::sun::star::xml::crypto::sax::XSignatureCreationResultListener
78 virtual void SAL_CALL
signatureCreated( sal_Int32 securityId
, com::sun::star::xml::crypto::SecurityOperationStatus creationResult
)
79 throw (com::sun::star::uno::RuntimeException
);
81 // com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener
82 virtual void SAL_CALL
signatureVerified( sal_Int32 securityId
, com::sun::star::xml::crypto::SecurityOperationStatus verifyResult
)
83 throw (com::sun::star::uno::RuntimeException
);
85 // com::sun::star::xml::sax::XDocumentHandler
86 virtual void SAL_CALL
startElement( const rtl::OUString
& aName
, const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XAttributeList
>& xAttribs
)
87 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
89 virtual void SAL_CALL
startDocument( )
90 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
92 virtual void SAL_CALL
endDocument( )
93 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
95 virtual void SAL_CALL
endElement( const rtl::OUString
& aName
)
96 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
98 virtual void SAL_CALL
characters( const rtl::OUString
& aChars
)
99 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
101 virtual void SAL_CALL
ignorableWhitespace( const rtl::OUString
& aWhitespaces
)
102 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
104 virtual void SAL_CALL
processingInstruction( const rtl::OUString
& aTarget
, const rtl::OUString
& aData
)
105 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
107 virtual void SAL_CALL
setDocumentLocator( const com::sun::star::uno::Reference
< com::sun::star::xml::sax::XLocator
>& xLocator
)
108 throw (com::sun::star::xml::sax::SAXException
, com::sun::star::uno::RuntimeException
);
112 // ---------------------------------------------------------------------------------
114 // ---------------------------------------------------------------------------------
116 class UriBindingHelper
: public cppu::WeakImplHelper1
118 com::sun::star::xml::crypto::XUriBinding
122 com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
> mxStorage
;
127 UriBindingHelper( const com::sun::star::uno::Reference
< com::sun::star::embed::XStorage
>& rxStorage
);
129 void SAL_CALL
setUriBinding( const rtl::OUString
& uri
, const com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
>& aInputStream
)
130 throw (com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
132 com::sun::star::uno::Reference
< com::sun::star::io::XInputStream
> SAL_CALL
getUriBinding( const rtl::OUString
& uri
)
133 throw (com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
135 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
);