INTEGRATION: CWS xmlsec06 (1.1.1.1.2); FILE MERGED
2004/10/12 08:30:48 mmi 1.1.1.1.2.1: add error detail information Issue number: Submitted by: Reviewed by:
This commit is contained in:
parent
d268d72e80
commit
57849918d5
4 changed files with 24 additions and 29 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: decryptorimpl.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1.1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: mt $ $Date: 2004-07-12 13:15:22 $
|
||||
* last change: $Author: rt $ $Date: 2004-11-26 14:53:28 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -156,10 +156,7 @@ void DecryptorImpl::notifyResultListener() const
|
|||
cssu::Reference< cssxc::sax::XDecryptionResultListener >
|
||||
xDecryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
|
||||
|
||||
xDecryptionResultListener->decrypted(
|
||||
m_nSecurityId,
|
||||
m_bOperationSucceed?(cssxc::sax::DecryptionResult_DECRYPTIONSUCCEED):
|
||||
(cssxc::sax::DecryptionResult_DECRYPTIONFAIL));
|
||||
xDecryptionResultListener->decrypted(m_nSecurityId,m_nStatus);
|
||||
}
|
||||
|
||||
void DecryptorImpl::startEngine( const cssu::Reference<
|
||||
|
@ -193,20 +190,22 @@ void DecryptorImpl::startEngine( const cssu::Reference<
|
|||
* Email: michael.mi@sun.com
|
||||
******************************************************************************/
|
||||
{
|
||||
cssu::Reference< cssxw::XXMLElementWrapper > xDecryptedElement;
|
||||
cssu::Reference< cssxc::XXMLEncryptionTemplate > xResultTemplate;
|
||||
try
|
||||
{
|
||||
xDecryptedElement = m_xXMLEncryption->decrypt(xEncryptionTemplate, m_xXMLSecurityContext);
|
||||
xResultTemplate = m_xXMLEncryption->decrypt(xEncryptionTemplate, m_xXMLSecurityContext);
|
||||
m_nStatus = xResultTemplate->getStatus();
|
||||
}
|
||||
catch( cssu::Exception& )
|
||||
{
|
||||
xDecryptedElement = NULL;
|
||||
m_nStatus = cssxc::SecurityOperationStatus_RUNTIMEERROR_FAILED;
|
||||
}
|
||||
|
||||
if (xDecryptedElement.is())
|
||||
if (m_nStatus == cssxc::SecurityOperationStatus_OPERATION_SUCCEEDED)
|
||||
{
|
||||
cssu::Reference< cssxw::XXMLElementWrapper > xDecryptedElement
|
||||
= xResultTemplate->getTemplate();
|
||||
m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xDecryptedElement);
|
||||
m_bOperationSucceed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: encryptorimpl.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1.1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: mt $ $Date: 2004-07-12 13:15:22 $
|
||||
* last change: $Author: rt $ $Date: 2004-11-26 14:53:41 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -166,10 +166,7 @@ void EncryptorImpl::notifyResultListener() const
|
|||
cssu::Reference< cssxc::sax::XEncryptionResultListener >
|
||||
xEncryptionResultListener ( m_xResultListener , cssu::UNO_QUERY ) ;
|
||||
|
||||
xEncryptionResultListener->encrypted(
|
||||
m_nSecurityId,
|
||||
m_bOperationSucceed?(cssxc::sax::EncryptionResult_ENCRYPTIONSUCCEED):
|
||||
(cssxc::sax::EncryptionResult_ENCRYPTIONFAIL));
|
||||
xEncryptionResultListener->encrypted( m_nSecurityId, m_nStatus );
|
||||
}
|
||||
|
||||
void EncryptorImpl::startEngine( const cssu::Reference<
|
||||
|
@ -213,21 +210,19 @@ void EncryptorImpl::startEngine( const cssu::Reference<
|
|||
{
|
||||
xResultTemplate = m_xXMLEncryption->encrypt(
|
||||
xEncryptionTemplate, m_xXMLSecurityContext);
|
||||
m_nStatus = xResultTemplate->getStatus();
|
||||
}
|
||||
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 > xResultEncryption
|
||||
= xResultTemplate->getTemplate();
|
||||
m_xSAXEventKeeper->setElement(m_nIdOfTemplateEC, xResultEncryption);
|
||||
|
||||
m_xSAXEventKeeper->setElement(m_nReferenceId, NULL);
|
||||
|
||||
m_bOperationSucceed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: securityengine.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:53:55 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -80,7 +80,7 @@ SecurityEngine::SecurityEngine( const cssu::Reference< cssl::XMultiServiceFactor
|
|||
m_nNumOfResolvedReferences(0),
|
||||
m_bMissionDone(false),
|
||||
m_nSecurityId(-1),
|
||||
m_bOperationSucceed(false)
|
||||
m_nStatus(::com::sun::star::xml::crypto::SecurityOperationStatus_STATUS_UNKNOWN)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: securityengine.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:54:08 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -160,9 +160,10 @@ protected:
|
|||
sal_Int32 m_nSecurityId;
|
||||
|
||||
/*
|
||||
* the result of the operation
|
||||
* the status of the operation
|
||||
*/
|
||||
bool m_bOperationSucceed;
|
||||
//bool m_bOperationSucceed;
|
||||
com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus;
|
||||
|
||||
/*
|
||||
* the result listener, which will receives the security operation result.
|
||||
|
|
Loading…
Reference in a new issue