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: securityengine.cxx,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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmlsecurity.hxx"
34 #include "securityengine.hxx"
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
37 namespace cssu
= com::sun::star::uno
;
38 namespace cssl
= com::sun::star::lang
;
39 namespace cssxc
= com::sun::star::xml::crypto
;
40 namespace cssxw
= com::sun::star::xml::wrapper
;
42 #define DECLARE_ASCII( SASCIIVALUE ) \
43 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SASCIIVALUE ) )
45 SecurityEngine::SecurityEngine( const cssu::Reference
< cssl::XMultiServiceFactory
>& rxMSF
)
47 m_nIdOfTemplateEC(-1),
48 m_nNumOfResolvedReferences(0),
50 m_bMissionDone(false),
52 m_nStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_UNKNOWN
)
56 /* XReferenceResolvedListener */
57 void SAL_CALL
SecurityEngine::referenceResolved( sal_Int32
/*referenceId*/)
58 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
)
60 m_nNumOfResolvedReferences
++;
65 void SAL_CALL
SecurityEngine::setKeyId( sal_Int32 id
)
66 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
)
73 sal_Bool SAL_CALL
SecurityEngine::endMission( )
74 throw (com::sun::star::uno::RuntimeException
)
76 sal_Bool rc
= m_bMissionDone
;
82 notifyResultListener();
83 m_bMissionDone
= true;
86 m_xResultListener
= NULL
;
87 m_xSAXEventKeeper
= NULL
;