summaryrefslogtreecommitdiff
path: root/xmlsecurity/tools/standalone/mscsfit
diff options
context:
space:
mode:
Diffstat (limited to 'xmlsecurity/tools/standalone/mscsfit')
-rw-r--r--xmlsecurity/tools/standalone/mscsfit/encrypter.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
index d41bd27c2..32e3a02d3 100644
--- a/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
+++ b/xmlsecurity/tools/standalone/mscsfit/encrypter.cxx
@@ -235,7 +235,7 @@ int SAL_CALL main( int argc, char **argv )
"Encryptor - "
"Cannot get interface of \"XXMLSecurityContext\" from service \"xsec.XMLSecurityContext\"" ) ;
- xSecCtx->setSecurityEnvironment( xSecEnv ) ;
+ xSecCtx->addSecurityEnvironment( xSecEnv ) ;
//Get encrypter
Reference< XInterface > xmlencrypter =
@@ -250,10 +250,21 @@ int SAL_CALL main( int argc, char **argv )
"Cannot get interface of \"XXMLEncryption\" from service \"xsec.XMLEncryption\"" ) ;
//perform encryption
- xTemplate = xEncrypter->encrypt( xTemplate , xSecCtx ) ;
+ xTemplate = xEncrypter->encrypt( xTemplate , xSecEnv ) ;
OSL_ENSURE( xTemplate.is() ,
"Encryptor - "
"Cannot encrypt the xml document" ) ;
+
+
+ com::sun::star::xml::crypto::SecurityOperationStatus m_nStatus = xTemplate->getStatus();
+ if (m_nStatus == SecurityOperationStatus_OPERATION_SUCCEEDED)
+ {
+ fprintf( stdout, "Operation succeeds.\n") ;
+ }
+ else
+ {
+ fprintf( stdout, "Operation fails.\n") ;
+ }
} catch( Exception& e ) {
fprintf( stderr , "Error Message: %s\n" , OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US ).getStr() ) ;
goto done ;