INTEGRATION: CWS xmlsec06 (1.1.1.1.2); FILE MERGED

2004/10/12 08:30:49 mmi 1.1.1.1.2.1: add error detail information
Issue number:
Submitted by:
Reviewed by:
This commit is contained in:
Rüdiger Timm
2004-11-26 13:55:17 +00:00
parent 57849918d5
commit a1fb0e060c
5 changed files with 63 additions and 29 deletions

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: signaturecreatorimpl.cxx,v $ * $RCSfile: signaturecreatorimpl.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ * last change: $Author: rt $ $Date: 2004-11-26 14:54:21 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -160,10 +160,7 @@ void SignatureCreatorImpl::notifyResultListener() const
cssu::Reference< cssxc::sax::XSignatureCreationResultListener > cssu::Reference< cssxc::sax::XSignatureCreationResultListener >
xSignatureCreationResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; xSignatureCreationResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
xSignatureCreationResultListener->signatureCreated( xSignatureCreationResultListener->signatureCreated( m_nSecurityId, m_nStatus );
m_nSecurityId,
m_bOperationSucceed?(cssxc::sax::SignatureCreationResult_CREATIONSUCCEED):
(cssxc::sax::SignatureCreationResult_CREATIONFAIL));
} }
void SignatureCreatorImpl::startEngine( const cssu::Reference< void SignatureCreatorImpl::startEngine( const cssu::Reference<
@@ -202,18 +199,17 @@ void SignatureCreatorImpl::startEngine( const cssu::Reference<
try try
{ {
xResultTemplate = m_xXMLSignature->generate(xSignatureTemplate, m_xXMLSecurityContext); xResultTemplate = m_xXMLSignature->generate(xSignatureTemplate, m_xXMLSecurityContext);
m_nStatus = xResultTemplate->getStatus();
} }
catch( cssu::Exception& ) catch( cssu::Exception& )
{ {
xResultTemplate = NULL; m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED;
} }
if (xResultTemplate.is()) if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
{ {
cssu::Reference < cssxw::XXMLElementWrapper > xResultSignature = xResultTemplate->getTemplate(); cssu::Reference < cssxw::XXMLElementWrapper > xResultSignature = xResultTemplate->getTemplate();
m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultSignature); m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultSignature);
m_bOperationSucceed = true;
} }
} }

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: signatureverifierimpl.cxx,v $ * $RCSfile: signatureverifierimpl.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ * last change: $Author: rt $ $Date: 2004-11-26 14:54:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -155,10 +155,7 @@ void SignatureVerifierImpl::notifyResultListener() const
cssu::Reference< cssxc::sax::XSignatureVerifyResultListener > cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >
xSignatureVerifyResultListener ( m_xResultListener , cssu::UNO_QUERY ) ; xSignatureVerifyResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
xSignatureVerifyResultListener->signatureVerified( xSignatureVerifyResultListener->signatureVerified( m_nSecurityId, m_nStatus );
m_nSecurityId,
m_bOperationSucceed?(cssxc::sax::SignatureVerifyResult_VERIFYSUCCEED):
(cssxc::sax::SignatureVerifyResult_VERIFYFAIL));
} }
void SignatureVerifierImpl::startEngine( const cssu::Reference< void SignatureVerifierImpl::startEngine( const cssu::Reference<
@@ -191,16 +188,15 @@ void SignatureVerifierImpl::startEngine( const cssu::Reference<
* Email: michael.mi@sun.com * Email: michael.mi@sun.com
******************************************************************************/ ******************************************************************************/
{ {
cssu::Reference< cssxc::XXMLSignatureTemplate > xResultTemplate;
try try
{ {
if ( m_xXMLSignature->validate(xSignatureTemplate, m_xXMLSecurityContext)) xResultTemplate = m_xXMLSignature->validate(xSignatureTemplate, m_xXMLSecurityContext);
{ m_nStatus = xResultTemplate->getStatus();
m_bOperationSucceed = true;
}
} }
catch( cssu::Exception& ) catch( cssu::Exception& )
{ {
m_bOperationSucceed = false; m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED;
} }
} }

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlencryptiontemplateimpl.cxx,v $ * $RCSfile: xmlencryptiontemplateimpl.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ * last change: $Author: rt $ $Date: 2004-11-26 14:54:49 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -79,7 +79,11 @@ using ::rtl::OUString ;
using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; using ::com::sun::star::xml::wrapper::XXMLElementWrapper ;
using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ; using ::com::sun::star::xml::crypto::XXMLEncryptionTemplate ;
XMLEncryptionTemplateImpl :: XMLEncryptionTemplateImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) , m_xTemplate( NULL ) , m_xTarget( NULL ) { XMLEncryptionTemplateImpl :: XMLEncryptionTemplateImpl( const Reference< XMultiServiceFactory >& aFactory )
: m_xServiceManager( aFactory ),
m_xTemplate( NULL ),
m_xTarget( NULL ),
m_nStatus ( ::com::sun::star::xml::crypto::SecurityOperationStatus_STATUS_UNKNOWN ) {
} }
XMLEncryptionTemplateImpl :: ~XMLEncryptionTemplateImpl() { XMLEncryptionTemplateImpl :: ~XMLEncryptionTemplateImpl() {
@@ -112,6 +116,19 @@ throw (com::sun::star::uno::RuntimeException)
return m_xTarget ; return m_xTarget ;
} }
void SAL_CALL XMLEncryptionTemplateImpl::setStatus(
::com::sun::star::xml::crypto::SecurityOperationStatus status )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
m_nStatus = status;
}
::com::sun::star::xml::crypto::SecurityOperationStatus SAL_CALL XMLEncryptionTemplateImpl::getStatus( )
throw (::com::sun::star::uno::RuntimeException)
{
return m_nStatus;
}
/* XInitialization */ /* XInitialization */
void SAL_CALL XMLEncryptionTemplateImpl :: initialize( const Sequence< Any >& aArguments ) throw( Exception, RuntimeException ) { void SAL_CALL XMLEncryptionTemplateImpl :: initialize( const Sequence< Any >& aArguments ) throw( Exception, RuntimeException ) {
// TBD // TBD

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlencryptiontemplateimpl.hxx,v $ * $RCSfile: xmlencryptiontemplateimpl.hxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ * last change: $Author: rt $ $Date: 2004-11-26 14:55:03 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -119,6 +119,7 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3<
::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ; ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTemplate ;
::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTarget ; ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > m_xTarget ;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
::com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
public : public :
XMLEncryptionTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ; XMLEncryptionTemplateImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
@@ -140,6 +141,13 @@ class XMLEncryptionTemplateImpl : public ::cppu::WeakImplHelper3<
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTarget( virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::wrapper::XXMLElementWrapper > SAL_CALL getTarget(
) throw (com::sun::star::uno::RuntimeException) ; ) throw (com::sun::star::uno::RuntimeException) ;
virtual void SAL_CALL setStatus(
::com::sun::star::xml::crypto::SecurityOperationStatus status )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::xml::crypto::SecurityOperationStatus
SAL_CALL getStatus( )
throw (::com::sun::star::uno::RuntimeException);
//Methods from XInitialization //Methods from XInitialization
virtual void SAL_CALL initialize( virtual void SAL_CALL initialize(
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: xmlsignaturetemplateimpl.cxx,v $ * $RCSfile: xmlsignaturetemplateimpl.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: mt $ $Date: 2004-07-12 13:15:23 $ * last change: $Author: rt $ $Date: 2004-11-26 14:55:17 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -83,7 +83,11 @@ using ::rtl::OUString ;
using ::com::sun::star::xml::wrapper::XXMLElementWrapper ; using ::com::sun::star::xml::wrapper::XXMLElementWrapper ;
using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ; using ::com::sun::star::xml::crypto::XXMLSignatureTemplate ;
XMLSignatureTemplateImpl :: XMLSignatureTemplateImpl( const Reference< XMultiServiceFactory >& aFactory ) : m_xServiceManager( aFactory ) , m_xTemplate( NULL ) { XMLSignatureTemplateImpl :: XMLSignatureTemplateImpl( const Reference< XMultiServiceFactory >& aFactory )
:m_xServiceManager( aFactory ),
m_xTemplate( NULL ),
m_nStatus ( ::com::sun::star::xml::crypto::SecurityOperationStatus_STATUS_UNKNOWN )
{
} }
XMLSignatureTemplateImpl :: ~XMLSignatureTemplateImpl() { XMLSignatureTemplateImpl :: ~XMLSignatureTemplateImpl() {
@@ -141,6 +145,19 @@ void SAL_CALL XMLSignatureTemplateImpl::setBinding(
return m_xUriBinding; return m_xUriBinding;
} }
void SAL_CALL XMLSignatureTemplateImpl::setStatus(
::com::sun::star::xml::crypto::SecurityOperationStatus status )
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
m_nStatus = status;
}
::com::sun::star::xml::crypto::SecurityOperationStatus SAL_CALL XMLSignatureTemplateImpl::getStatus( )
throw (::com::sun::star::uno::RuntimeException)
{
return m_nStatus;
}
/* XInitialization */ /* XInitialization */
void SAL_CALL XMLSignatureTemplateImpl :: initialize( const Sequence< Any >& aArguments ) throw( Exception, RuntimeException ) { void SAL_CALL XMLSignatureTemplateImpl :: initialize( const Sequence< Any >& aArguments ) throw( Exception, RuntimeException ) {
// TBD // TBD